Permalink
Browse files

made redirect work

  • Loading branch information...
1 parent 16984fb commit b9197cee2980db97f57d745c6e2677355468d9df @pilz pilz committed Apr 22, 2012
Showing with 14 additions and 15 deletions.
  1. +12 −15 src/slc/mailrouter/browser/add.pt
  2. +2 −0 src/slc/mailrouter/browser/views.py
@@ -4,25 +4,22 @@
<div id="content-core" metal:fill-slot="main">
<h1 i18n:translate="add_mailroute">Configure Mail Route</h1>
- <form action="@@add-mailroute" method="post"
+ <form action="@@add-mailroute" method="post" class="xvalidate"
tal:define="errors python:request.get('errors', {})">
- <div class="field"
- tal:define="error errors/name|nothing"
- tal:attributes="class python:error and 'field error' or 'field'">
- <label for="name">Friendly Name</label>
- <span class="fieldRequired" title="Required"
- i18n:attributes="title title_required;"
- i18n:translate="label_required">
- (Required)
- </span>
- <div class="fieldErrorBox"
- tal:content="error">Error</div>
- <input type="text" name="name" size="8"
+ <fieldset class="concise">
+ <label for="name">Friendly Name <sup class="required">*</sup>
+
+ <input type="text" name="name" class="required"
tal:attributes="value request/name|view/friendlyname|nothing" />
- </div>
+ </label>
+ </fieldset>
+
<input type="hidden" name="form.submitted" value="1" />
- <input type="submit" class="context" name="form.button.Save"
+ <input type="hidden" name="redirect" tal:attributes="value here/absolute_url" />
+ <fieldset>
+ <input type="submit" xclass="context" name="form.button.Save"
value="Save" />
+ <fieldset>
</form>
</div>
</body>
@@ -77,6 +77,8 @@ def __call__(self):
IStatusMessage(self.request).add(_(u"Mail route enabled."))
self.request['errors'] = errors
+ if self.request.has_key('redirect'):
+ return self.request.RESPONSE.redirect(self.request['redirect'])
return self.addtemplate()
def friendlyname(self):

0 comments on commit b9197ce

Please sign in to comment.