From: Petr Vobornik Date: Tue, 11 Feb 2014 16:36:37 +0000 (+0100) Subject: Apply patternfly to administration pages X-Git-Tag: v0.2.2~102 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=d64cd70ae413f5a936806a182e4377a887d4d782 Apply patternfly to administration pages Signed-off-by: Petr Vobornik Reviewed-by: Simo Sorce --- diff --git a/ipsilon/admin/common.py b/ipsilon/admin/common.py index 7620d3f..6e36669 100755 --- a/ipsilon/admin/common.py +++ b/ipsilon/admin/common.py @@ -63,6 +63,7 @@ class LoginPluginPage(Page): def POST(self, *args, **kwargs): message = "Nothing was modified." + message_type = "info" new_values = dict() for key, value in kwargs.iteritems(): @@ -79,8 +80,10 @@ class LoginPluginPage(Page): store.save_plugin_config(LOGIN_FACILITY, self._obj.name, new_values) message = "New configuration saved." + message_type = "success" except Exception: # pylint: disable=broad-except message = "Failed to save data!" + message_type = "error" # And only if it succeeds we change the live object for name, value in new_values.items(): @@ -89,6 +92,7 @@ class LoginPluginPage(Page): return self._template('admin/login_plugin.html', message=message, + message_type=message_type, title='%s plugin' % self._obj.name, name='admin_login_%s_form' % self._obj.name, action=self.url, diff --git a/templates/admin/index.html b/templates/admin/index.html index 5af8497..c22d249 100644 --- a/templates/admin/index.html +++ b/templates/admin/index.html @@ -1,41 +1,23 @@ - - - - - {{ title }} - - - - -
- -
-

Log Out

-
-
- {% if user.is_admin %} -

Login plugins:

-
    - {% for p in available %} -
  • {{ p }} - - {% if p in enabled %} - Disable - - Configure - {% else %} - Enable - {% endif %} -
  • - {% endfor %} -
-

Plugins order: [list here and form button to change?]

- {% endif %} +{% extends "master-admin.html" %} +{% block main %} +{% if user.is_admin %} +

Login plugins

+ + {% for p in available %} +
+
{{ p }}
+
+ {% if p in enabled %} + Disable + Configure + {% else %} + Enable + {% endif %}
-
-

Home

-
- - + {% endfor %} +

Plugins order

+

[list here and form button to change?]

+{% endif %} +{% endblock %} \ No newline at end of file diff --git a/templates/admin/login_plugin.html b/templates/admin/login_plugin.html index 43adac6..b45b3a4 100644 --- a/templates/admin/login_plugin.html +++ b/templates/admin/login_plugin.html @@ -1,42 +1,26 @@ - - - - - {{ title }} - - - - -
- -
-

Log Out

-
-
-

{{ message }}

-
-
-
-
    - {% for o in options %} -
  • {{ o }}: -

    {{ options[o][0] }}

    - -
  • - {% endfor %} -
- -
-
-
-

- Admin - - Home -

-
+{% extends "master-admin.html" %} +{% block main %} +

{{ title }}

+ {% if message %} +
+

{{ message }}

- - + {% endif %} +
+
+ {% for o in options %} +
+ + +
+ {{ options[o][0] }} + {% endfor %} + + + Back +
+
+{% endblock %} \ No newline at end of file diff --git a/templates/master-admin.html b/templates/master-admin.html new file mode 100644 index 0000000..e57c031 --- /dev/null +++ b/templates/master-admin.html @@ -0,0 +1,62 @@ + + + + + {{ title }} + + + + + + + + + + +
+ {% block main %} + {% endblock %} +
+ +