From 84e72351e59768507edfb88ee30abda8e82f4644 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 23 Jan 2020 00:38:26 +0300 Subject: [PATCH] feat(admin-plugin): update dropdowns for extends #211 --- .../templates/extends/fieldsets/index.html | 116 +++++----- .../templates/extends/plugins/index.html | 104 +++++---- .../templates/extends/snippets/index.html | 179 +++++++-------- .../admin/templates/extends/themes/index.html | 89 ++++---- .../extends/themes/templates/index.html | 207 +++++++++--------- 5 files changed, 365 insertions(+), 330 deletions(-) diff --git a/site/plugins/admin/templates/extends/fieldsets/index.html b/site/plugins/admin/templates/extends/fieldsets/index.html index 69560d1e..546ecda1 100644 --- a/site/plugins/admin/templates/extends/fieldsets/index.html +++ b/site/plugins/admin/templates/extends/fieldsets/index.html @@ -1,58 +1,64 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -{% if fieldsets_list|length > 0 %} - - - {% for id, title in fieldsets_list %} - {% set fieldset_path = PATH_FIELDSETS ~ '/' ~ id ~ '.yaml' %} - {% if filesystem_has(fieldset_path) %} - {% set fieldset = parser_decode(filesystem_read(fieldset_path), 'yaml') %} - {% endif %} - - - - - - {% endfor %} - -
- {% if fieldset.icon %} - - {% else %} - - {% endif %} - - {{ title }} - - - -
-{% else %} -
- -

{{ tr('admin_you_have_not_created_any_fieldsets_yet') }}

- {{ tr('admin_create_new_fieldset') }} -
-{% endif %} -{% endblock %} + {% if fieldsets_list | length > 0 %} + + + {% for id, title in fieldsets_list %} + {% set fieldset_path = PATH_FIELDSETS ~ '/' ~ id ~ '.yaml' %} + {% if filesystem_has(fieldset_path) %} + {% set fieldset = parser_decode(filesystem_read(fieldset_path), 'yaml') %} + {% endif %} + + + + + + {% endfor %} + +
+ {% if fieldset.icon %} + + {% else %} + + {% endif %} + + {{ title }} + + + +
+ {% else %} +
+ +

{{ tr('admin_you_have_not_created_any_fieldsets_yet') }}

+ {{ tr('admin_create_new_fieldset') }} +
+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/site/plugins/admin/templates/extends/plugins/index.html b/site/plugins/admin/templates/extends/plugins/index.html index 5ee15369..31eca4bc 100644 --- a/site/plugins/admin/templates/extends/plugins/index.html +++ b/site/plugins/admin/templates/extends/plugins/index.html @@ -1,48 +1,62 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -{% if (plugins_list|length > 0) %} - - - {% for key, plugin in plugins_list %} - - - - - - {% endfor %} - -
- {% if plugin.icon %} - - {% else %} - - {% endif %} - {{ plugin.name }} - - -
-{% else %} -
- -

{{ tr('admin_you_have_no_plugins') }}

-
-{% endif %} -{% endblock %} + {% if (plugins_list | length > 0) %} + + + {% for key, plugin in plugins_list %} + + + + + + {% endfor %} + +
+ {% if plugin.icon %} + + {% else %} + + {% endif %} + + {{ plugin.name }} + + + +
+ {% else %} +
+ +

{{ tr('admin_you_have_no_plugins') }}

+
+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/site/plugins/admin/templates/extends/snippets/index.html b/site/plugins/admin/templates/extends/snippets/index.html index d8f82051..a11d6fa3 100644 --- a/site/plugins/admin/templates/extends/snippets/index.html +++ b/site/plugins/admin/templates/extends/snippets/index.html @@ -1,97 +1,100 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -{% if snippets_list|length > 0 %} - - - {% for id in snippets_list %} - - - - - - {% endfor %} - -
- - - {{ id }} - -
- - + +
-{% else %} -
- -

{{ tr('admin_you_have_not_created_any_snippets_yet') }}

- {{ tr('admin_create_new_snippet') }} -
-{% endif %} - - - - - - - {% endblock %} {% block tail %} - -{% endblock %} + +{% endblock %} \ No newline at end of file diff --git a/site/plugins/admin/templates/extends/themes/index.html b/site/plugins/admin/templates/extends/themes/index.html index 35dda01d..bb40d127 100644 --- a/site/plugins/admin/templates/extends/themes/index.html +++ b/site/plugins/admin/templates/extends/themes/index.html @@ -1,45 +1,50 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -{% if (themes_list|length > 0) %} - - - {% for key, theme in themes_list %} - - - - - - {% endfor %} - -
- - {{ theme.name }} -
- - -
-
-{% else %} -
- -

{{ tr('admin_you_have_no_themes') }}

-
-{% endif %} -{% endblock %} + {% if (themes_list | length > 0) %} + + + {% for key, theme in themes_list %} + + + + + + {% endfor %} + +
+ + + {{ theme.name }} + + + +
+ {% else %} +
+ +

{{ tr('admin_you_have_no_themes') }}

+
+ {% endif %} +{% endblock %} \ No newline at end of file diff --git a/site/plugins/admin/templates/extends/themes/templates/index.html b/site/plugins/admin/templates/extends/themes/templates/index.html index b48264ed..910235cc 100644 --- a/site/plugins/admin/templates/extends/themes/templates/index.html +++ b/site/plugins/admin/templates/extends/themes/templates/index.html @@ -1,104 +1,111 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -{% if (templates_list|length > 0) or (partials_list|length > 0) %} - - - {% if templates_list|length > 0 %} - {% for template in templates_list %} - - - - - - - {% endfor %} + {% if (templates_list | length > 0) + or(partials_list | length > 0) %} +
- - - {{ template.basename }} - {{ tr('admin_template') }} -
- - -
-
+ + {% if templates_list | length > 0 %} + {% for template in templates_list %} + + + + + + + {% endfor %} + {% endif %} + {% if partials_list | length > 0 %} + {% for partial in partials_list %} + + + + + + + {% endfor %} + {% endif %} + +
+ + + {{ template.basename }} + {{ tr('admin_template') }} + + +
+ + + {{ partial.basename }} + {{ tr('admin_partial') }} + + +
+ {% else %} +
+ +

{{ tr('admin_you_have_not_created_any_templates_yet') }}

+ {{ tr('admin_create_new_template') }} +
{% endif %} - {% if partials_list|length > 0 %} - {% for partial in partials_list %} - - - - - - {{ partial.basename }} - - {{ tr('admin_partial') }} - -
- - -
- - - {% endfor %} - {% endif %} - - -{% else %} -
- -

{{ tr('admin_you_have_not_created_any_templates_yet') }}

- {{ tr('admin_create_new_template') }} -
-{% endif %} -{% endblock %} +{% endblock %} \ No newline at end of file