diff --git a/shared/models/base.py b/shared/models/base.py index d1ffa6e3997b5aa11e94f9712b9b2764e8a93502..93a977ffffbc80f8b6346687159e347fa5b5bde0 100644 --- a/shared/models/base.py +++ b/shared/models/base.py @@ -693,21 +693,21 @@ class ArticlesMixin: ) if self.get_shared_tags().count() == 0: - return prepared_query.order_by("-union_date") + return prepared_query.order_by("-union_timestamp") return ( prepared_query.union(main_by_values) .union(uniweb_by_values) .union(district_by_values) .union(elections_by_values) - .order_by("-union_date") + .order_by("-union_timestamp") ) else: return ( main_by_values.union(uniweb_by_values) .union(district_by_values) .union(elections_by_values) - .order_by("-union_date") + .order_by("-union_timestamp") ) def materialize_shared_articles_query(self, results): @@ -824,7 +824,7 @@ class ArticlesMixin: lambda unioned: TmpArticle( page_ptr=TmpPrimaryKey(id=unioned["union_page_ptr_id"]), ), - articles.values("union_page_ptr_id", "union_date"), + articles.values("union_page_ptr_id", "union_timestamp"), ) ) diff --git a/shared/models/main.py b/shared/models/main.py index c18e2e8e09b0fc7732b1e0bfdbbec6fa1bec1ca6..94a82f42e27e26aade52db2c445aa6bda2601b72 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -266,7 +266,7 @@ class MainHomePageMixin( context["article_data_list"] = self.materialize_shared_articles_query( self.append_all_shared_articles_query( self.article_page_model.objects.live().all() - ).order_by("-union_date")[:3] + ).order_by("-union_timestamp")[:3] ) return context @@ -447,7 +447,7 @@ class MainArticlesPageMixin( return self.materialize_shared_articles_query( self.append_all_shared_articles_query( self.root_page.article_page_model.objects.filter(filter).live().all() - ).order_by("-union_date") + ).order_by("-union_timestamp") ) def get_article_data_list( @@ -460,12 +460,12 @@ class MainArticlesPageMixin( target_date_list = self.append_all_shared_articles_query( self.root_page.article_page_model.objects.filter(search_filter).live() - ).order_by("-union_date") + ).order_by("-union_timestamp") if not target_date_list: return [] - target_date = target_date_list[0]["union_date"] - relativedelta( + target_date = target_date_list[0]["union_timestamp"] - relativedelta( months=months_back ) first_day_of_target_month = target_date.replace(day=1) @@ -546,7 +546,7 @@ class MainArticlesPageMixin( self.root_page.article_page_model.objects.filter(search_filter) .live() .all() - ).order_by("union_date")[ + ).order_by("union_timestamp")[ :2 ] # LIMIT 2 )[0] @@ -595,7 +595,7 @@ class MainArticlesPageMixin( ) .live() .all() - ).order_by("union_date")[ + ).order_by("union_timestamp")[ :2 ] # LIMIT 2 )[0] diff --git a/shared/templates/styleguide2/includes/organisms/header/article_header.html b/shared/templates/styleguide2/includes/organisms/header/article_header.html index 5b3bb655e08b92a2d4f75c03b42ce1b120e7a429..c04b4706e4c8f36b14335205a1a33d02935f3fab 100644 --- a/shared/templates/styleguide2/includes/organisms/header/article_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/article_header.html @@ -4,4 +4,6 @@ {% include 'styleguide2/includes/atoms/header/navigation.html' with classes='mb-6' first_text=first_nav_text first_link=first_nav_link second_text=second_nav_text second_link=None %} {% endblock %} -{% block heading_classes %}head-8xl{% endblock %} +{% block heading_classes %} + {% if title|length <= 100 %}head-8xl{% else %}head-7xl{% endif %} +{% endblock %} diff --git a/shared/templates/styleguide2/includes/organisms/header/elections/article_header.html b/shared/templates/styleguide2/includes/organisms/header/elections/article_header.html index cae5cc5b3c13df7748a12a8d904ea50e62b6865a..0e8fe325c0626d3031374756ebce425ba9a5dc95 100644 --- a/shared/templates/styleguide2/includes/organisms/header/elections/article_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/elections/article_header.html @@ -4,6 +4,10 @@ {% include 'styleguide2/includes/atoms/header/elections/navigation.html' with classes='mb-6' first_text=first_nav_text first_link=first_nav_link second_text=second_nav_text second_link=None %} {% endblock %} -{% block heading_classes %}!text-black head-8xl{% endblock %} +{% block heading_classes %} + !text-black + + {% if title|length <= 100 %}head-8xl{% else %}head-7xl{% endif %} +{% endblock %} {% block description_classes %}!text-black{% endblock %} diff --git a/shared/templates/styleguide2/includes/organisms/header/elections/simple_header.html b/shared/templates/styleguide2/includes/organisms/header/elections/simple_header.html index 759bc15314e532fcbad84985c4aaa358ab446f4e..ae3a9fc0bb73cdc03b159e026e631e2de5a77ad6 100644 --- a/shared/templates/styleguide2/includes/organisms/header/elections/simple_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/elections/simple_header.html @@ -14,7 +14,7 @@ {% if is_short %}head-short{% endif %} {% if description %} - head-8xl + {% if title|length <= 100 %}head-8xl{% else %}head-7xl{% endif %} {% else %} head-14xl {% endif %} diff --git a/shared/templates/styleguide2/includes/organisms/header/simple_header.html b/shared/templates/styleguide2/includes/organisms/header/simple_header.html index 8ae4f4dc99ef965e97961edb99a66eca4c736bc9..eb9e969e68789cb9db8bcd7adc0ead7a3153e12d 100644 --- a/shared/templates/styleguide2/includes/organisms/header/simple_header.html +++ b/shared/templates/styleguide2/includes/organisms/header/simple_header.html @@ -24,7 +24,7 @@ {% if is_short %}head-short{% endif %} {% if description %} - head-8xl + {% if title|length <= 100 %}head-8xl{% else %}head-7xl{% endif %} {% else %} head-14xl {% endif %}