From fb1c34e7aeac67a75c29a132ded87edeb557cdaf Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 15 Oct 2014 00:17:53 -0400 Subject: Improve UI for enabling/disabling plugins config Use the same templates for both info and login plugins Signed-off-by: Simo Sorce Reviewed-by: Patrick Uiterwijk --- templates/admin/info.html | 31 ----------- templates/admin/info_order.html | 25 --------- templates/admin/login.html | 31 ----------- templates/admin/login_order.html | 25 --------- templates/admin/plugins.html | 108 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 112 deletions(-) delete mode 100644 templates/admin/info.html delete mode 100644 templates/admin/info_order.html delete mode 100644 templates/admin/login.html delete mode 100644 templates/admin/login_order.html create mode 100644 templates/admin/plugins.html (limited to 'templates') diff --git a/templates/admin/info.html b/templates/admin/info.html deleted file mode 100644 index d51231f..0000000 --- a/templates/admin/info.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "master-admin.html" %} -{% block main %} -{% if user.is_admin %} -

Info plugins

- {% if message %} -
-

{{ message }}

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

Plugins order

-
{{ ', '.join(enabled) }}
-
- configure -
-{% endif %} -{% endblock %} diff --git a/templates/admin/info_order.html b/templates/admin/info_order.html deleted file mode 100644 index 5d929be..0000000 --- a/templates/admin/info_order.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "master-admin.html" %} -{% block main %} -

{{ title }}

- {% if message %} -
-

{{ message }}

-
- {% endif %} -
-
- -
- - -
- Plugins order - - - Back -
-
-{% endblock %} - diff --git a/templates/admin/login.html b/templates/admin/login.html deleted file mode 100644 index 9f51d02..0000000 --- a/templates/admin/login.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "master-admin.html" %} -{% block main %} -{% if user.is_admin %} -

Login plugins

- {% if message %} -
-

{{ message }}

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

Plugins order

-
{{ ', '.join(enabled) }}
-
- configure -
-{% endif %} -{% endblock %} diff --git a/templates/admin/login_order.html b/templates/admin/login_order.html deleted file mode 100644 index b14c4d9..0000000 --- a/templates/admin/login_order.html +++ /dev/null @@ -1,25 +0,0 @@ -{% extends "master-admin.html" %} -{% block main %} -

{{ title }}

- {% if message %} -
-

{{ message }}

-
- {% endif %} -
-
- -
- - -
- Plugins order - - - Back -
-
-{% endblock %} - diff --git a/templates/admin/plugins.html b/templates/admin/plugins.html new file mode 100644 index 0000000..7bbe544 --- /dev/null +++ b/templates/admin/plugins.html @@ -0,0 +1,108 @@ +{% extends "master-admin.html" %} +{% block main %} +{% if user.is_admin %} + +
+
+

{{ title }}

+
+ +
+ + + {% for p in enabled %} + + {% endfor %} + + {% for p in available if not p in enabled %} + + {% endfor %} + + +
+
+
+ {{ p }} +
+
+
+
+ Disable +
+
+ {%- if available[p].get_config_desc() %} + Configure + {% endif %} +
+
+
+
+ {%- if not (loop.first and loop.last) %} +
+ {%- set outer_loop = loop %} + {%- for move in ['↑', '↓'] %} + {%- if move == '↑' %} + {%- if outer_loop.first %} + {%- set state='disabled' %} + {%- else %} + {%- set state='btn-default' %} + {%- set idx0=outer_loop.index0-1 %} + {%- set idx1=outer_loop.index0 %} + {%- endif %} + {%- else %} + {%- if outer_loop.last %} + {%- set state='disabled' %} + {%- else %} + {%- set state='btn-default' %} + {%- set idx0=outer_loop.index0 %} + {%- set idx1=outer_loop.index0+1 %} + {%- endif %} + {%- endif %} + + {%- endfor %} +
+ {%- endif %} +
+
+
+
+
+ {{ p }} +
+
+
+
+ Enable +
+
+ {%- if available[p].get_config_desc() %} + Configure + {% endif %} +
+
+
+
+
+
+
+
+ +{% endif %} +{% endblock %} -- cgit