summaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/web_ui/templates
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-08-24 10:47:33 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 12:54:53 +0200
commitd516b9decad07b940b3cd117fc4e353dd8bbe7d2 (patch)
tree2ab6f78e067d88a9dce1043e496b1d5af283464b /src/hydrilla/proxy/web_ui/templates
parent964bd44649aaf03c9afea06eadad0443032d8b77 (diff)
downloadhaketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.tar.gz
haketilo-hydrilla-d516b9decad07b940b3cd117fc4e353dd8bbe7d2.zip
make repo packages (mappings) load as uninstalled; make them installable through the web UI
Diffstat (limited to 'src/hydrilla/proxy/web_ui/templates')
-rw-r--r--src/hydrilla/proxy/web_ui/templates/base.html.jinja6
-rw-r--r--src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja53
-rw-r--r--src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja6
-rw-r--r--src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja10
4 files changed, 66 insertions, 9 deletions
diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja
index b41a106..a34d538 100644
--- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja
@@ -45,6 +45,12 @@ in a proprietary work, I am not going to enforce this in court.
color: inherit;
}
+ .inline-form {
+ display: inline-block;
+ padding: 0;
+ margin: 0;
+ }
+
.small-print {
font-size: 80%;
color: #555;
diff --git a/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja b/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
index beedd43..1b46da7 100644
--- a/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/packages/show_single_version.html.jinja
@@ -25,6 +25,16 @@ in a proprietary work, I am not going to enforce this in court.
{{ super() }}
{% endblock %}
{% block main %}
+ {%- if uninstall_disallowed is defined %}
+ <aside class="error-note">
+ {{ _('web_ui.err.uninstall_disallowed') }}
+ </aside>
+ {%- endif %}
+ {%- if repo_communication_error is defined %}
+ <aside class="error-note">
+ {{ _('web_ui.err.repo_communication_error') }}
+ </aside>
+ {%- endif %}
<h3>
{{
_('web_ui.packages.single_version.heading.name_{}')
@@ -35,4 +45,45 @@ in a proprietary work, I am not going to enforce this in court.
{{ display_info.info.versioned_identifier }}
</div>
TODO: add more info...
-{% endblock %}
+ {%- if display_info.installed == InstalledStatus.INSTALLED %}
+ <div>
+ {{ _('web_ui.packages.single_version.package_is_installed') }}
+ </div>
+ {%- if uninstall_disallowed is not defined %}
+ <form method="POST">
+ <input name="action" value="uninstall_package" type="hidden">
+ <button class="green-button">
+ {{ _('web_ui.packages.single_version.uninstall_button') }}
+ </button>
+ </form>
+ {%- endif %}
+ {%- elif display_info.installed == InstalledStatus.NOT_INSTALLED %}
+ <div>
+ {{ _('web_ui.packages.single_version.package_is_not_installed') }}
+ </div>
+ <form method="POST">
+ <input name="action" value="install_package" type="hidden">
+ <button class="green-button">
+ {{ _('web_ui.packages.single_version.install_button') }}
+ </button>
+ </form>
+ {%- else %}
+ <div>
+ {{ _('web_ui.packages.single_version.package_install_failed') }}
+ </div>
+ <div>
+ <form method="POST" class="inline-form">
+ <input name="action" value="install_package" type="hidden">
+ <button class="green-button">
+ {{ _('web_ui.packages.single_version.retry_install_button') }}
+ </button>
+ </form>
+ <form method="POST" class="inline-form">
+ <input name="action" value="uninstall_package" type="hidden">
+ <button class="green-button">
+ {{ _('web_ui.packages.single_version.leave_uninstalled_button') }}
+ </button>
+ </form>
+ </div>
+ {%- endif %}
+{%- endblock %}
diff --git a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja
index 3fdcbd3..1b618cf 100644
--- a/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/repos/add.html.jinja
@@ -31,12 +31,12 @@ in a proprietary work, I am not going to enforce this in court.
</div>
{% if repo_name_invalid is defined -%}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_name_invalid') }}
+ {{ _('web_ui.err.repo_name_invalid') }}
</aside>
{%- endif %}
{% if repo_name_taken is defined -%}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_name_taken') }}
+ {{ _('web_ui.err.repo_name_taken') }}
</aside>
{%- endif %}
<div>
@@ -49,7 +49,7 @@ in a proprietary work, I am not going to enforce this in court.
</div>
{% if repo_url_invalid is defined -%}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_url_invalid') }}
+ {{ _('web_ui.err.repo_url_invalid') }}
</aside>
{%- endif %}
<div>
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
index b3a4f32..a5998b8 100644
--- a/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja
+++ b/src/hydrilla/proxy/web_ui/templates/repos/show_single.html.jinja
@@ -29,12 +29,12 @@ in a proprietary work, I am not going to enforce this in court.
{% block main %}
{%- if repo_communication_error is defined %}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_communication_error') }}
+ {{ _('web_ui.err.repo_communication_error') }}
</aside>
{%- endif %}
{%- if repo_api_version_unsupported is defined %}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_api_version_unsupported') }}
+ {{ _('web_ui.err.repo_api_version_unsupported') }}
</aside>
{%- endif %}
{%- set repo_id = display_info.ref.id %}
@@ -61,12 +61,12 @@ in a proprietary work, I am not going to enforce this in court.
<input type="hidden" name="action" value="update_repo_data">
{%- if repo_name_invalid is defined %}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_name_invalid') }}
+ {{ _('web_ui.err.repo_name_invalid') }}
</aside>
{%- endif %}
{%- if repo_name_taken is defined %}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_name_taken') }}
+ {{ _('web_ui.err.repo_name_taken') }}
</aside>
{%- endif %}
<div>
@@ -109,7 +109,7 @@ in a proprietary work, I am not going to enforce this in court.
<input type="hidden" name="action" value="update_repo_data">
{%- if repo_url_invalid is defined %}
<aside class="error-note">
- {{ _('web_ui.repos.add.repo_url_invalid') }}
+ {{ _('web_ui.err.repo_url_invalid') }}
</aside>
{%- endif %}
<div>