{# SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0 Proxy web UI package version view page. This file is part of Hydrilla&Haketilo. Copyright (C) 2022 Wojtek Kosior Dual licensed under * GNU General Public License v3.0 or later and * Creative Commons Attribution Share Alike 4.0 International. You can choose to use either of these licenses or both. I, Wojtek Kosior, thereby promise not to sue for violation of this file's licenses. Although I request that you do not make use this code in a proprietary work, I am not going to enforce this in court. #} {% extends "items/item_viewversion.html.jinja" %} {% block title %} {{ _('web_ui.items.single_version.package.title') }} {% endblock %} {% block heading %} {% if version_display_info.is_local %} {{ _('web_ui.items.single_version.package_local.heading.name_{}') .format(version_display_info.info.long_name) }} {% else %} {{ _('web_ui.items.single_version.package.heading.name_{}') .format(version_display_info.info.long_name) }} {% 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_install_failed_msg %} {{ _('web_ui.items.single_version.package.install_failed') }} {% endblock %} {% block version_list_heading %} {{ _('web_ui.items.single_version.package.version_list_heading') }} {% endblock %} {% block main_info_bulk %}
TODO: add more info...
{% set enable_but_classes = ['blue-button'] %} {% set unenable_but_classes = ['green-button'] %} {% set disable_but_classes = ['red-button'] %} {% set unenable_text = _('web_ui.items.single_version.unenable_button') %} {% set disable_text = _('web_ui.items.single_version.disable_button') %} {% set enable_text = _('web_ui.items.single_version.enable_button') %}{% if display_info.enabled == EnabledStatus.NO_MARK %} {% do unenable_but_classes.append('disabled-button') %} {{ _('web_ui.items.single_version.item_not_marked') }} {% elif display_info.enabled == EnabledStatus.DISABLED %} {% do disable_but_classes.append('disabled-button') %} {{ _('web_ui.items.single_version.item_disabled') }} {% else %} {# display_info.enabled == EnabledStatus.ENABLED #} {% do enable_but_classes.append('disabled-button') %} {{ _('web_ui.items.single_version.item_enabled') }} {% endif %}
{{ button_row([ (disable_but_classes, disable_text, 'disable_item'), (unenable_but_classes, unenable_text, 'unenable_item'), (enable_but_classes, enable_text, 'enable_item_version') ]) }} {% if display_info.enabled == EnabledStatus.ENABLED %} {% set unpin_but_classes = ['green-button'] %} {% set pin_repo_but_classes = ['green-button'] %} {% set pin_ver_but_classes = ['green-button'] %} {% set unpin_text = _('web_ui.items.single_version.unpin_button') %}{% if display_info.frozen == FrozenStatus.NOT_FROZEN %} {% do unpin_but_classes.append('disabled-button') %} {{ _('web_ui.items.single_version.not_pinned') }} {% endif %} {% if display_info.frozen == FrozenStatus.REPOSITORY %} {% if display_info.active_version.is_local %} {{ _('web_ui.items.single_version.pinned_repo_local') }} {% else %} {{ _('web_ui.items.single_version.pinned_repo_{}') .format(display_info.active_version.info.repo) }} {% endif %} {% if display_info.active_version.info.repo == version_display_info.info.repo %} {% if version_display_info.is_local %} {% set pin_repo_text = _('web_ui.items.single_version.pin_local_repo_button') %} {% else %} {% set pin_repo_text = _('web_ui.items.single_version.pin_repo_button') %} {% endif %} {% do pin_repo_but_classes.append('disabled-button') %} {% else %} {% set pin_repo_text = _('web_ui.items.single_version.repin_repo_button') %} {% endif %} {% else %}{# display_info.frozen == FrozenStatus.REPOSITORY #} {% set pin_repo_text = _('web_ui.items.single_version.pin_repo_button') %} {% endif %}{# else/ display_info.frozen == FrozenStatus.REPOSITORY #} {% if display_info.frozen == FrozenStatus.EXACT_VERSION %} {% if display_info.active_version.ref == version_display_info.ref %} {% set pin_ver_text = _('web_ui.items.single_version.pin_ver_button') %} {% do pin_ver_but_classes.append('disabled-button') %} {{ _('web_ui.items.single_version.pinned_ver') }} {% else %} {% set pin_ver_text = _('web_ui.items.single_version.repin_ver_button') %} {{ _('web_ui.items.single_version.pinned_other_ver') }} {% endif %} {% else %} {% set pin_ver_text = _('web_ui.items.single_version.pin_ver_button') %} {% endif %}{# else/ display_info.frozen == FrozenStatus.EXACT_VERSION #} {% if display_info.active_version.ref == version_display_info.ref %} {% if display_info.frozen != FrozenStatus.EXACT_VERSION %} {{ _('web_ui.items.single_version.active_ver_is_this_one') }} {% endif %} {% else %} {{ _('web_ui.items.single_version.active_ver_is_{}') .format( versioned_identifier_with_repo(display_info.active_version) ) }} {% endif %}
{{ button_row([ (unpin_but_classes, unpin_text, 'unfreeze_item'), (pin_repo_but_classes, pin_repo_text, 'freeze_to_repo'), (pin_ver_but_classes, pin_ver_text, 'freeze_to_version') ]) }} {% endif %}{# display_info.enabled == EnabledStatus.ENABLED #} {% endblock main_info_bulk %}