From 4f05953fa1d2c88f7d9f9052147544a108b88fcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Wed, 11 Dec 2024 15:41:36 -0300 Subject: [PATCH] Ajusta classe util report para bootstrap --- .../utils/templates/utils/report/report.html | 82 +++++++++++++++++++ .../utils/report/report_items_snippet.html | 41 ++++++++++ .../templates/utils/report/report_pdf.html | 20 +++++ 3 files changed, 143 insertions(+) create mode 100644 sigi/apps/utils/templates/utils/report/report.html create mode 100644 sigi/apps/utils/templates/utils/report/report_items_snippet.html create mode 100644 sigi/apps/utils/templates/utils/report/report_pdf.html diff --git a/sigi/apps/utils/templates/utils/report/report.html b/sigi/apps/utils/templates/utils/report/report.html new file mode 100644 index 0000000..5c8483e --- /dev/null +++ b/sigi/apps/utils/templates/utils/report/report.html @@ -0,0 +1,82 @@ +{% extends "admin/base_site.html" %} +{% load static i18n djbs_extras %} + +{% if form %} + {% block extrastyle %} + {{ block.super }} + {{ form.media }} + {% endblock extrastyle %} +{% endif %} + +{% block breadcrumbs %} + + +{% endblock %} + +{% block content_title %} +
{{ report_title }}
+{% endblock %} + +{% block content %} + {% block form %} + {% if form %} +
+
+ +
+ {% block filterform %}{{ form }}{% endblock %} +
+ +
+
+ {% else %} + {% block actionbar %} + + {% endblock actionbar %} + {% endif %} + {% endblock form %} + + {% block datacard %} +
+
+ {% block data %} + {% include "utils/report/report_items_snippet.html" with mode="html" %} + {% endblock data %} +
+
+ {% endblock datacard %} +{% endblock %} + +{% block footer %} + {{ block.super }} + {% if form %} + {{ form.media }} + {% endif %} + +{% endblock %} \ No newline at end of file diff --git a/sigi/apps/utils/templates/utils/report/report_items_snippet.html b/sigi/apps/utils/templates/utils/report/report_items_snippet.html new file mode 100644 index 0000000..c14151d --- /dev/null +++ b/sigi/apps/utils/templates/utils/report/report_items_snippet.html @@ -0,0 +1,41 @@ +{% load i18n admin_urls sigi_tags %} + + + + + {% for label in list_labels %} + + {% endfor %} + + + + {% for obj in object_list %} + {% if break_field %} + {% with obj|valueof:break_field as monitor_break %} + {% ifchanged monitor_break %} + + {% endifchanged %} + {% endwith %} + {% endif %} + + {% for field_name in list_fields %} + + {% endfor %} + + {% empty %} + + + + {% endfor %} + +
{{ label }}
{{ monitor_break }}
+ {% if field_name in link_fields %} + + {{ obj|valueof:field_name|safe }} + + {% else %} + {{ obj|valueof:field_name|safe }} + {% endif %} +
+ {{ empty_message|default:_("Nenhum dado para exibir") }} +
\ No newline at end of file diff --git a/sigi/apps/utils/templates/utils/report/report_pdf.html b/sigi/apps/utils/templates/utils/report/report_pdf.html new file mode 100644 index 0000000..d766e1a --- /dev/null +++ b/sigi/apps/utils/templates/utils/report/report_pdf.html @@ -0,0 +1,20 @@ +{% extends "pdf/base_report.html" %} +{% load static i18n %} + +{% block page_size %}A4 landscape{% endblock %} + +{% block extra_style %} + {{ block.super }} + tr.changed { + border-top: 1px solid var(--body-fg); + } + tr.changed td { + border-top: 1px solid var(--body-fg); + } +{% endblock %} + +{% block report_name %}{{ report_title }}{% endblock report_name %} + +{% block main_content %} + {% include "utils/report/report_items_snippet.html" %} +{% endblock %}