diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-09-27 11:03:55 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-09-28 14:03:18 +0200 |
commit | ba580db6b07d6fcb4877259f13052ddee34afb90 (patch) | |
tree | 9ab109cefad0ee276f696788ea24aad3390eea17 /src/hydrilla/proxy/web_ui/templates/items | |
parent | d42379c189c33dac732a1a1341395a9f5683260b (diff) | |
download | haketilo-hydrilla-ba580db6b07d6fcb4877259f13052ddee34afb90.tar.gz haketilo-hydrilla-ba580db6b07d6fcb4877259f13052ddee34afb90.zip |
[proxy] make some (possibly confusing) web UI parts only display to advanced users
Diffstat (limited to 'src/hydrilla/proxy/web_ui/templates/items')
3 files changed, 72 insertions, 89 deletions
diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja index 952c6b7..a1056b1 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja @@ -48,62 +48,53 @@ code in a proprietary work, I am not going to enforce this in court. <p> TODO: add more info... </p> + {% endblock %} + {% + if settings.advanced_user and + version_display_info.active != ActiveStatus.REQUIRED + %} <div class="horizontal-separator"></div> - {% endblock %} - <p> - {% if version_display_info.active == ActiveStatus.REQUIRED %} - {% block item_required_msg required %}{% endblock %} - {% - elif version_display_info.active == ActiveStatus.NOT_ACTIVE or - settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED - %} - {% block item_not_activated_msg required %}{% endblock %} - {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} - {% block item_will_be_asked_about_msg required %}{% endblock %} + {% set install_but_classes = ['green-button'] %} + {% set uninstall_but_classes = ['green-button'] %} + {% if version_display_info.installed == InstalledStatus.FAILED_TO_INSTALL %} + {% + set install_text = + _('web_ui.items.single_version.retry_install_button') + %} + {% + set uninstall_text = + _('web_ui.items.single_version.leave_uninstalled_button') + %} + <div>{% block item_install_failed_msg required %}{% endblock %}</div> {% else %} - {# settings.mapping_use_mode == MappingUseMode.AUTO #} - {% block item_auto_activated_msg required %}{% endblock %} - {% endif %} - </p> - - {% set install_but_classes = ['green-button'] %} - {% set uninstall_but_classes = ['green-button'] %} - {% if version_display_info.installed == InstalledStatus.FAILED_TO_INSTALL %} - {% - set install_text = - _('web_ui.items.single_version.retry_install_button') - %} - {% - set uninstall_text = - _('web_ui.items.single_version.leave_uninstalled_button') - %} - <div>{% block item_install_failed_msg required %}{% endblock %}</div> - {% else %} - {% set install_text = _('web_ui.items.single_version.install_button') %} - {% set uninstall_text = _('web_ui.items.single_version.uninstall_button') %} - {% if version_display_info.installed == InstalledStatus.INSTALLED %} - {% do install_but_classes.append('disabled-button') %} + {% set install_text = _('web_ui.items.single_version.install_button') %} {% - if uninstall_disallowed is defined or - version_display_info.active == ActiveStatus.REQUIRED + set uninstall_text = _('web_ui.items.single_version.uninstall_button') %} + {% if version_display_info.installed == InstalledStatus.INSTALLED %} + {% do install_but_classes.append('disabled-button') %} + {% + if uninstall_disallowed is defined or + version_display_info.active == ActiveStatus.REQUIRED + %} + {% do uninstall_but_classes.append('disabled-button') %} + {% endif %} + {% else %} + {# version_display_info.installed == InstalledStatus.NOT_INSTALLED #} {% do uninstall_but_classes.append('disabled-button') %} {% endif %} - {% else %} - {# version_display_info.installed == InstalledStatus.NOT_INSTALLED #} - {% do uninstall_but_classes.append('disabled-button') %} - {% endif %} - {% endif %}{# else/ version_display_info.installed == InstalledStatus.FA... #} - - {% set uninstall_fields = {'action': 'uninstall_item_version'} %} - {% set install_fields = {'action': 'install_item_version'} %} - - {{ - button_row([ - (uninstall_but_classes, uninstall_text, uninstall_fields), - (install_but_classes, install_text, install_fields) - ]) - }} + {% endif %}{# else/ version_display_info.installed == InstalledStatus.... #} + + {% set uninstall_fields = {'action': 'uninstall_item_version'} %} + {% set install_fields = {'action': 'install_item_version'} %} + + {{ + button_row([ + (uninstall_but_classes, uninstall_text, uninstall_fields), + (install_but_classes, install_text, install_fields) + ]) + }} + {% endif %}{# settings.advanced_user #} {% endblock main_info %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja index f1d1b74..13ee41a 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja @@ -38,22 +38,6 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} {% endblock %} -{% block item_required_msg %} - {{ _('web_ui.items.single_version.library.item_required') }} -{% endblock %} - -{% block item_auto_activated_msg %} - {{ _('web_ui.items.single_version.library.item_auto_activated') }} -{% endblock %} - -{% block item_not_activated_msg %} - {{ _('web_ui.items.single_version.library.item_not_activated') }} -{% endblock %} - -{% block item_will_be_asked_about_msg %} - {{ _('web_ui.items.single_version.library.item_will_be_asked_about') }} -{% endblock %} - {% block item_install_failed_msg %} {{ _('web_ui.items.single_version.library.install_failed') }} {% endblock %} @@ -68,4 +52,20 @@ code in a proprietary work, I am not going to enforce this in court. </p> <div class="horizontal-separator"></div> + + <p> + {% if version_display_info.active == ActiveStatus.REQUIRED %} + {{ _('web_ui.items.single_version.library.item_required') }} + {% + elif version_display_info.active == ActiveStatus.NOT_ACTIVE or + settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED + %} + {{ _('web_ui.items.single_version.library.item_not_activated') }} + {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} + {{ _('web_ui.items.single_version.library.item_will_be_asked_about') }} + {% else %} + {# settings.mapping_use_mode == MappingUseMode.AUTO #} + {{ _('web_ui.items.single_version.library.item_auto_activated') }} + {% endif %} + </p> {% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja index 04caf8c..31f5e2e 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja @@ -38,22 +38,6 @@ code in a proprietary work, I am not going to enforce this in court. {% endif %} {% endblock %} -{% block item_required_msg %} - {{ _('web_ui.items.single_version.package.item_required') }} -{% endblock %} - -{% block item_auto_activated_msg %} - {{ _('web_ui.items.single_version.package.item_auto_activated') }} -{% endblock %} - -{% block item_not_activated_msg %} - {{ _('web_ui.items.single_version.package.item_not_activated') }} -{% endblock %} - -{% block item_will_be_asked_about_msg %} - {{ _('web_ui.items.single_version.package.item_will_be_asked_about') }} -{% endblock %} - {% block item_install_failed_msg %} {{ _('web_ui.items.single_version.package.install_failed') }} {% endblock %} @@ -80,14 +64,24 @@ code in a proprietary work, I am not going to enforce this in court. <p> {% if display_info.enabled == EnabledStatus.NO_MARK %} {% do unenable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_not_marked') }} + {% + if version_display_info.active == ActiveStatus.NOT_ACTIVE or + settings.mapping_use_mode == MappingUseMode.WHEN_ENABLED + %} + {{ _('web_ui.items.single_version.package.item_not_activated') }} + {% elif settings.mapping_use_mode == MappingUseMode.QUESTION %} + {{ _('web_ui.items.single_version.package.item_will_be_asked_about') }} + {% else %} + {# settings.mapping_use_mode == MappingUseMode.AUTO #} + {{ _('web_ui.items.single_version.package.item_auto_activated') }} + {% endif %} {% elif display_info.enabled == EnabledStatus.DISABLED %} {% do disable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_disabled') }} + {{ _('web_ui.items.single_version.package.item_disabled') }} {% else %} {# display_info.enabled == EnabledStatus.ENABLED #} {% do enable_but_classes.append('disabled-button') %} - {{ _('web_ui.items.single_version.item_enabled') }} + {{ _('web_ui.items.single_version.package.item_enabled') }} {% endif %} </p> @@ -99,9 +93,9 @@ code in a proprietary work, I am not going to enforce this in court. ]) }} - <div class="horizontal-separator"></div> - {% if display_info.enabled == EnabledStatus.ENABLED %} + <div class="horizontal-separator"></div> + {% set unpin_but_classes = ['green-button'] %} {% set pin_repo_but_classes = ['green-button'] %} {% set pin_ver_but_classes = ['green-button'] %} @@ -191,7 +185,5 @@ code in a proprietary work, I am not going to enforce this in court. (pin_ver_but_classes, pin_ver_text, {'action': 'freeze_to_version'}) ]) }} - - <div class="horizontal-separator"></div> {% endif %}{# display_info.enabled == EnabledStatus.ENABLED #} {% endblock main_info_bulk %} |