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 4bee83d23e..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,14 +22,23 @@
{% spaceless %}{# for inline blocks #} -

{% formatted_title self %}

+

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

- {{ self.display_date }} + {{ self.display_date }} | + {% if self.file_url %} {{ self.extension }} + {% else %} + {{ self.extension }} + {% endif %} + {% if self.size %} | ({{ self.size }}){% endif %} +
{% endspaceless %}
@@ -31,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 %}
- {{ document.category }} + {{ document.category }}
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