aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/policies/info_pages_templates/payload_info.html.jinja
blob: a71ca252c6c0ae2d510a40ad3c00ab96211deece (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
{#
SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0

Proxy info page with information about page with payload.

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 "info_base.html.jinja" %}

{% macro format_html_with_package_identifier_and_url(msg_fmt) %}
  {% set package_identifier = payload_data.mapping_identifier|e %}
  {% set url_fmt = 'https://hkt.mitm.it/package/viewbypayload/{payload_id}/{package_identifier}' %}
  {%
    set url = url_fmt.format(
        payload_id         = payload_data.ref.id,
        package_identifier = package_identifier
    )
  %}
  {{ msg_fmt.format(identifier=package_identifier, url=url|e)|safe }}
{% endmacro %}

{% block site_policy %}
  {% set fmt = _('info.payload.html.package_{identifier}{url}_is_used') %}
  {{ format_html_with_package_identifier_and_url(fmt) }}
{% endblock %}

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

  {{ label(_('info.payload.matched_pattern_label')) }}

  <p>
    {{ payload_data.pattern }}
  </p>
{% endblock %}