From 7dfa97b20d82292f45b1b955d14d2247e2bc4747 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 11 Feb 2014 17:36:37 +0100 Subject: Apply patternfly to administration pages Signed-off-by: Petr Vobornik --- ipsilon/admin/common.py | 4 +++ templates/admin/index.html | 58 ++++++++++++----------------------- templates/admin/login_plugin.html | 64 +++++++++++++++------------------------ templates/master-admin.html | 62 +++++++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+), 78 deletions(-) create mode 100644 templates/master-admin.html 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 %} +
+ + -- cgit