From 7c5d5b352ce80728c941e7f53088ce638c280a2e Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Tue, 7 Apr 2015 15:07:17 -0400 Subject: Rename plugin_config template to option_config Give the configuration template, which maps Config objects into HTML, a more generic name. Along with the rename this also drops the user.is_admin check so a user can manage their SP data. The backend still enforces writing. https://fedorahosted.org/ipsilon/ticket/25 Signed-off-by: Rob Crittenden Reviewed-by: Simo Sorce --- templates/admin/option_config.html | 215 ++++++++++++++++++++++++++++++++++++ templates/admin/plugin_config.html | 217 ------------------------------------- 2 files changed, 215 insertions(+), 217 deletions(-) create mode 100644 templates/admin/option_config.html delete mode 100644 templates/admin/plugin_config.html diff --git a/templates/admin/option_config.html b/templates/admin/option_config.html new file mode 100644 index 0000000..74eede5 --- /dev/null +++ b/templates/admin/option_config.html @@ -0,0 +1,215 @@ +{% extends "master-admin.html" %} +{% block scripts %} + +{% endblock %} +{% block main %} + +
+
+

{{ title }}

+
+ +
+ +
+ +
+
+ {% for k, v in config.iteritems() %} +
+ +
+ {% set value = v.get_value() -%} + {% if v.__class__.__name__ in ['String', 'Template'] -%} + + {% elif v.__class__.__name__ == 'List' -%} + + {% elif v.__class__.__name__ == 'Choice' -%} + {% set entries = v.get_allowed() -%} +
+ {% for e in entries -%} +
+  {{ e }} +
+ {% endfor %} +
+ {% elif v.__class__.__name__ == 'Pick' -%} + {% set entries = v.get_allowed() -%} +
+ {% for e in entries -%} +
+  {{ e }} +
+ {% endfor %} +
+ {% elif v.__class__.__name__ == 'Condition' -%} + + {% elif v.__class__.__name__ == 'ComplexList' -%} + + + {% for line in value -%} + {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} + + + + + + {% endfor -%} + + {%- set basename = "%s %d-"|format(v.name, value|length) -%} + + + + + + + + + +
#NameDelete
{{loop.index}} + + + + +
+
+ {% elif v.__class__.__name__ == 'MappingList' -%} + + + {% for line in value -%} + {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} + + + + + + + {% endfor -%} + + {%- set basename = "%s %d-"|format(v.name, value|length) -%} + + + + + + + + + + +
#FromToDelete
{{loop.index}} + + + + + + +
+
+ {% else -%} + {{ v.__class__.__name__ }} + {% endif -%} + {{ v.description }} +
+
+
+ {% endfor %} + +

+ + Back +

+
+
+ +{% endblock %} diff --git a/templates/admin/plugin_config.html b/templates/admin/plugin_config.html deleted file mode 100644 index c6ae044..0000000 --- a/templates/admin/plugin_config.html +++ /dev/null @@ -1,217 +0,0 @@ -{% extends "master-admin.html" %} -{% block scripts %} - -{% endblock %} -{% block main %} -{% if user.is_admin %} - -
-
-

{{ title }}

-
- -
- -
- -
-
- {% for k, v in config.iteritems() %} -
- -
- {% set value = v.get_value() -%} - {% if v.__class__.__name__ in ['String', 'Template'] -%} - - {% elif v.__class__.__name__ == 'List' -%} - - {% elif v.__class__.__name__ == 'Choice' -%} - {% set entries = v.get_allowed() -%} -
- {% for e in entries -%} -
-  {{ e }} -
- {% endfor %} -
- {% elif v.__class__.__name__ == 'Pick' -%} - {% set entries = v.get_allowed() -%} -
- {% for e in entries -%} -
-  {{ e }} -
- {% endfor %} -
- {% elif v.__class__.__name__ == 'Condition' -%} - - {% elif v.__class__.__name__ == 'ComplexList' -%} - - - {% for line in value -%} - {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} - - - - - - {% endfor -%} - - {%- set basename = "%s %d-"|format(v.name, value|length) -%} - - - - - - - - - -
#NameDelete
{{loop.index}} - - - - -
-
- {% elif v.__class__.__name__ == 'MappingList' -%} - - - {% for line in value -%} - {%- set basename = "%s %d-"|format(v.name, loop.index0) -%} - - - - - - - {% endfor -%} - - {%- set basename = "%s %d-"|format(v.name, value|length) -%} - - - - - - - - - - -
#FromToDelete
{{loop.index}} - - - - - - -
-
- {% else -%} - {{ v.__class__.__name__ }} - {% endif -%} - {{ v.description }} -
-
-
- {% endfor %} - -

- - Back -

-
-
- -{% endif %} -{% endblock %} -- cgit