diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-09-29 10:43:45 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-29 12:53:40 +0200 |
commit | b0fcc865599cfdc87e2ca8a637df8f5b336bb459 (patch) | |
tree | 6d5e98a4834d3cbacc05be2c8163d21faf0cebd6 /src/hydrilla/proxy/web_ui/templates/repos | |
parent | ffe6e681b281eef2c1e62bbc6feefb0b85d040ca (diff) | |
download | haketilo-hydrilla-b0fcc865599cfdc87e2ca8a637df8f5b336bb459.tar.gz haketilo-hydrilla-b0fcc865599cfdc87e2ca8a637df8f5b336bb459.zip |
[proxy] make uniform use of section labels in the web UI
Diffstat (limited to 'src/hydrilla/proxy/web_ui/templates/repos')
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja | 4 | ||||
-rw-r--r-- | src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja | 111 |
2 files changed, 56 insertions, 59 deletions
diff --git a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja index be4933a..f635444 100644 --- a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja @@ -25,7 +25,7 @@ code in a proprietary work, I am not going to enforce this in court. {% block main %} <h3>{{ _('web_ui.repos.add.heading') }}</h3> <form method="POST"> - {{ form_label(_('web_ui.repos.add.name_field_label'), 'name') }} + {{ label(_('web_ui.repos.add.name_field_label'), 'name') }} {% if repo_name_invalid is defined %} {{ error_note(_('web_ui.err.repo_name_invalid')) }} {% endif %} @@ -34,7 +34,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} {{ form_field('name') }} - {{ form_label(_('web_ui.repos.add.url_field_label'), 'url') }} + {{ label(_('web_ui.repos.add.url_field_label'), 'url') }} {% if repo_url_invalid is defined %} {{ error_note(_('web_ui.err.repo_url_invalid')) }} {% endif %} 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. <h3> {{ _('web_ui.repos.single.heading.name_{}').format(display_info.name) }} </h3> - {% 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 %} - <input id="hide_name_edit_form" type="checkbox" - class="chbx-tricks-show-hide" {{ checked_attr }}> - <label for="hide_name_edit_form" - class="green-button block-with-bottom-margin"> - {{ _('web_ui.repos.single.update_name_button') }} - </label> + {{ label(_('web_ui.repos.single.name_label')) }} + + <p> + {{ display_info.name }} + </p> + + {% 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) }} <form method="POST"> <input type="hidden" name="action" value="update_repo_data"> @@ -76,14 +77,14 @@ code in a proprietary work, I am not going to enforce this in court. </div> <div class="flex-row"> - <button class="green-button button-bordering-right"> + <label for="{{ tricks.hider_id('edit_name') }}" + class="red-button button-brodering-right"> + {{ _('web_ui.repos.single.no_update_name_button') }} + </label> + <div class="button-row-separator"></div> + <button class="green-button button-bordering-left"> {{ _('web_ui.repos.single.commit_update_name_button') }} </button> - <div class="button-row-separator"></div> - <label for="hide_name_edit_form" - class="green-button button-bordering-left"> - {{ _('web_ui.repos.single.abort_update_name_button') }} - </label> </div> </form> @@ -98,21 +99,15 @@ code in a proprietary work, I am not going to enforce this in court. <div class="horizontal-separator"></div> {% elif not display_info.deleted %} + {{ label(_('web_ui.repos.single.url_label')) }} + <p> - {{ _('web_ui.repos.single.url_is_{}').format(display_info.url) }} + {{ display_info.url }} </p> - {% if repo_url_invalid is defined %} - {% set checked_attr = '' %} - {% else %} - {% set checked_attr = 'checked=""' %} - {% endif %} - <input id="hide_url_edit_form" type="checkbox" class="chbx-tricks-show-hide" - {{ checked_attr }}> - <label for="hide_url_edit_form" - class="green-button block-with-bottom-margin"> - {{ _('web_ui.repos.single.update_url_button') }} - </label> + {% 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) }} <form method="POST"> <input type="hidden" name="action" value="update_repo_data"> @@ -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 %} - <div class="flex-row"> - <input name="url" value="{{ display_info.url }}" required=""> - </div> + {{ form_field('url', sep_after=false) }} <div class="flex-row"> - <button class="green-button button-bordering-right"> + <label for="{{ tricks.hider_id('edit_url') }}" + class="red-button button-brodering-right"> + {{ _('web_ui.repos.single.no_update_url_button') }} + </label> + <div class="button-row-separator"></div> + <button class="green-button button-bordering-left"> {{ _('web_ui.repos.single.commit_update_url_button') }} </button> - <div class="button-row-separator"></div> - <label for="hide_url_edit_form" - class="green-button button-bordering-left"> - {{ _('web_ui.repos.single.abort_update_url_button') }} - </label> </div> </form> <div class="horizontal-separator"></div> - <div> - <p> - {% 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 %} - </p> + {{ 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)]) }} - </div> + <p> + {% if display_info.last_refreshed is none %} + {{ _('web_ui.repos.single.repo_never_refreshed') }} + {% else %} + {{ display_info.last_refreshed.strftime('%F %H:%M') }} + {% endif %} + </p> <div class="horizontal-separator"></div> {% endif %}{# not display_info.deleted (elif) #} + + {{ label(_('web_ui.repos.single.stats_label')) }} + <p> {% if settings.advanced_user %} {{ @@ -175,11 +164,19 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} </p> - {% if not display_info.is_local_semirepo and not display_info.deleted %} + {% if not display_info.deleted %} <div class="horizontal-separator"></div> - {% 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 %} |