From 6a89505b5f2af8eed168ab9d011179fd6d665b7d Mon Sep 17 00:00:00 2001 From: Thomas O'Dwyer Date: Fri, 13 Sep 2024 09:55:50 +0100 Subject: [PATCH] Format components HTML --- .../templates/_components/article/header.html | 6 +- airlock/templates/_components/button.html | 130 ++++----- .../_components/card/card-footer.html | 16 +- airlock/templates/_components/card/card.html | 46 ++-- .../_components/description-item.html | 32 +-- .../templates/_components/form/checkbox.html | 14 +- airlock/templates/_components/form/input.html | 14 +- airlock/templates/_components/form/radio.html | 12 +- .../_components/form/radio_list.html | 54 ++-- .../templates/_components/form/textarea.html | 18 +- airlock/templates/_components/header.html | 254 +++++++++--------- airlock/templates/_components/link.html | 10 +- .../list-group/list-group-empty.html | 2 +- .../list-group/list-group-item.html | 24 +- .../list-group/list-group-rich-item.html | 38 +-- .../_components/list-group/list-group.html | 10 +- .../templates/_components/modal/modal.html | 4 +- .../_components/multiselect/multiselect.html | 18 +- airlock/templates/_components/pill/pill.html | 36 +-- .../_components/table/table-header.html | 8 +- airlock/templates/_components/time.html | 6 +- .../templates/_components/timeline-item.html | 34 +-- airlock/templates/_components/tooltip.html | 12 +- .../_partials/latest-job-requests-table.html | 80 +++--- 24 files changed, 439 insertions(+), 439 deletions(-) diff --git a/airlock/templates/_components/article/header.html b/airlock/templates/_components/article/header.html index c5f27744..09844f97 100644 --- a/airlock/templates/_components/article/header.html +++ b/airlock/templates/_components/article/header.html @@ -3,9 +3,9 @@

- {{ text }} - +
+ {{ text }} +
{% endif %} {{ children }} diff --git a/airlock/templates/_components/button.html b/airlock/templates/_components/button.html index d93d6c3f..0f640f7d 100644 --- a/airlock/templates/_components/button.html +++ b/airlock/templates/_components/button.html @@ -7,79 +7,79 @@ {% endif %} {% else %} -{% endif %} + {% if type == "link" %} + + {% else %} + + {% endif %} diff --git a/airlock/templates/_components/card/card-footer.html b/airlock/templates/_components/card/card-footer.html index d9c27a34..90446c79 100644 --- a/airlock/templates/_components/card/card-footer.html +++ b/airlock/templates/_components/card/card-footer.html @@ -1,13 +1,13 @@
{{ children }}
diff --git a/airlock/templates/_components/card/card.html b/airlock/templates/_components/card/card.html index e819bd54..80f482ab 100644 --- a/airlock/templates/_components/card/card.html +++ b/airlock/templates/_components/card/card.html @@ -1,39 +1,39 @@
{% if title or subtitle or button %} -
-
- {% if title %} -

- {{ title }} -

- {% endif %} +
+
+ {% if title %} +

+ {{ title }} +

+ {% endif %} - {% if subtitle %} -

{{ subtitle }}

+ {% if subtitle %} +

{{ subtitle }}

+ {% endif %} +
+ {% if button %} + {% #button class="flex-shrink-0" href=button_href type="link" variant="primary" %} + {{ button_text }} + {% /button %} + {% endif %} + {% if custom_button %} + {{ custom_button }} {% endif %}
- {% if button %} - {% #button class="flex-shrink-0" href=button_href type="link" variant="primary" %} - {{ button_text }} - {% /button %} - {% endif %} - {% if custom_button %} - {{ custom_button }} - {% endif %} -
{% endif %} {% if container %}
{% endif %} - {{ children }} + {{ children }} {% if container %}
{% endif %} diff --git a/airlock/templates/_components/description-item.html b/airlock/templates/_components/description-item.html index 9fc05c11..80be2fb6 100644 --- a/airlock/templates/_components/description-item.html +++ b/airlock/templates/_components/description-item.html @@ -2,20 +2,20 @@ {% var details_class=details_class|default:"mt-1 text-sm text-slate-900 pl-3 ml-0.5 border-l-2 border-l-slate-200 sm:pl-0 sm:ml-0 sm:border-l-0 sm:col-span-3 sm:mt-0" %}
-
{{ title }}
-
{{ children }}
+ class=" + px-3 py-2 + {% if stacked %} + flex flex-col gap-y-1 + {% else %} + sm:grid sm:grid-cols-4 sm:gap-3 + {% endif %} + md:py-4 md:px-6 + md:even:bg-white md:odd:bg-slate-50 + {{ class }} + "> +
{{ title }}
+
{{ children }}
diff --git a/airlock/templates/_components/form/checkbox.html b/airlock/templates/_components/form/checkbox.html index 52cbe9a4..42498de6 100644 --- a/airlock/templates/_components/form/checkbox.html +++ b/airlock/templates/_components/form/checkbox.html @@ -17,13 +17,13 @@ diff --git a/airlock/templates/_components/form/radio.html b/airlock/templates/_components/form/radio.html index a27eecc7..9d03e66f 100644 --- a/airlock/templates/_components/form/radio.html +++ b/airlock/templates/_components/form/radio.html @@ -5,12 +5,12 @@ {% if radios_label %} + class="inline-block font-semibold text-lg text-slate-900 cursor-pointer" + for="{{ label_for }}" + > + {{ radios_label }} + + {% if required %} + + {% endif %} + {% endif %} -{% for value, label in field.field.choices %} + {% for value, label in field.field.choices %} - {% if field.value == value %} - {% var checked=True %} - {% else %} - {% var checked=False %} - {% endif %} + {% if field.value == value %} + {% var checked=True %} + {% else %} + {% var checked=False %} + {% endif %} - {% with id=forloop.counter|stringformat:"s" %} - {% form_radio id="id_"|add:radios_name|add:id name=radios_name value=value label=label checked=checked %} - {% endwith %} + {% with id=forloop.counter|stringformat:"s" %} + {% form_radio id="id_"|add:radios_name|add:id name=radios_name value=value label=label checked=checked %} + {% endwith %} -{% endfor %} + {% endfor %} -{% if hint_text %} -
- {{ hint_text }} -
-{% endif %} + {% if hint_text %} +
+ {{ hint_text }} +
+ {% endif %}
diff --git a/airlock/templates/_components/form/textarea.html b/airlock/templates/_components/form/textarea.html index 70c1287f..ced93d7e 100644 --- a/airlock/templates/_components/form/textarea.html +++ b/airlock/templates/_components/form/textarea.html @@ -19,7 +19,7 @@ class="inline-block font-semibold text-lg text-slate-900 cursor-pointer" for="{{ label_for }}" > - {% if label %}{{ label }}{% else %}{{ field.label }}{% endif %} + {% if label %}{{ label }}{% else %}{{ field.label }}{% endif %} {% if required %} {% if textarea_value %}{{ textarea_value }}{% endif %} diff --git a/airlock/templates/_components/header.html b/airlock/templates/_components/header.html index 61eca0bc..bbf18368 100644 --- a/airlock/templates/_components/header.html +++ b/airlock/templates/_components/header.html @@ -1,18 +1,18 @@
diff --git a/airlock/templates/_components/link.html b/airlock/templates/_components/link.html index 529781b4..58d9fca2 100644 --- a/airlock/templates/_components/link.html +++ b/airlock/templates/_components/link.html @@ -1,10 +1,10 @@ + class=" + block transition-colors duration-200 px-4 py-3 font-semibold text-oxford-600 break-words + hover:bg-oxford-50 + focus:bg-oxford-50 focus:outline-none focus:ring-2 focus:ring-inset + sm:px-6 + {{ class }} + " + {% attrs aria-checked aria-labelled-by href role %} + > {% endif %} - {{ children }} + {{ children }} {% if not disabled %} - + {% endif %} diff --git a/airlock/templates/_components/list-group/list-group-rich-item.html b/airlock/templates/_components/list-group/list-group-rich-item.html index e123d592..e618b954 100644 --- a/airlock/templates/_components/list-group/list-group-rich-item.html +++ b/airlock/templates/_components/list-group/list-group-rich-item.html @@ -3,24 +3,24 @@
{{ type }}:
+ text-base font-semibold text-oxford-600 transition-colors + {% if no_truncate %}leading-tight{% else %}truncate{% endif %} + group-hover:text-oxford-900 + group-focus:text-oxford-900 + "> {% if url %} - - {{ title }} - + + {{ title }} + {% else %} - {{ title }} + {{ title }} {% endif %}
{% if status_text or custom_status %} @@ -55,9 +55,9 @@ {% pill variant="info" text=text %} {% endif %} {% endif %} - {% if custom_status %} - {{ custom_status }} - {% endif %} + {% if custom_status %} + {{ custom_status }} + {% endif %} {% endif %}
diff --git a/airlock/templates/_components/list-group/list-group.html b/airlock/templates/_components/list-group/list-group.html index 44129bc6..76a5eee6 100644 --- a/airlock/templates/_components/list-group/list-group.html +++ b/airlock/templates/_components/list-group/list-group.html @@ -1,10 +1,10 @@
    diff --git a/airlock/templates/_components/multiselect/multiselect.html b/airlock/templates/_components/multiselect/multiselect.html index 88b08ec4..d0975616 100644 --- a/airlock/templates/_components/multiselect/multiselect.html +++ b/airlock/templates/_components/multiselect/multiselect.html @@ -11,16 +11,16 @@
    diff --git a/airlock/templates/_components/pill/pill.html b/airlock/templates/_components/pill/pill.html index 59e150c6..2752291c 100644 --- a/airlock/templates/_components/pill/pill.html +++ b/airlock/templates/_components/pill/pill.html @@ -1,23 +1,23 @@ {% if sr_only %} {{ sr_only }} diff --git a/airlock/templates/_components/table/table-header.html b/airlock/templates/_components/table/table-header.html index 4e6e07ed..256330cf 100644 --- a/airlock/templates/_components/table/table-header.html +++ b/airlock/templates/_components/table/table-header.html @@ -1,10 +1,10 @@ {{ children }} diff --git a/airlock/templates/_components/time.html b/airlock/templates/_components/time.html index 453fd322..864a08dd 100644 --- a/airlock/templates/_components/time.html +++ b/airlock/templates/_components/time.html @@ -1,9 +1,9 @@