summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-10-07 12:54:04 +0200
committerWojtek Kosior <koszko@koszko.org>2022-10-07 12:54:04 +0200
commit6b4de4125e0552292087f443a61518c433981465 (patch)
tree9ec21ece7e1c8f2430a4bc86e71abab9b9ee3203
parenta072f5d48406d7e4fe69c5d9d02d64384d42660d (diff)
downloadhaketilo-hydrilla-6b4de4125e0552292087f443a61518c433981465.tar.gz
haketilo-hydrilla-6b4de4125e0552292087f443a61518c433981465.zip
[proxy] prevent library links from appearing in package descriptions when advanced user mode is off
-rw-r--r--src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja33
1 files changed, 18 insertions, 15 deletions
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 bc33c42..230168a 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
@@ -70,22 +70,25 @@ code in a proprietary work, I am not going to enforce this in court.
{% for lib_identifier, patterns in by_lib|dictsort %}
<li class="invisible-entry-line">
<div>
- {% set encoded = patterns[0]|urlencode|replace('/', '%2F') %}
- {%
- set url = url_for(
- '.show_payload',
- item_version_id = version_display_info.ref.id,
- pattern = encoded,
- lib_identifier = lib_identifier
- )
- %}
- <div>
- <a href="{{ url }}">
- {{ lib_identifier }}
- </a>
- </div>
+ {% if settings.advanced_user %}
+ <div>
+ {% set encoded = patterns[0]|urlencode|replace('/', '%2F') %}
+ {%
+ set url = url_for(
+ '.show_payload',
+ item_version_id = version_display_info.ref.id,
+ pattern = encoded,
+ lib_identifier = lib_identifier
+ )
+ %}
+ <a href="{{ url }}">
+ {{ lib_identifier }}
+ </a>
+ </div>
+ {% set pattern_div_attrs = {'class': 'small-print'} %}
+ {% endif %}
{% for pattern in patterns|unique|sort(attribute='identifier') %}
- <div class="small-print">
+ <div{{ pattern_div_attrs|default({})|xmlattr }}>
{{ pattern }}
</div>
{% endfor %}