aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui/templates
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-18 13:40:16 +0200
committerWojtek Kosior <koszko@koszko.org>2022-08-22 12:55:02 +0200
commit46ac94463bf42c6a071c258a37b2a58e88e0dfaa (patch)
tree39e7379f3bc7465a787a301be9ae7d560ceeaeee /src/hydrilla/proxy/web_ui/templates
parentdd332603636dc82c15abc3aa13ea0497174f9c32 (diff)
downloadhaketilo-hydrilla-46ac94463bf42c6a071c258a37b2a58e88e0dfaa.tar.gz
haketilo-hydrilla-46ac94463bf42c6a071c258a37b2a58e88e0dfaa.zip
make it possible to list all repositories in the web UI
Diffstat (limited to 'src/hydrilla/proxy/web_ui/templates')
-rw-r--r--src/hydrilla/proxy/web_ui/templates/base.html.jinja34
-rw-r--r--src/hydrilla/proxy/web_ui/templates/include/checkbox_tricks_style.css.jinja36
-rw-r--r--src/hydrilla/proxy/web_ui/templates/include/item_list_style.css.jinja39
-rw-r--r--src/hydrilla/proxy/web_ui/templates/packages.html.jinja71
-rw-r--r--src/hydrilla/proxy/web_ui/templates/packages__show_single.html.jinja11
-rw-r--r--src/hydrilla/proxy/web_ui/templates/repos.html.jinja43
-rw-r--r--src/hydrilla/proxy/web_ui/templates/repos__show_single.html.jinja97
7 files changed, 268 insertions, 63 deletions
diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja
index 4a9adf8..bca5948 100644
--- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja
@@ -25,16 +25,30 @@ in a proprietary work, I am not going to enforce this in court.
{% block head %}
<title>{% block title required %}{% endblock %} - Haketilo proxy</title>
<style>
- {% block style %}
- body {
- color: #444;
- }
-
- #main {
- max-width: 750px;
- margin: auto;
- }
- {% endblock %}
+ {% block style %}
+ body {
+ color: #444;
+ }
+
+ #main {
+ max-width: 750px;
+ margin: auto;
+ }
+
+ a {
+ text-decoration: inherit;
+ color: inherit;
+ }
+
+ .small-print {
+ font-size: 80%;
+ color: #555;
+ }
+
+ .hide {
+ display: none !important;
+ }
+ {% endblock %}
</style>
{% endblock %}
</head>
diff --git a/src/hydrilla/proxy/web_ui/templates/include/checkbox_tricks_style.css.jinja b/src/hydrilla/proxy/web_ui/templates/include/checkbox_tricks_style.css.jinja
new file mode 100644
index 0000000..b4c8edc
--- /dev/null
+++ b/src/hydrilla/proxy/web_ui/templates/include/checkbox_tricks_style.css.jinja
@@ -0,0 +1,36 @@
+{#
+Spdx-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+
+Proxy web UI reusable stylesheet for checkbox-based dynamically displayed
+elements.
+
+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.
+#}
+
+input.chbx-tricks-show-hide, input.chbx-tricks-hide-show {
+ display: none !important;
+}
+
+input.chbx-tricks-show-hide:checked+*+*,
+input.chbx-tricks-hide-show:not(:checked)+*+* {
+ display: none !important;
+}
+
+input.chbx-tricks-hide-show:checked+*+*,
+input.chbx-tricks-show-hide:not(:checked)+*+* {
+ display: none !important;
+}
diff --git a/src/hydrilla/proxy/web_ui/templates/include/item_list_style.css.jinja b/src/hydrilla/proxy/web_ui/templates/include/item_list_style.css.jinja
new file mode 100644
index 0000000..332d5f9
--- /dev/null
+++ b/src/hydrilla/proxy/web_ui/templates/include/item_list_style.css.jinja
@@ -0,0 +1,39 @@
+{#
+Spdx-License-Identifier: GPL-3.0-or-later OR CC-BY-SA-4.0
+
+
+Proxy web UI reusable stylesheet for lists.
+
+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.
+#}
+ul#item_list {
+ padding: 0;
+}
+
+ul#item_list > li {
+ list-style-type: none;
+ max-width: 100%;
+ overflow-x: scroll;
+ white-space: nowrap;
+ margin: 5px;
+}
+
+ul#item_list > li > :only-child {
+ display: block;
+ padding: 5px;
+ border: 2px solid #999;
+ border-radius: 5px;
+}
diff --git a/src/hydrilla/proxy/web_ui/templates/packages.html.jinja b/src/hydrilla/proxy/web_ui/templates/packages.html.jinja
index d0ba5cb..48ef80b 100644
--- a/src/hydrilla/proxy/web_ui/templates/packages.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/packages.html.jinja
@@ -20,59 +20,34 @@ 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 %}Available packages{% endblock %}
+{% block title %} {{ _('web_ui.packages.title') }} {% endblock %}
{% block style %}
-{{ super() }}
-
-ul#packages_list {
- padding: 0;
-}
-
-ul#packages_list > li {
- list-style-type: none;
- max-width: 100%;
- overflow-x: scroll;
- white-space: nowrap;
- padding: 5px;
- margin: 5px;
- border: 2px solid #999;
- border-radius: 5px;
-}
-
-ul#packages_list > li > a {
- display: block;
- text-decoration: inherit;
- color: inherit;
-}
-
-.package-identifier {
- font-size: 80%;
- color: #555;
-}
+ {{ super() }}
+ {% include 'include/item_list_style.css.jinja' %}
{% endblock %}
{% block main %}
- <h3>{{ _('web_ui.h3.packages') }}</h3>
- <ul id="packages_list">
+ <h3>{{ _('web_ui.packages.heading') }}</h3>
+ <ul id="item_list">
{% for info in display_infos %}
- <li
- {% if info.info.repo == '<local>' %}
- class="package-entry-local"
- {% endif %}
- >
- <a href="{{ url_for('.show_package', mapping_id=info.ref.id) }}">
- <div>
- {{ info.info.long_name }}
- </div>
- <div class="package-identifier">
- {{ info.info.versioned_identifier }}
- {% if info.info.repo != '<local>' %}
- @
- {{ info.info.repo }}
- {% endif %}
- </div>
- </a>
- </li>
+ <li
+ {% if info.info.repo == '<local>' %}
+ class="package-entry-local"
+ {% endif %}
+ >
+ <a href="{{ url_for('.show_package', mapping_id=info.ref.id) }}">
+ <div>
+ {{ info.info.long_name }}
+ </div>
+ <div class="small-print">
+ {{ info.info.versioned_identifier }}
+ {% if info.info.repo != '<local>' %}
+ @
+ {{ info.info.repo }}
+ {% endif %}
+ </div>
+ </a>
+ </li>
{% endfor %}
</ul>
{% endblock %}
diff --git a/src/hydrilla/proxy/web_ui/templates/packages__show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/packages__show_single.html.jinja
index 5e20dd7..eb526c4 100644
--- a/src/hydrilla/proxy/web_ui/templates/packages__show_single.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/packages__show_single.html.jinja
@@ -20,12 +20,17 @@ 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 %} Package details {% endblock %}
+{% block title %} {{ _('web_ui.packages.single.title') }} {% endblock %}
{% block style %}
-{{ super() }}
+ {{ super() }}
{% endblock %}
{% block main %}
- <h3>{{ _('web_ui.h3.package_{}').format(display_info.info.long_name) }}</h3>
+ <h3>
+ {{
+ _('web_ui.packages.single.heading.name_{}')
+ .format(display_info.info.long_name)
+ }}
+ </h3>
<div class="package-identifier">
{{ display_info.info.versioned_identifier }}
</div>
diff --git a/src/hydrilla/proxy/web_ui/templates/repos.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos.html.jinja
index 59eb1bd..94b7e2b 100644
--- a/src/hydrilla/proxy/web_ui/templates/repos.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/repos.html.jinja
@@ -20,7 +20,46 @@ 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 %}Repositories{% endblock %}
+{% block title %}{{ _('web_ui.repos.title') }}{% endblock %}
+{% block style %}
+ {{ super() }}
+
+ {% include 'include/item_list_style.css.jinja' %}
+{% endblock %}
{% block main %}
- Not implemented yet :(
+ <h3>{{ _('web_ui.repos.heading') }}</h3>
+ <ul id="item_list">
+ {% for info in display_infos %}
+ <li
+ {% if info.deleted %}
+ class="repo-entry-deleted"
+ {% endif %}
+ >
+ <a href="{{ url_for('.show_repo', repo_id=info.ref.id) }}">
+ <div>
+ {{ info.name }}
+ </div>
+ {% if not info.deleted %}
+ <div class="small-print">
+ {{ info.url }}
+ </div>
+ {% endif %}
+ <div class="small-print">
+ {{ _('web_ui.repos.package_count_{}').format(info.mapping_count) }}
+ </div>
+ </a>
+ </li>
+ {% endfor %}
+ <li>
+ <a href="{{ url_for('.show_repo', repo_id=1) }}">
+ {{ _('web_ui.repos.local_packages_semirepo') }}
+ <div class="small-print">
+ {{
+ _('web_ui.repos.package_count_{}')
+ .format(local_semirepo_info.mapping_count)
+ }}
+ </div>
+ </a>
+ </li>
+ </ul>
{% endblock %}
diff --git a/src/hydrilla/proxy/web_ui/templates/repos__show_single.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos__show_single.html.jinja
new file mode 100644
index 0000000..9abb00d
--- /dev/null
+++ b/src/hydrilla/proxy/web_ui/templates/repos__show_single.html.jinja
@@ -0,0 +1,97 @@
+{#
+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 %}
+ <h3>
+ {% if display_info.ref.id != '1' %}
+ {{
+ _('web_ui.repos.single.heading.name_{}')
+ .format(display_info.info.long_name)
+ }}
+ {% else %}
+ {{ _('web_ui.repos.local_packages_semirepo') }}
+ {% endif %}
+ </h3>
+ {% if display_info.deleted == True %}
+ <div>
+ {{ _('web_ui.repos.single.repo_is_deleted') }}
+ </div>
+ {% elif display_info.deleted == False %}
+ <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>
+ <form method="POST">
+ <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 %}
+ <form method="POST">
+ <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>
+{% endblock %}