Ignore:
Timestamp:
27 Jan 2021, 09:57:32 (4 years ago)
Author:
Henrik Bettermann
Message:

Disable clearance request button if not in state 'clearance started'.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited

Legend:

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

    r16329 r16387  
    938938        return form_fields
    939939
     940    @property
     941    def do_not_render_buttons(self):
     942        if self.context.state != CLEARANCE:
     943            return ('Save and request clearance',)
     944        return ()
     945
    940946    @action(_('Save'), style='primary')
    941947    def save(self, **data):
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/clearanceeditpage.pt

    r13104 r16387  
    2424      <br />
    2525      <div tal:condition="view/availableActions">
    26         <input tal:repeat="action view/actions"
    27                tal:replace="structure action/render"
    28                />
     26        <span tal:repeat="action view/actions"
     27        tal:omit-tag="">
     28          <input tal:replace="structure action/render"
     29                 tal:condition="python:action.label not in view.do_not_render_buttons"
     30                 />
     31        </span>
    2932      </div>
    3033    </div>
Note: See TracChangeset for help on using the changeset viewer.