Ignore:
Timestamp:
23 Apr 2013, 11:49:18 (12 years ago)
Author:
Henrik Bettermann
Message:

Add hidden field to IApplicantsContainer and hide applicants containers if attribute is set True.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/applicants
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py

    r10095 r10097  
    100100        return html
    101101
     102    @property
     103    def containers(self):
     104        return [value for value in self.context.values() if not value.hidden]
     105
    102106class ApplicantsSearchPage(KofaPage):
    103107    grok.context(IApplicantsRoot)
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt

    r9088 r10097  
    1414  </thead>
    1515  <tbody>
    16     <tr tal:repeat="entry context/values" class="gradeC">
     16    <tr tal:repeat="entry view/containers" class="gradeC">
    1717      <td tal:content="entry/year">Year
    1818      </td>
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py

    r9531 r10097  
    260260        )
    261261
     262    hidden= schema.Bool(
     263        title = _(u'Hide container'),
     264        required = False,
     265        default = True,
     266        )
     267
    262268    def archive(id=None):
    263269        """Create on-dist archive of applicants stored in this term.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r10095 r10097  
    218218        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    219219        self.assertEqual(self.browser.url, self.manage_root_path)
     220        return
     221
     222    def test_hide_container(self):
     223        self.browser.open(self.root_path)
     224        self.assertFalse(
     225            '<a href="http://localhost/app/applicants/app2011">'
     226            'This is the app2011 container</a>' in self.browser.contents)
     227        self.app['applicants']['app2011'].hidden = False
     228        self.browser.open(self.root_path)
     229        self.assertTrue(
     230            '<a href="http://localhost/app/applicants/app2011">'
     231            'This is the app2011 container</a>' in self.browser.contents)
    220232        return
    221233
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py

    r9117 r10097  
    7272            result,
    7373            'application_category,application_fee,code,description,'
    74             'enddate,mode,prefix,startdate,strict_deadline,title,year\r\n'
     74            'enddate,hidden,mode,prefix,startdate,strict_deadline,title,year\r\n'
    7575
    7676            'basic,0.0,dp2012,'
    7777            '"Some Description\nwith linebreak\n<<de>>man spriht deutsh",'
    78             '2012-01-31 23:00:00+00:00,,app,2012-01-01 12:00:00+00:00,1,'
     78            '2012-01-31 23:00:00+00:00,1,,app,2012-01-01 12:00:00+00:00,1,'
    7979            'General Studies 2012/13,2012\r\n'
    8080            )
Note: See TracChangeset for help on using the changeset viewer.