From 0e99abfeb2dad151a411401886c489c45baefd0d Mon Sep 17 00:00:00 2001 From: Stefano Apostolico Date: Fri, 15 Nov 2024 06:01:42 +0100 Subject: [PATCH] fizes templates --- .../workspaces/admin/batch.py | 2 +- .../templates/workspace/change_form.html | 19 +-- .../templates/workspace/change_list.html | 110 ++++++++---------- .../workspace/hh_ind_change_form.html | 33 +----- .../workspace/individual/change_form.html | 4 +- .../templates/workspace/layout.html | 1 - .../templates/workspace/w_submit_line.html | 2 +- .../workspaces/theme/static/css/styles.css | 48 +------- .../theme/static_src/src/_forms.scss | 11 +- 9 files changed, 66 insertions(+), 164 deletions(-) diff --git a/src/country_workspace/workspaces/admin/batch.py b/src/country_workspace/workspaces/admin/batch.py index 6adc9b0..dc0b69e 100644 --- a/src/country_workspace/workspaces/admin/batch.py +++ b/src/country_workspace/workspaces/admin/batch.py @@ -57,4 +57,4 @@ def has_add_permission(self, request: HttpRequest, obj: Optional[CountryBatch] = def imported_records(self, btn: LinkButton) -> None: base = reverse("workspace:workspaces_countryhousehold_changelist") obj = btn.context["original"] - btn.href = f"{base}?batch__exact={obj.pk}&batch__program__exact={obj.program.pk}" + btn.href = f"{base}?batch__exact={obj.pk}" diff --git a/src/country_workspace/workspaces/templates/workspace/change_form.html b/src/country_workspace/workspaces/templates/workspace/change_form.html index 0fe0279..e2a57c2 100644 --- a/src/country_workspace/workspaces/templates/workspace/change_form.html +++ b/src/country_workspace/workspaces/templates/workspace/change_form.html @@ -12,22 +12,10 @@ {% block coltype %}colM{% endblock %} {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-form{% endblock %} -{##} -{#{% if not is_popup %}#} -{# {% block breadcrumbs %}#} -{# #} -{# {% endblock %}#} -{#{% endif %}#} {% block content %} + +
{% block object-tools %} {% if change and not is_popup %} {% endif %} {% endblock %} -
{% csrf_token %}{% block form_top %}{% endblock %} + id="{{ opts.model_name }}_form" novalidate class="min-w-full">{% csrf_token %}{% block form_top %}{% endblock %}
{% if is_popup %}{% endif %} {% if to_field %}{% endif %} diff --git a/src/country_workspace/workspaces/templates/workspace/change_list.html b/src/country_workspace/workspaces/templates/workspace/change_list.html index a5ef0ac..bd8dfdb 100755 --- a/src/country_workspace/workspaces/templates/workspace/change_list.html +++ b/src/country_workspace/workspaces/templates/workspace/change_list.html @@ -1,20 +1,7 @@ {% extends "workspace/_base.html" %}{% load i18n static workspace_urls workspace_list %} -{#{% block extrahead %}#} -{# {{ block.super }}#} -{# {{ media.js }}#} -{# #} -{#{% endblock %}#} -{#{% block breadcrumbs %}#} -{# #} -{#{% endblock %}#} {% block extrastyle %} - {{ block.super }} - + {{ block.super }} + {% endblock %} {% block content %}
@@ -26,55 +13,54 @@ {% endblock %} {% endblock %} -
- {% if cl.formset and cl.formset.errors %} -

- {% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below. - {% plural %}Please correct the errors below.{% endblocktranslate %} -

- {{ cl.formset.non_form_errors }} - {% endif %} -
-
- {% block search %}{% search_form cl %}{% endblock %} - {% csrf_token %} - {% if cl.formset %} -
{{ cl.formset.management_form }}
- {% endif %} - - {% block result_list %} - {% if action_form and actions_on_top and cl.show_admin_actions %} - {% admin_actions %}{% endif %} - {% result_list cl %} - {% if action_form and actions_on_bottom and cl.show_admin_actions %} - {% admin_actions %}{% endif %} - {% endblock %} - {% block pagination %}{% pagination cl %}{% endblock %} - +
+ {% if cl.formset and cl.formset.errors %} +

+ {% blocktranslate count counter=cl.formset.total_error_count %}Please correct the error below. + {% plural %}Please correct the errors below.{% endblocktranslate %} +

+ {{ cl.formset.non_form_errors }} + {% endif %} +
+
+ {% block search %}{% search_form cl %}{% endblock %} +
{% csrf_token %} + {% if cl.formset %} +
{{ cl.formset.management_form }}
+ {% endif %} + {% block result_list %} + {% if action_form and actions_on_top and cl.show_admin_actions %} + {% admin_actions %}{% endif %} + {% result_list cl %} + {% if action_form and actions_on_bottom and cl.show_admin_actions %} + {% admin_actions %}{% endif %} + {% endblock %} + {% block pagination %}{% pagination cl %}{% endblock %} +
+
+ {% block filters %} + {% if cl.has_filters %} + + {% endif %} + {% endblock %}
- {% block filters %} - {% if cl.has_filters %} - - {% endif %} - {% endblock %}
-
{% endblock %} diff --git a/src/country_workspace/workspaces/templates/workspace/hh_ind_change_form.html b/src/country_workspace/workspaces/templates/workspace/hh_ind_change_form.html index 75c7591..1c9e0d0 100644 --- a/src/country_workspace/workspaces/templates/workspace/hh_ind_change_form.html +++ b/src/country_workspace/workspaces/templates/workspace/hh_ind_change_form.html @@ -1,41 +1,15 @@ {% extends "workspace/change_form.html" %} {% load i18n static admin_modify workspace_urls workspace_modify %} {% block content_title %}{% endblock %} -{% block coltype %}colMX{% endblock %} - -{#{% if not is_popup %}#} -{# {% block breadcrumbs %}#} -{# #} -{# {% endblock %}#} -{#{% endif %}#} +{#{% block coltype %}colMX{% endblock %}#} {% block content %} {% block object-tools %} {{ block.super }} -{# {% if change and not is_popup %}#} -{#
    #} -{# {% block object-tools-items %}#} -{# {% change_form_object_tools %}#} -{# {% include "admin_extra_buttons/includes/change_form_buttons.html" %}#} -{# {% endblock %}#} -{#
#} -{# {% endif %}#} {% endblock %} -
-
+
+
{% csrf_token %}{% block form_top %}{% endblock %}
@@ -73,4 +47,5 @@
+
{% endblock %} diff --git a/src/country_workspace/workspaces/templates/workspace/individual/change_form.html b/src/country_workspace/workspaces/templates/workspace/individual/change_form.html index 2407008..0c087e1 100644 --- a/src/country_workspace/workspaces/templates/workspace/individual/change_form.html +++ b/src/country_workspace/workspaces/templates/workspace/individual/change_form.html @@ -8,8 +8,8 @@ ›{{ original }}{% admin_url original %} {% else %} › Households - › {{ original.household }}{% admin_url selected_household %} - › members {% admin_url modeladmin household__exact=selected_household.pk %} + › {{ original.household }}{% admin_url original.household %} + › members {% admin_url modeladmin household__exact=original.household.pk %} ›{{ original }}{% admin_url original %} {% endif %} {% endblock %} diff --git a/src/country_workspace/workspaces/templates/workspace/layout.html b/src/country_workspace/workspaces/templates/workspace/layout.html index 769dae7..8a7ebe9 100644 --- a/src/country_workspace/workspaces/templates/workspace/layout.html +++ b/src/country_workspace/workspaces/templates/workspace/layout.html @@ -84,7 +84,6 @@ {{ app.version }} {{ app.build_date }} {{ app.commit }} - (c) 2024 -UNICEF
diff --git a/src/country_workspace/workspaces/templates/workspace/w_submit_line.html b/src/country_workspace/workspaces/templates/workspace/w_submit_line.html index 485d98e..d6e2746 100644 --- a/src/country_workspace/workspaces/templates/workspace/w_submit_line.html +++ b/src/country_workspace/workspaces/templates/workspace/w_submit_line.html @@ -11,7 +11,7 @@ {% endif %} {% if show_delete_link and original %} {% url opts|workspace_urlname:'delete' original.pk|admin_urlquote as delete_url %} - {% translate "Delete" %} + {% translate "Delete" %} {% endif %} {% endblock %}
diff --git a/src/country_workspace/workspaces/theme/static/css/styles.css b/src/country_workspace/workspaces/theme/static/css/styles.css index 77dde53..7be159a 100644 --- a/src/country_workspace/workspaces/theme/static/css/styles.css +++ b/src/country_workspace/workspaces/theme/static/css/styles.css @@ -686,7 +686,7 @@ form .helptext { font-style: italic; } -a.button, input[type=submit], button.button, a.closelink, a.deletelink { +a.button, input[type=submit], button.button, a.closelink, a.deletelink { margin: 0; color: white; cursor: pointer; @@ -1395,52 +1395,10 @@ video { display: none; } -.container { - width: 100%; -} - -@media (min-width: 640px) { - .container { - max-width: 640px; - } -} - -@media (min-width: 768px) { - .container { - max-width: 768px; - } -} - -@media (min-width: 1024px) { - .container { - max-width: 1024px; - } -} - -@media (min-width: 1280px) { - .container { - max-width: 1280px; - } -} - -@media (min-width: 1536px) { - .container { - max-width: 1536px; - } -} - .static { position: static; } -.fixed { - position: fixed; -} - -.sticky { - position: sticky; -} - .float-right { float: right; } @@ -1578,10 +1536,6 @@ video { flex-direction: column; } -.content-start { - align-content: flex-start; -} - .items-center { align-items: center; } diff --git a/src/country_workspace/workspaces/theme/static_src/src/_forms.scss b/src/country_workspace/workspaces/theme/static_src/src/_forms.scss index 7d4333d..b39d39a 100644 --- a/src/country_workspace/workspaces/theme/static_src/src/_forms.scss +++ b/src/country_workspace/workspaces/theme/static_src/src/_forms.scss @@ -9,7 +9,7 @@ form { } -a.button, input[type=submit], button.button, a.closelink, a.deletelink { +a.button, input[type=submit], button.button, a.closelink, a.deletelink { margin: 0; color: white; @@ -38,7 +38,6 @@ a.button, input[type=submit], button.button, a.closelink, a.deletelink { background-color: rgba(99, 92, 15, 0.53); } - a.deletelink { background-color: rgb(207, 34, 34); float: right; @@ -91,11 +90,13 @@ fieldset.module { } } } -.beneficiary-form{ - input[type=text], select{ + +.beneficiary-form { + input[type=text], select { @apply min-w-full; } - .validation-error{ + + .validation-error { @apply italic; } }