From 158e6603f12ec15a7d8c1acbd18f5966a2387f81 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Wed, 2 Mar 2022 23:35:20 +0100 Subject: [PATCH] Upgrade to bootstrap 4 --- advlabdb/templates/admin/actions.html | 32 ++-- advlabdb/templates/admin/base.html | 115 ++++++++------- advlabdb/templates/admin/file/list.html | 53 +++---- .../templates/admin/file/modals/form.html | 4 +- advlabdb/templates/admin/layout.html | 111 +++++++------- advlabdb/templates/admin/lib.html | 126 ++++++++++------ advlabdb/templates/admin/model/create.html | 8 +- advlabdb/templates/admin/model/details.html | 22 +-- advlabdb/templates/admin/model/edit.html | 16 +- .../admin/model/inline_list_base.html | 6 +- advlabdb/templates/admin/model/layout.html | 137 +++++++++--------- advlabdb/templates/admin/model/list.html | 27 ++-- .../templates/admin/model/modals/create.html | 24 ++- .../templates/admin/model/modals/details.html | 80 +++++----- .../templates/admin/model/modals/edit.html | 23 +-- .../templates/admin/rediscli/console.html | 4 +- copy_admin_templates.py | 2 +- 17 files changed, 423 insertions(+), 367 deletions(-) diff --git a/advlabdb/templates/admin/actions.html b/advlabdb/templates/admin/actions.html index 02257bb..cd645d8 100644 --- a/advlabdb/templates/admin/actions.html +++ b/advlabdb/templates/admin/actions.html @@ -1,27 +1,27 @@ {% import 'admin/static.html' as admin_static with context %} -{% macro dropdown(actions, btn_class='btn dropdown-toggle') -%} - {{ _gettext('With selected') }} - + {% endmacro %} {% macro form(actions, url) %} {% if actions %} - + {% endif %} {% endmacro %} diff --git a/advlabdb/templates/admin/base.html b/advlabdb/templates/admin/base.html index 9aefc8b..d2ee49a 100644 --- a/advlabdb/templates/admin/base.html +++ b/advlabdb/templates/admin/base.html @@ -12,21 +12,22 @@ {% endblock %} {% block head_css %} - - {%if config.get('FLASK_ADMIN_SWATCH', 'default') == 'default' %} - - {%endif%} - - + + {% if config.get('FLASK_ADMIN_SWATCH', 'default') == 'default' %} + + {% endif %} + + {% if admin_view.extra_css %} {% for css_url in admin_view.extra_css %} {% endfor %} {% endif %} {% endblock %} {% block head %} @@ -34,63 +35,65 @@ {% block head_tail %} {% endblock %} - - {% block page_body %} -
- - {% block messages %} - {{ layout.messages() }} - {% endblock %} + {% block messages %} + {{ layout.messages() }} + {% endblock %} - {# store the jinja2 context for form_rules rendering logic #} - {% set render_ctx = h.resolve_ctx() %} + {# store the jinja2 context for form_rules rendering logic #} + {% set render_ctx = h.resolve_ctx() %} - {% block body %}{% endblock %} + {% block body %}{% endblock %}
- {% endblock %} +{% endblock %} - {% block tail_js %} +{% block tail_js %} - - - + + + + + + + {% if admin_view.extra_js %} - {% for js_url in admin_view.extra_js %} - - {% endfor %} + {% for js_url in admin_view.extra_js %} + + {% endfor %} {% endif %} - {% endblock %} +{% endblock %} {% block tail %} {% endblock %} diff --git a/advlabdb/templates/admin/file/list.html b/advlabdb/templates/admin/file/list.html index 1fb093e..bd9f345 100644 --- a/advlabdb/templates/admin/file/list.html +++ b/advlabdb/templates/admin/file/list.html @@ -4,21 +4,23 @@ {% block body %} {% block breadcrums %} - + + {% endblock %} {% block file_list_table %} @@ -32,7 +34,7 @@ {% endif %} -   +   {% for column in admin_view.column_list %} {% if admin_view.is_column_sortable(column) %} @@ -84,11 +86,7 @@ {% if name != '..' and admin_view.can_delete_dirs %}
{{ delete_form.path(value=path) }} - {% if delete_form.csrf_token %} - {{ delete_form.csrf_token }} - {% elif csrf_token %} - - {% endif %} + {{ delete_form.csrf_token }} @@ -97,11 +95,7 @@ {% else %} {{ delete_form.path(value=path) }} - {% if delete_form.csrf_token %} - {{ delete_form.csrf_token }} - {% elif csrf_token %} - - {% endif %} + {{ delete_form.csrf_token }} @@ -152,27 +146,27 @@
{%- if admin_view.upload_modal -%} {{ lib.add_modal_button(url=get_dir_url('.upload', path=dir_path, modal=True), - btn_class="btn btn-default btn-large", + btn_class="btn btn-secondary", content=_gettext('Upload File')) }} {% else %} - {{ _gettext('Upload File') }} + {{ _gettext('Upload File') }} {%- endif -%}
{% endif %} {% if admin_view.can_mkdir %} -
+
{%- if admin_view.mkdir_modal -%} {{ lib.add_modal_button(url=get_dir_url('.mkdir', path=dir_path, modal=True), - btn_class="btn btn-default btn-large", + btn_class="btn btn-secondary", content=_gettext('Create Directory')) }} {% else %} - {{ _gettext('Create Directory') }} + {{ _gettext('Create Directory') }} {%- endif -%}
{% endif %} {% if actions %} -
- {{ actionslib.dropdown(actions, 'dropdown-toggle btn btn-default btn-large') }} +
+ {{ actionslib.dropdown(actions, 'dropdown-toggle btn btn-secondary') }}
{% endif %}
@@ -193,4 +187,5 @@ {{ actionslib.script(_gettext('Please select at least one file.'), actions, actions_confirmation) }} + {% endblock %} diff --git a/advlabdb/templates/admin/file/modals/form.html b/advlabdb/templates/admin/file/modals/form.html index 68d2f87..eebc699 100644 --- a/advlabdb/templates/admin/file/modals/form.html +++ b/advlabdb/templates/admin/file/modals/form.html @@ -4,8 +4,8 @@ {% block body %} {# content added to modal-content #}