aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/policies/info_pages_templates/info_base.html.jinja
blob: 9268c92bfd9d4479fa3fa5a961a69cdf4f7ac7a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{#
SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0

Proxy info page with information about other page - base template.

This file is part of Hydrilla&Haketilo.

Copyright (C) 2022 Wojtek Kosior <koszko@koszko.org>

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 of this
code in a proprietary work, I am not going to enforce this in court.
#}
{% extends "base.html.jinja" %}

{% macro hkt_doc_link(page_name) %}
  {% set doc_url = 'https://hkt.mitm.it/doc/' ~ page_name %}
  {{ doc_link(doc_url) }}
{% endmacro %}

{% block style %}
  {{ super() }}

  #main {
      padding: 0 10px;
  }
{% endblock %}

{% block head %}
  {{ super() }}

  <title>{{ _('info.base.title') }}</title>
{% endblock head %}

{% block main %}
  <h3>
    {{ _('info.base.heading.page_info') }}
    {{ hkt_doc_link('popup') }}
  </h3>

  {{ label(_('info.base.page_url_label')) }}

  <p>
    {{ url }}
  </p>

  <div class="horizontal-separator"></div>

  {% call label(_('info.base.page_policy_label')) %}
    {{ hkt_doc_link('policy_selection') }}
  {% endcall %}

  <p class="has-colored-links">
    {% block site_policy required %}{% endblock %}
  </p>

  {% block main_rest %}
  {% endblock %}

  {% block options %}
    <div class="horizontal-separator"></div>

    {{ label(_('info.base.more_config_options_label')) }}

    {% set site_pattern = url_patterns.pattern_for_domain(url)|urlencode %}
    {% set page_pattern = url_patterns.normalize_pattern(url)|urlencode %}

    {%
      for pattern, hkt_url_fmt, but_text in [
          (site_pattern, 'https://hkt.mitm.it/rules/viewbypattern?pattern={}',
          _('info.base.this_site_script_blocking_button')),

          (site_pattern, 'https://hkt.mitm.it/import?pattern={}',
          _('info.base.this_site_payload_button')),

          (page_pattern, 'https://hkt.mitm.it/rules/viewbypattern?pattern={}',
          _('info.base.this_page_script_blocking_button')),

          (page_pattern, 'https://hkt.mitm.it/import?pattern={}',
          _('info.base.this_page_payload_button'))
      ]
    %}
      {% set hkt_url = hkt_url_fmt.format(pattern) %}
      {% set classes = "green-button block-with-bottom-margin" %}
      <a class="{{classes}}" href="{{ hkt_url }}" target="_blank">
        {{ but_text }}
      </a>
    {% endfor %}
  {% endblock options %}
{% endblock main %}