From e3ab6573f48881115e841bd496461565eb256582 Mon Sep 17 00:00:00 2001 From: John Carroll Date: Wed, 20 Sep 2023 22:40:06 -0400 Subject: [PATCH 1/3] add doc link and metadata to single doc page --- fec/home/templates/home/document_page.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fec/home/templates/home/document_page.html b/fec/home/templates/home/document_page.html index 4bee83d23e..66e95a1969 100644 --- a/fec/home/templates/home/document_page.html +++ b/fec/home/templates/home/document_page.html @@ -18,9 +18,11 @@
{% spaceless %}{# for inline blocks #} -

{% formatted_title self %}

+

{% formatted_title self %}

- {{ self.display_date }} + {{ self.display_date }} | + {{ self.extension }}{% if self.size %} | ({{ self.size }}){% endif %} +
{% endspaceless %}
From 4f0b0271b02ff066c4909763d20623d75b64f6ac Mon Sep 17 00:00:00 2001 From: John Carroll Date: Thu, 21 Sep 2023 00:08:46 -0400 Subject: [PATCH 2/3] link category button to filtered parent --- fec/home/templates/home/document_page.html | 2 +- fec/home/templatetags/filters.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fec/home/templates/home/document_page.html b/fec/home/templates/home/document_page.html index 66e95a1969..185787486f 100644 --- a/fec/home/templates/home/document_page.html +++ b/fec/home/templates/home/document_page.html @@ -13,7 +13,7 @@
diff --git a/fec/home/templatetags/filters.py b/fec/home/templatetags/filters.py index d33ae4f3bf..d94c52f237 100644 --- a/fec/home/templatetags/filters.py +++ b/fec/home/templatetags/filters.py @@ -189,3 +189,10 @@ def get_file_type(value): file_type = "EXCEL" if xl else file_extension return file_type + + +@register.filter(name='cms_query_syntax') +def cms_query_syntax(string): + query = string.replace(' ', '+').lower() + + return query From 93262352ee33df2ee37255f1b435aa8fd756744f Mon Sep 17 00:00:00 2001 From: John Carroll Date: Wed, 27 Sep 2023 21:16:25 -0400 Subject: [PATCH 3/3] meta refresh on document page and filtered button on initial load of reports search --- fec/home/models.py | 5 ++-- fec/home/templates/home/document_page.html | 32 ++++++++++++++++++++-- fec/home/templates/partials/document.html | 2 +- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/fec/home/models.py b/fec/home/models.py index 4c4731d81c..37d54760ba 100644 --- a/fec/home/models.py +++ b/fec/home/models.py @@ -724,7 +724,8 @@ def display_date(self): @property def extension(self): # Return the file extension of file_url - return self.file_url.rsplit('.', 1)[1].upper() + if self.file_url: + return self.file_url.rsplit('.', 1)[1].upper() class DocumentFeedPage(ContentPage): @@ -1372,7 +1373,7 @@ class ReportingDatesTable(Page): ('html', blocks.RawHTMLBlock()), ('internal_button', InternalButtonBlock()), ('external_button', ExternalButtonBlock()), - ('dates_table', ReportingTableBlock(blank=True, required=False,form_classname='title')), + ('dates_table', ReportingTableBlock(blank=True, required=False, form_classname='title')), ], blank=True, null=True, use_json_field=True, collapsed=False) footnotes = StreamField([ diff --git a/fec/home/templates/home/document_page.html b/fec/home/templates/home/document_page.html index 185787486f..22460c0550 100644 --- a/fec/home/templates/home/document_page.html +++ b/fec/home/templates/home/document_page.html @@ -4,8 +4,17 @@ {% load static %} {% block body_class %}template-{{ self.get_verbose_name | slugify }}{% endblock %} + + {% block content %} + + + + + {% include 'partials/breadcrumbs.html' with page=self links=self.get_ancestors style='secondary' %}
@@ -13,15 +22,22 @@
{% spaceless %}{# for inline blocks #} -

{% formatted_title self %}

+

{% if self.file_url %}{% formatted_title self %} + {% else %} + {% formatted_title self %} + {% endif %}

{{ self.display_date }} | - {{ self.extension }}{% if self.size %} | ({{ self.size }}){% endif %} + {% if self.file_url %} {{ self.extension }} + {% else %} + {{ self.extension }} + {% endif %} + {% if self.size %} | ({{ self.size }}){% endif %}
{% endspaceless %} @@ -33,5 +49,15 @@

{% formatted_title self

{% include 'partials/disclaimer.html' %} + {% endblock %} diff --git a/fec/home/templates/partials/document.html b/fec/home/templates/partials/document.html index 5ea04da494..39f50d600b 100644 --- a/fec/home/templates/partials/document.html +++ b/fec/home/templates/partials/document.html @@ -29,6 +29,6 @@

{% endif %}