From f78ae614702a79d43a6083f3d8880ac9cb026f05 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Wed, 26 Oct 2022 16:05:49 +0200 Subject: [proxy] Make some improvements to the URL patterns doc page internationalization and make it accessible from items import page --- src/hydrilla/proxy/self_doc/doc_base.html.jinja | 4 +--- src/hydrilla/proxy/self_doc/url_patterns.html.jinja | 18 +++++++++--------- .../proxy/web_ui/templates/hkt_mitm_it_base.html.jinja | 5 +++++ src/hydrilla/proxy/web_ui/templates/import.html.jinja | 4 +++- 4 files changed, 18 insertions(+), 13 deletions(-) (limited to 'src/hydrilla/proxy') diff --git a/src/hydrilla/proxy/self_doc/doc_base.html.jinja b/src/hydrilla/proxy/self_doc/doc_base.html.jinja index cef1abb..7982142 100644 --- a/src/hydrilla/proxy/self_doc/doc_base.html.jinja +++ b/src/hydrilla/proxy/self_doc/doc_base.html.jinja @@ -59,7 +59,5 @@ code in a proprietary work, I am not going to enforce this in court. {% endmacro %} {% macro small_heading(text) %} - + {{ label(text) }} {% endmacro %} diff --git a/src/hydrilla/proxy/self_doc/url_patterns.html.jinja b/src/hydrilla/proxy/self_doc/url_patterns.html.jinja index 45a0db3..7d2718f 100644 --- a/src/hydrilla/proxy/self_doc/url_patterns.html.jinja +++ b/src/hydrilla/proxy/self_doc/url_patterns.html.jinja @@ -20,10 +20,10 @@ code in a proprietary work, I am not going to enforce this in court. #} {% extends "doc_base.html.jinja" %} -{% block title %}URL patterns{% endblock %} +{% block title %}{{ _('doc.url_patterns.title') }}{% endblock %} {% block main %} - {{ big_heading('URL patterns') }} + {{ big_heading(_('doc.url_patterns.h_big')) }} {% call section() %} {% call paragraph() %} @@ -32,7 +32,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endcall %} {% call section() %} - {{ medium_heading(_('doc.url_patterns.heading.employed_solution')) }} + {{ medium_heading(_('doc.url_patterns.h_medium.employed_solution')) }} {% call paragraph() %} {{ _('doc.url_patterns.html.wildcards_intro')|safe }} @@ -44,7 +44,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endcall %} {% call section() %} - {{ small_heading(_('doc.url_patterns.label.domain_wildcards')) }} + {{ small_heading(_('doc.url_patterns.h_small.domain_wildcards')) }} {% call paragraph() %} {{ _('doc.url_patterns.html.domain_wildcards_intro')|safe }} @@ -67,7 +67,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endcall %} {% call section() %} - {{ small_heading(_('doc.url_patterns.label.path_wildcards')) }} + {{ small_heading(_('doc.url_patterns.h_small.path_wildcards')) }} {% call paragraph() %} {{ _('doc.url_patterns.html.path_wildcards_intro')|safe }} @@ -102,7 +102,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endcall %} {% call section() %} - {{ small_heading(_('doc.url_patterns.label.protocol_wildcards')) }} + {{ small_heading(_('doc.url_patterns.h_small.protocol_wildcards')) }} {% call paragraph() %} {{ _('doc.url_patterns.html.protocol_wildcards')|safe }} @@ -114,7 +114,7 @@ code in a proprietary work, I am not going to enforce this in court. {% endcall %} {% call section() %} - {{ small_heading(_('doc.url_patterns.label.wildcard_priorities')) }} + {{ small_heading(_('doc.url_patterns.h_small.wildcard_priorities')) }} {% call paragraph() %} {{ _('doc.url_patterns.priorities_intro') }} @@ -283,7 +283,7 @@ https://***.example.com/*** {% endcall %} {% call section() %} - {{ small_heading(_('doc.url_patterns.label.limits')) }} + {{ small_heading(_('doc.url_patterns.h_small.limits')) }} {% call paragraph() %} {{ _('doc.url_patterns.limits')|safe }} @@ -291,7 +291,7 @@ https://***.example.com/*** {% endcall %} {% call section() %} - {{ medium_heading(_('doc.url_patterns.heading.alt_solution')) }} + {{ medium_heading(_('doc.url_patterns.h_medium.alt_solution')) }} {% call paragraph() %} {{ _('doc.url_patterns.url_pattern_drawbacks') }} diff --git a/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja b/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja index a83d3e8..79d85df 100644 --- a/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/hkt_mitm_it_base.html.jinja @@ -114,3 +114,8 @@ code in a proprietary work, I am not going to enforce this in court. {{ super() }} {% endblock body %} + +{% macro hkt_doc_link(page_name) %} + {% set doc_url = url_for('home.home_doc', page=page_name) %} + {{ doc_link(doc_url) }} +{% endmacro %} diff --git a/src/hydrilla/proxy/web_ui/templates/import.html.jinja b/src/hydrilla/proxy/web_ui/templates/import.html.jinja index 7f3be50..afeb5a2 100644 --- a/src/hydrilla/proxy/web_ui/templates/import.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/import.html.jinja @@ -99,7 +99,9 @@ code in a proprietary work, I am not going to enforce this in court. {{ label(_('web_ui.import.description_field_label'), 'description') }} {{ form_field('description', required=false, height=3) }} - {{ label(_('web_ui.import.patterns_field_label'), 'patterns') }} + {% call label(_('web_ui.import.patterns_field_label'), 'patterns') %} + {{ hkt_doc_link('url_patterns') }} + {% endcall %} {% if invalid_ad_hoc_patterns is defined %} {{ error_note(_('web_ui.err.invalid_ad_hoc_patterns')) }} {% endif %} -- cgit v1.2.3