aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui/templates/items/package_viewversion.html.jinja
blob: 1eb9878aeb2ad364b7bc31d206fe0cdcaaea1d8e (about) (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{#
SPDX-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0

Proxy web UI package version view page.

This file is part of Hydrilla&Haketilo.

Copyright (C) 2022 Wojtek Kosior

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

{% block title %}
  {{ _('web_ui.items.single_version.package.title') }}
{% endblock %}

{% block heading %}
  {% if version_display_info.is_local %}
    {{
      _('web_ui.items.single_version.package_local.heading.name_{}')
          .format(version_display_info.info.long_name)
    }}
  {% else %}
    {{
      _('web_ui.items.single_version.package.heading.name_{}')
          .format(version_display_info.info.long_name)
    }}
  {% endif %}
{% endblock %}

{% block item_required_msg %}
  {{ _('web_ui.items.single_version.package.item_required') }}
{% endblock %}

{% block item_auto_activated_msg %}
  {{ _('web_ui.items.single_version.package.item_auto_activated') }}
{% endblock %}

{% block item_not_activated_msg %}
  {{ _('web_ui.items.single_version.package.item_not_activated') }}
{% endblock %}

{% block item_install_failed_msg %}
  {{ _('web_ui.items.single_version.package.install_failed') }}
{% endblock %}

{% block version_list_heading %}
  {{ _('web_ui.items.single_version.package.version_list_heading') }}
{% endblock %}

{% block main_info_bulk %}
  <p>
    TODO: add more info...
  </p>

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

  {% set enable_but_classes = ['blue-button'] %}
  {% set unenable_but_classes = ['green-button'] %}
  {% set disable_but_classes = ['red-button'] %}

  {% set unenable_text = _('web_ui.items.single_version.unenable_button') %}
  {% set disable_text  = _('web_ui.items.single_version.disable_button') %}
  {% set enable_text   = _('web_ui.items.single_version.enable_button') %}

  <p>
    {% if display_info.enabled == EnabledStatus.NO_MARK %}
      {% do unenable_but_classes.append('disabled-button') %}
      {{ _('web_ui.items.single_version.item_not_marked') }}
    {% elif display_info.enabled == EnabledStatus.DISABLED %}
      {% do disable_but_classes.append('disabled-button') %}
      {{ _('web_ui.items.single_version.item_disabled') }}
    {% else %}
      {# display_info.enabled == EnabledStatus.ENABLED #}
      {% do enable_but_classes.append('disabled-button') %}
      {{ _('web_ui.items.single_version.item_enabled') }}
    {% endif %}
  </p>

  {{
    button_row([
        (disable_but_classes,  disable_text,  'disable_item'),
        (unenable_but_classes, unenable_text, 'unenable_item'),
        (enable_but_classes,   enable_text,   'enable_item_version')
    ])
  }}

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

  {% if display_info.enabled == EnabledStatus.ENABLED %}
    {% set unpin_but_classes = ['green-button'] %}
    {% set pin_repo_but_classes = ['green-button'] %}
    {% set pin_ver_but_classes = ['green-button'] %}

    {% set unpin_text = _('web_ui.items.single_version.unpin_button') %}

    <p>
      {% if display_info.frozen == FrozenStatus.NOT_FROZEN %}
        {% do unpin_but_classes.append('disabled-button') %}
        {{ _('web_ui.items.single_version.not_pinned') }}
      {% endif %}

      {% if display_info.frozen == FrozenStatus.REPOSITORY %}
        {% if display_info.active_version.is_local %}
          {{ _('web_ui.items.single_version.pinned_repo_local') }}
        {% else %}
          {{
            _('web_ui.items.single_version.pinned_repo_{}')
                .format(display_info.active_version.info.repo)
          }}
        {% endif %}
        {%
          if display_info.active_version.info.repo ==
              version_display_info.info.repo
        %}
          {% if version_display_info.is_local %}
            {%
              set pin_repo_text =
                  _('web_ui.items.single_version.pin_local_repo_button')
            %}
          {% else %}
            {%
              set pin_repo_text =
                  _('web_ui.items.single_version.pin_repo_button')
            %}
          {% endif %}
          {% do pin_repo_but_classes.append('disabled-button') %}
        {% else %}
          {%
            set pin_repo_text =
                _('web_ui.items.single_version.repin_repo_button')
          %}
        {% endif %}
      {% else %}{# display_info.frozen == FrozenStatus.REPOSITORY #}
        {%
          set pin_repo_text =
              _('web_ui.items.single_version.pin_repo_button')
        %}
      {% endif %}{# else/ display_info.frozen == FrozenStatus.REPOSITORY #}

      {% if display_info.frozen == FrozenStatus.EXACT_VERSION %}
        {% if display_info.active_version.ref == version_display_info.ref %}
          {%
            set pin_ver_text =
                _('web_ui.items.single_version.pin_ver_button')
          %}
          {% do pin_ver_but_classes.append('disabled-button') %}
          {{ _('web_ui.items.single_version.pinned_ver') }}
        {% else %}
          {%
            set pin_ver_text = _('web_ui.items.single_version.repin_ver_button')
          %}
          {{ _('web_ui.items.single_version.pinned_other_ver') }}
        {% endif %}
      {% else %}
        {% set pin_ver_text = _('web_ui.items.single_version.pin_ver_button') %}
      {% endif %}{# else/ display_info.frozen == FrozenStatus.EXACT_VERSION #}

      {% if display_info.active_version.ref == version_display_info.ref %}
        {% if display_info.frozen != FrozenStatus.EXACT_VERSION %}
          {{ _('web_ui.items.single_version.active_ver_is_this_one') }}
        {% endif %}
      {% else %}
        {{
          _('web_ui.items.single_version.active_ver_is_{}')
              .format(
                  versioned_identifier_with_repo(display_info.active_version)
              )
        }}
      {% endif %}
    </p>

    {{
      button_row([
          (unpin_but_classes,    unpin_text,    'unfreeze_item'),
          (pin_repo_but_classes, pin_repo_text, 'freeze_to_repo'),
          (pin_ver_but_classes,  pin_ver_text,  'freeze_to_version')
      ])
    }}

    <div class="horizontal-separator"></div>
  {% endif %}{# display_info.enabled == EnabledStatus.ENABLED #}
{% endblock main_info_bulk %}