summaryrefslogtreecommitdiffstats
path: root/authentic/admin/settings.ptl
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-11-23 12:46:58 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2010-11-23 12:46:58 (GMT)
commit3dc776d7ff465ac19ade5c979270bce111bdc2c3 (patch)
tree392bb603ce74f22befb48b0037f3637ac41f0dfd /authentic/admin/settings.ptl
parentf1dbfa1b6c618fc7a24484cc1e8f04f2bbb60734 (diff)
downloadauthentic-old-3dc776d7ff465ac19ade5c979270bce111bdc2c3.zip
authentic-old-3dc776d7ff465ac19ade5c979270bce111bdc2c3.tar.gz
authentic-old-3dc776d7ff465ac19ade5c979270bce111bdc2c3.tar.bz2
[admin settings] extract service's edit form building into its own method
In order to be able to overload the default service form we need to extract it into its own method.
Diffstat (limited to 'authentic/admin/settings.ptl')
-rw-r--r--authentic/admin/settings.ptl9
1 files changed, 8 insertions, 1 deletions
diff --git a/authentic/admin/settings.ptl b/authentic/admin/settings.ptl
index 62b5f8c..8e86292 100644
--- a/authentic/admin/settings.ptl
+++ b/authentic/admin/settings.ptl
@@ -489,7 +489,8 @@ class LibertyProviderUI(Directory):
'<a href="update_remote">%s</a>' % _('Update from remote URL')
'</p>'
- def edit [html] (self):
+
+ def edit_form(self):
label = misc.get_provider_and_label(self.lpk)[1]
form = Form(enctype='multipart/form-data')
form.add(StringWidget, 'label', title = _('Label'), size = 50, value = label)
@@ -527,6 +528,11 @@ class LibertyProviderUI(Directory):
form.add_submit('submit', _('Submit'))
form.add_submit('cancel', _('Cancel'))
+ return form
+
+ def edit [html] (self):
+ form = self.edit_form()
+
if form.get_submit() == 'cancel':
return redirect('..')
@@ -541,6 +547,7 @@ class LibertyProviderUI(Directory):
return redirect('.')
get_response().breadcrumb.append(('edit', _('Edit')))
+ label = misc.get_provider_and_label(self.lpk)[1]
html_top('settings', title = _('Edit Liberty Provider - %s') % label)
'<h2>%s</h2>' % _('Edit Liberty Provider - %s') % label
if self.lp.get('locked') is not None: