From 04853ff19450c5925a7c9bacc11abe90e75f8510 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 5 Sep 2022 13:58:34 +0200 Subject: [proxy] complete the text content and styling of web UI pages written so far --- .../proxy/web_ui/templates/base.html.jinja | 81 +++++++---- .../templates/include/item_list_style.css.jinja | 2 +- .../proxy/web_ui/templates/index.html.jinja | 20 ++- .../web_ui/templates/items/item_view.html.jinja | 20 ++- .../templates/items/item_viewversion.html.jinja | 54 ++++--- .../web_ui/templates/items/libraries.html.jinja | 4 + .../web_ui/templates/items/library_view.html.jinja | 8 +- .../templates/items/library_viewversion.html.jinja | 6 + .../templates/items/load_from_disk.html.jinja | 39 ++++-- .../web_ui/templates/items/package_view.html.jinja | 8 +- .../templates/items/package_viewversion.html.jinja | 156 ++++++++++++--------- .../web_ui/templates/items/packages.html.jinja | 4 + .../proxy/web_ui/templates/repos/add.html.jinja | 47 ++++--- .../proxy/web_ui/templates/repos/index.html.jinja | 18 ++- .../web_ui/templates/repos/show_single.html.jinja | 143 ++++++++++--------- 15 files changed, 378 insertions(+), 232 deletions(-) (limited to 'src/hydrilla/proxy/web_ui/templates') diff --git a/src/hydrilla/proxy/web_ui/templates/base.html.jinja b/src/hydrilla/proxy/web_ui/templates/base.html.jinja index 2febf2f..918fb28 100644 --- a/src/hydrilla/proxy/web_ui/templates/base.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/base.html.jinja @@ -21,14 +21,24 @@ in a proprietary work, I am not going to enforce this in court. {% macro button_row(buttons_data) %} -
+
{% for classes, text, action in buttons_data %} + {% if not loop.first %} +
+ {% do classes.append('button-bordering-left') %} + {% endif %} + + {% if not loop.last %} + {% do classes.append('button-bordering-right') %} + {% endif %} + {% if 'disabled-button' in classes %} {% set disabled_attr = ' disabled=""' %} {% else %} {% set disabled_attr = '' %} {% endif %} -
+ +
{% endmacro %} +{% macro error_note(note_text) %} + +{% endmacro %} + {% block head %} @@ -56,6 +72,7 @@ in a proprietary work, I am not going to enforce this in court. #main { max-width: 750px; margin: auto; + padding: 0 5px; } a { @@ -63,16 +80,6 @@ in a proprietary work, I am not going to enforce this in court. color: inherit; } - .inline-form { - display: inline-flex; - padding: 0; - margin: 0; - } - - .inline-form > * { - flex: 1 1 0; - } - .small-print { font-size: 80%; color: #555; @@ -81,22 +88,52 @@ in a proprietary work, I am not going to enforce this in court. .error-note { display: block; border-left: 5px solid #a33; + padding: 10px; background-color: #fcc; } + .block-with-bottom-margin, .flex-row, aside, p { + display: block; + margin: 0 0 10px 0; + } + + .flex-row { + display: flex; + padding: 0; + } + + .flex-row > * { + flex: 1 1 0; + } + + .flex-row > .flex-row { + margin: 0; + } + + .button-row-separator { + background-color: #65A065; + flex: 0 0 2px; + } + + div.horizontal-separator { + display: block; + background-color: #e3e3e3; + height: 1px; + margin: 0 0 10px 0; + } + .green-button, .red-button, .blue-button { border: none; border-radius: 2px; color: white; text-align: center; text-decoration: none; - display: inline-block; + display: block; padding: 5px 10px; -moz-user-select: none; user-select: none; cursor: pointer; font: 400 0.9em sans-serif; - margin: 2px; } .green-button { @@ -112,34 +149,22 @@ in a proprietary work, I am not going to enforce this in court. } .disabled-button { - background-color: #aaa; - cursor: default; + background-color: #aaa; + cursor: default; } .button-bordering-right { - margin-right: 0; border-radius: 2px 0 0 2px; - border-right: 1px solid #65A065; } .button-bordering-left { - margin-left: 0; border-radius: 0 2px 2px 0; - border-left: 1px solid #65A065; } .button-bordering-left.button-bordering-right { border-radius: 0; } - .button-row { - display: flex; - } - - .button-row > * { - flex: 1 1 0; - } - .hide { 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 index 86ac1b5..d834862 100644 --- 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 @@ -26,7 +26,7 @@ ul#item_list > li { list-style-type: none; max-width: 100%; white-space: nowrap; - margin: 0 5px 0 5px; + margin: 0; } ul#item_list > li > :only-child { diff --git a/src/hydrilla/proxy/web_ui/templates/index.html.jinja b/src/hydrilla/proxy/web_ui/templates/index.html.jinja index 8fd2ead..725e30e 100644 --- a/src/hydrilla/proxy/web_ui/templates/index.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/index.html.jinja @@ -19,7 +19,25 @@ 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.home.title') }} {% endblock %} + {% block main %} - {{ _('web_ui.home.welcome_to_haketilo') }} +

+ {{ _('web_ui.home.heading.welcome_to_haketilo') }} +

+ +

+ {{ _('web_ui.home.this_is_haketilo_page') }} +

+ +
+ +

+ {{ _('web_ui.home.heading.about_haketilo') }} +

+ +

+ {{ _('web_ui.home.haketilo_is_blah_blah') }} +

{% endblock %} diff --git a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja index 07212ff..d4910ab 100644 --- a/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja +++ b/src/hydrilla/proxy/web_ui/templates/items/item_view.html.jinja @@ -20,13 +20,13 @@ in a proprietary work, I am not going to enforce this in court. #} {% extends "base.html.jinja" %} -{% macro versioned_identifier_with_repo(info) %} +{% macro versioned_identifier_with_repo(info) -%} {{ info.info.version_string }} - {% if not info.is_local %} + {%- if not info.is_local %} @ {{ info.info.repo }} - {% endif %} -{% endmacro %} + {%- endif %} +{%- endmacro %} {% block style %} {{ super() }} @@ -37,15 +37,25 @@ in a proprietary work, I am not going to enforce this in court. color: #777; } {% endblock %} + {% block main %} {% block main_info %}

{% block heading required %}{% endblock %}

{% endblock %} - {% if display_info.all_versions|length > 0 %} + + {% + if display_info.all_versions|length > 1 or + (display_info.all_versions|length == 1 and + (version_display_info is not defined or + version_display_info.ref != display_info.all_versions[0].ref)) + %} +
+

{% block version_list_heading required %} {% endblock %}

+