Changeset 12246 for main


Ignore:
Timestamp:
15 Dec 2014, 12:49:01 (10 years ago)
Author:
Henrik Bettermann
Message:

Rename button and redirect after transition to context page.

Remove restwidget.py.

Location:
main/waeup.ikoba/trunk/src/waeup/ikoba
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/browser.py

    r12225 r12246  
    414414            dict(name=x, title=y) for x, y in allowed_transitions]
    415415
    416     @action(_('Save'), style='primary')
    417     def save(self, **data):
     416    @action(_('Apply now'), style='primary')
     417    def apply(self, **data):
    418418        form = self.request.form
    419419        if 'transition' in form and form['transition']:
     
    421421            wf_info = IWorkflowInfo(self.context)
    422422            wf_info.fireTransition(transition_id)
     423            self.flash(_("Transition '%s' executed." % transition_id))
     424            self.redirect(self.url(self.context))
    423425        return
    424426
     
    943945            dict(name=x, title=y) for x, y in allowed_transitions]
    944946
    945     @action(_('Save'), style='primary')
    946     def save(self, **data):
     947    @action(_('Apply now'), style='primary')
     948    def apply(self, **data):
    947949        form = self.request.form
    948950        if 'transition' in form and form['transition']:
     
    951953            try:
    952954                wf_info.fireTransition(transition_id)
     955                self.flash(_("Transition '%s' executed." % transition_id))
    953956            except InvalidTransitionError, error:
    954957                self.flash(error, type="warning")
     958            self.redirect(self.url(self.context))
    955959        return
    956960
     
    12891293            dict(name=x, title=y) for x, y in allowed_transitions]
    12901294
    1291     @action(_('Save'), style='primary')
    1292     def save(self, **data):
     1295    @action(_('Apply now'), style='primary')
     1296    def apply(self, **data):
    12931297        form = self.request.form
    12941298        if 'transition' in form and form['transition']:
     
    12971301            try:
    12981302                wf_info.fireTransition(transition_id)
     1303                self.flash(_("Transition '%s' executed." % transition_id))
    12991304            except InvalidTransitionError, error:
    13001305                self.flash(error, type="warning")
     1306            self.redirect(self.url(self.context))
    13011307        return
    13021308
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_browser.py

    r12221 r12246  
    313313        # Managers can trigger transitions
    314314        self.browser.getControl(name="transition").value = ['start']
    315         self.browser.getControl("Save").click()
     315        self.browser.getControl("Apply now").click()
    316316        # Managers can edit base
    317317        self.browser.open(self.customer_path)
     
    376376        self.browser.open(self.trigtrans_path)
    377377        self.browser.getControl(name="transition").value = ['start']
    378         self.browser.getControl("Save").click()
     378        self.browser.getControl("Apply now").click()
     379        self.browser.open(self.trigtrans_path)
    379380        self.browser.getControl(name="transition").value = ['request']
    380         self.browser.getControl("Save").click()
     381        self.browser.getControl("Apply now").click()
     382        self.browser.open(self.trigtrans_path)
    381383        self.browser.getControl(name="transition").value = ['reject']
    382         self.browser.getControl("Save").click()
     384        self.browser.getControl("Apply now").click()
     385        self.browser.open(self.trigtrans_path)
    383386        self.browser.getControl(name="transition").value = ['request']
    384         self.browser.getControl("Save").click()
     387        self.browser.getControl("Apply now").click()
     388        self.browser.open(self.trigtrans_path)
    385389        self.browser.getControl(name="transition").value = ['approve']
    386         self.browser.getControl("Save").click()
     390        self.browser.getControl("Apply now").click()
     391        self.browser.open(self.trigtrans_path)
    387392        self.browser.getControl(name="transition").value = ['reset1']
    388         self.browser.getControl("Save").click()
     393        self.browser.getControl("Apply now").click()
    389394        return
    390395
     
    843848        self.browser.getLink("Transition").click()
    844849        self.browser.getControl(name="transition").value = ['submit']
    845         self.browser.getControl("Save").click()
     850        self.browser.getControl("Apply now").click()
     851        self.browser.getLink("Transition").click()
    846852        # Document can only be verified if files have been uploaded before
    847853        self.browser.getControl(name="transition").value = ['verify']
    848         self.browser.getControl("Save").click()
     854        self.browser.getControl("Apply now").click()
    849855        self.assertTrue('No file uploaded' in self.browser.contents)
    850856        self.assertEqual(document.state, 'submitted')
     
    10311037        self.browser.open(self.documents_path + '/d101/trigtrans')
    10321038        self.browser.getControl(name="transition").value = ['verify']
    1033         self.browser.getControl("Save").click()
     1039        self.browser.getControl("Apply now").click()
    10341040        self.assertEqual(
    10351041            getattr(self.document, 'sample_md5', None),
     
    11631169        self.browser.getLink("Transition").click()
    11641170        self.browser.getControl(name="transition").value = ['submit']
    1165         self.browser.getControl("Save").click()
     1171        self.browser.getControl("Apply now").click()
     1172        self.browser.getLink("Transition").click()
    11661173        self.browser.getControl(name="transition").value = ['approve']
    1167         self.browser.getControl("Save").click()
     1174        self.browser.getControl("Apply now").click()
    11681175        self.assertEqual(contract.state, 'approved')
    11691176
     
    13261333        self.browser.open(self.contracts_path + '/c101/trigtrans')
    13271334        self.browser.getControl(name="transition").value = ['approve']
    1328         self.browser.getControl("Save").click()
     1335        self.browser.getControl("Apply now").click()
    13291336        # InvalidTransitionError is catched
    13301337        self.assertTrue(
    13311338            '<div class="alert alert-warning">Attached documents must be verified first.</div>'
    13321339            in self.browser.contents)
     1340        self.browser.open(self.contracts_path + '/c101/trigtrans')
    13331341        IWorkflowState(self.document).setState('verified')
    13341342        self.browser.getControl(name="transition").value = ['approve']
    1335         self.browser.getControl("Save").click()
     1343        self.browser.getControl("Apply now").click()
    13361344        self.assertEqual(IWorkflowState(self.contract).getState(), 'approved')
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/browser.py

    r12245 r12246  
    298298            dict(name=x, title=y) for x, y in allowed_transitions]
    299299
    300     @action(_('Save'), style='primary')
    301     def save(self, **data):
     300    @action(_('Apply now'), style='primary')
     301    def apply(self, **data):
    302302        form = self.request.form
    303303        if 'transition' in form and form['transition']:
     
    306306            try:
    307307                wf_info.fireTransition(transition_id)
     308                self.flash(_("Transition '%s' executed." % transition_id))
    308309            except InvalidTransitionError, error:
    309310                self.flash(error, type="warning")
    310         return
     311            self.redirect(self.url(self.context))
     312        return
  • main/waeup.ikoba/trunk/src/waeup/ikoba/documents/tests/test_browser.py

    r12243 r12246  
    167167        self.browser.getLink("Transition").click()
    168168        self.browser.getControl(name="transition").value = ['retract']
    169         self.browser.getControl("Save").click()
     169        self.browser.getControl("Apply now").click()
    170170        self.assertEqual(document.state, 'created')
    171171
     
    252252        self.browser.getLink("Transition").click()
    253253        self.browser.getControl(name="transition").value = ['publish']
    254         self.browser.getControl("Speichern").click()
     254        self.browser.getControl("Jetzt anwenden").click()
    255255        self.assertEqual(document.state, 'published')
    256256
  • main/waeup.ikoba/trunk/src/waeup/ikoba/locales/de/LC_MESSAGES/waeup.ikoba.po

    r12192 r12246  
    1616"Project-Id-Version: WAeUP.KOFA\n"
    1717"POT-Creation-Date: Wed Dec 10 17:36:11 2014\n"
    18 "PO-Revision-Date: 2014-12-10 17:35+0100\n"
     18"PO-Revision-Date: 2014-12-15 13:27+0100\n"
    1919"Last-Translator: Henrik Bettermann <henrik@waeup.org>\n"
    2020"Language-Team: WAeUP Germany <henrik@waeup.org>\n"
     
    2727"X-Poedit-Basepath: \\\\Salsa\\ikoba\\trunk\\src\n"
    2828"X-Generator: Poedit 1.6.5\n"
     29
     30msgid "Apply now"
     31msgstr "Jetzt anwenden"
    2932
    3033#: waeup/ikoba/browser/async.py:91
Note: See TracChangeset for help on using the changeset viewer.