summaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-09-26 19:38:49 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 14:03:18 +0200
commited85c1ce79b2a562f27649e3a2abd518e507ad62 (patch)
tree6877e460af51d8f12d9645bcb1988fc3a914300b /src/hydrilla/proxy/web_ui
parentc85b25dea8e526eee3c2baa4fec8d1aab6fe976e (diff)
downloadhaketilo-hydrilla-ed85c1ce79b2a562f27649e3a2abd518e507ad62.tar.gz
haketilo-hydrilla-ed85c1ce79b2a562f27649e3a2abd518e507ad62.zip
[proxy] make web UI messages regarding item's status more precise
Diffstat (limited to 'src/hydrilla/proxy/web_ui')
-rw-r--r--src/hydrilla/proxy/web_ui/items.py5
-rw-r--r--src/hydrilla/proxy/web_ui/templates/items/item_viewversion.html.jinja13
-rw-r--r--src/hydrilla/proxy/web_ui/templates/items/library_viewversion.html.jinja6
-rw-r--r--src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja4
4 files changed, 23 insertions, 5 deletions
diff --git a/src/hydrilla/proxy/web_ui/items.py b/src/hydrilla/proxy/web_ui/items.py
index 13d0cde..ec394ee 100644
--- a/src/hydrilla/proxy/web_ui/items.py
+++ b/src/hydrilla/proxy/web_ui/items.py
@@ -158,8 +158,10 @@ def show_item_version(
item_type: item_infos.ItemType,
errors: t.Mapping[str, bool] = {}
) -> werkzeug.Response:
+ state = _app.get_haketilo_state()
+
try:
- store = item_version_store(_app.get_haketilo_state(), item_type)
+ store = item_version_store(state, item_type)
version_ref = store.get(item_version_id)
display_info = version_ref.get_item_display_info()
@@ -175,6 +177,7 @@ def show_item_version(
f'items/{item_type.alt_name}_viewversion.html.jinja',
display_info = display_info,
version_display_info = this_info,
+ settings = state.get_settings(),
**errors
)
return flask.make_response(html, 200)
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 569d46e..952c6b7 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
@@ -55,11 +55,16 @@ code in a proprietary work, I am not going to enforce this in court.
<p>
{% if version_display_info.active == ActiveStatus.REQUIRED %}
{% block item_required_msg required %}{% endblock %}
- {% elif version_display_info.active == ActiveStatus.AUTO %}
- {% block item_auto_activated_msg required %}{% endblock %}
- {% else %}
- {# version_display_info.active == ActiveStatus.NOT_ACTIVE #}
+ {%
+ 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 %}
+ {% else %}
+ {# settings.mapping_use_mode == MappingUseMode.AUTO #}
+ {% block item_auto_activated_msg required %}{% endblock %}
{% endif %}
</p>
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 a1066b3..f1d1b74 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
@@ -50,6 +50,10 @@ code in a proprietary work, I am not going to enforce this in court.
{{ _('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 %}
@@ -62,4 +66,6 @@ code in a proprietary work, I am not going to enforce this in court.
<p>
TODO: add more info...
</p>
+
+ <div class="horizontal-separator"></div>
{% 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 112ebc3..04caf8c 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
@@ -50,6 +50,10 @@ code in a proprietary work, I am not going to enforce this in court.
{{ _('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 %}