aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui/templates/repos__show_single.html.jinja
blob: 96100cee9ec6d0dad8de7409f8a43a5c6328d191 (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
{#
Spdx-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0


Proxy web UI repository settings 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 "base.html.jinja" %}
{% block title %} {{ _('web_ui.repos.single.title') }} {% endblock %}
{% block style %}
  {{ super() }}

  {% include 'include/checkbox_tricks_style.css.jinja' %}
{% endblock %}
{% block main %}
  {% set repo_id = display_info.ref.id -%}
  <h3>
    {% if display_info.is_local_semirepo -%}
      {{ _('web_ui.repos.local_packages_semirepo') }}
    {% else -%}
      {{ _('web_ui.repos.single.heading.name_{}').format(display_info.name) }}
    {% endif -%}
  </h3>
  {% if display_info.deleted and not display_info.is_local_semirepo -%}
    <div>
      {{ _('web_ui.repos.single.repo_is_deleted') }}
    </div>
  {% elif not display_info.deleted -%}
    <input id="show_url_edit_form" type="checkbox" class="chbx-tricks-show-hide"
	   checked="">
      <div>
	<div>
	  {{ display_info.url }}
	</div>
	<div>
	  <label for="show_url_edit_form" class="green-button">
	    {{ _('web_ui.repos.single.update_url_button') }}
	  </label>
	</div>
      </div>
      {% set action_url = url_for('.update_repo_url', repo_id=repo_id) -%}
      <form method="POST" action="{{ action_url }}">
	<input type="hidden" name="action" value="update_url">
	<div>
	  <input name="url" value="{{ display_info.url }}">
	</div>
	<div>
	  <button class="green-button">
	    {{ _('web_ui.repos.single.commit_update_url_button') }}
	  </button>
	  <label for="show_url_edit_form" class="green-button">
	    {{ _('web_ui.repos.single.abort_update_url_button') }}
	  </label>
	</div>
      </form>
    <div>
      {% if display_info.last_refreshed is none -%}
	{{ _('web_ui.repos.single.repo_never_refreshed') }}
      {% else -%}
	{{
	  _('web_ui.repos.single.last_refreshed_{}')
	      .format(display_info.last_refreshed.strftime('%F %H:%M'))
	}}
      {% endif -%}
      {% set action_url = url_for('.refresh_repo', repo_id=repo_id) -%}
      <form method="POST" action="{{ action_url }}">
	<input type="hidden" name="action" value="refresh_repo">
	<button class="green-button">
	  {{ _('web_ui.repos.single.refresh_now_button') }}
	</button>
      </form>
    </div>
  {% endif -%}
  <div>
    {{
      _('web_ui.repos.item_count_{mappings}_{resources}')
          .format(
              mappings  = display_info.mapping_count,
              resources = display_info.resource_count
          )
    }}
  </div>
  {% if not display_info.is_local_semirepo -%}
    {% set action_url = url_for('.remove_repo', repo_id=repo_id) -%}
    <form method="POST" action="{{ action_url }}">
      <button class="green-button">
	{{ _('web_ui.repos.single.remove_button') }}
      </button>
    </form>
  {% endif -%}
{% endblock -%}