From b0fcc865599cfdc87e2ca8a637df8f5b336bb459 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Thu, 29 Sep 2022 10:43:45 +0200 Subject: [proxy] make uniform use of section labels in the web UI --- .../web_ui/templates/repos/show_single.html.jinja | 111 ++++++++++----------- 1 file changed, 54 insertions(+), 57 deletions(-) (limited to 'src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja') diff --git a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja index d2c85df..04075c4 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja @@ -28,6 +28,8 @@ code in a proprietary work, I am not going to enforce this in court. {% include 'include/checkbox_tricks_style.css.jinja' %} {% endblock %} +{% import 'import/checkbox_tricks.html.jinja' as tricks %} + {% block main %} {% if file_installation_error is defined %} {{ error_note(_('web_ui.err.file_installation_error')) }} @@ -47,18 +49,17 @@ code in a proprietary work, I am not going to enforce this in court.

{{ _('web_ui.repos.single.heading.name_{}').format(display_info.name) }}

- {% if repo_name_invalid is defined or repo_name_taken is defined %} - {% set checked_attr = '' %} - {% else %} - {% set checked_attr = 'checked=""' %} - {% endif %} {% if not display_info.deleted %} - - + {{ label(_('web_ui.repos.single.name_label')) }} + +

+ {{ display_info.name }} +

+ + {% set button_text = _('web_ui.repos.single.update_name_button') %} + {% set initial_show = repo_name_invalid is defined %} + {% set initial_show = initial_show or repo_name_taken is defined %} + {{ tricks.sibling_hider(button_text, 'edit_name', initial_show) }}
@@ -76,14 +77,14 @@ code in a proprietary work, I am not going to enforce this in court.
- -
-
@@ -98,21 +99,15 @@ code in a proprietary work, I am not going to enforce this in court.
{% elif not display_info.deleted %} + {{ label(_('web_ui.repos.single.url_label')) }} +

- {{ _('web_ui.repos.single.url_is_{}').format(display_info.url) }} + {{ display_info.url }}

- {% if repo_url_invalid is defined %} - {% set checked_attr = '' %} - {% else %} - {% set checked_attr = 'checked=""' %} - {% endif %} - - + {% set button_text = _('web_ui.repos.single.update_url_button') %} + {% set initial_show = repo_url_invalid is defined %} + {{ tricks.sibling_hider(button_text, 'edit_url', initial_show) }}
@@ -121,43 +116,37 @@ code in a proprietary work, I am not going to enforce this in court. {{ error_note(_('web_ui.err.repo_url_invalid')) }} {% endif %} -
- -
+ {{ form_field('url', sep_after=false) }}
- -
-
-
-

- {% if display_info.last_refreshed is none %} - {{ _('web_ui.repos.single.repo_never_refreshed') }} - {% else %} - {{ - _('web_ui.repos.single.last_refreshed_{}') - .format(display_info.last_refreshed.strftime('%F %H:%M')) - }} - {% endif %} -

+ {{ label(_('web_ui.repos.single.last_refreshed_label')) }} - {% set button_text = _('web_ui.repos.single.refresh_now_button') %} - {% set extra_fields = {'action': 'refresh_repo'} %} - {{ button_row([(['green-button'], button_text, extra_fields)]) }} -
+

+ {% if display_info.last_refreshed is none %} + {{ _('web_ui.repos.single.repo_never_refreshed') }} + {% else %} + {{ display_info.last_refreshed.strftime('%F %H:%M') }} + {% endif %} +

{% endif %}{# not display_info.deleted (elif) #} + + {{ label(_('web_ui.repos.single.stats_label')) }} +

{% if settings.advanced_user %} {{ @@ -175,11 +164,19 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %}

- {% if not display_info.is_local_semirepo and not display_info.deleted %} + {% if not display_info.deleted %}
- {% set button_text = _('web_ui.repos.single.remove_button') %} - {% set extra_fields = {'action': 'remove_repo'} %} - {{ button_row([(['green-button'], button_text, extra_fields)]) }} + {{ label(_('web_ui.repos.single.actions_label')) }} + + {% set remove_text = _('web_ui.repos.single.remove_button') %} + {% set refresh_text = _('web_ui.repos.single.refresh_button') %} + + {{ + button_row([ + (['green-button'], refresh_text, {'action': 'refresh_repo'}), + (['red-button'], remove_text, {'action': 'remove_repo'}) + ]) + }} {% endif %} {% endblock %} -- cgit v1.2.3