diff --git a/README.md b/README.md index e69fd7881..04d206729 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ docker compose -f docker-compose.dev.yml build Start the containers in detached mode. This will run migrations and run the Django server. Using in detached (`-d`) mode means that the containers will continue to run in the background - ommitting the `-d` flag will mean that the containers will run only until the command is exited. ``` -docker compose -f docker-compose.dev.yml up -d +COMPRESS_ENABLED=1 docker compose -f docker-compose.dev.yml up -d ``` See the status of your containers by using diff --git a/home/templates/home/home_page.html b/home/templates/home/home_page.html index 872c1a878..554d24569 100644 --- a/home/templates/home/home_page.html +++ b/home/templates/home/home_page.html @@ -9,10 +9,10 @@ {% endblock %} {% block content %} - {% include 'home/modules/statistics.html' %} {% include 'home/modules/getting-started.html' %} - {% include 'home/modules/about-iati.html' %} + {% include 'home/modules/statistics.html' %} {% include 'home/modules/iati-in-action.html' %} + {% include 'home/modules/about-iati.html' %} {% include 'home/modules/iati-tools.html' %} {% include 'home/modules/flexible-features.html' %} {% include 'home/modules/news-tweets.html' with notalt=page.flexible_features|length|divisibleby:2 %} diff --git a/home/templates/home/modules/about-iati.html b/home/templates/home/modules/about-iati.html index dfbd83912..1bc42596e 100644 --- a/home/templates/home/modules/about-iati.html +++ b/home/templates/home/modules/about-iati.html @@ -1,7 +1,7 @@ {% load iati_tags %} -
-
+
+

{{ page.about_iati_title }}

{% if page.about_iati_video %}
diff --git a/home/templates/home/modules/flexible-features.html b/home/templates/home/modules/flexible-features.html index 368e05cd8..cd7d59c38 100644 --- a/home/templates/home/modules/flexible-features.html +++ b/home/templates/home/modules/flexible-features.html @@ -1,7 +1,7 @@ {% load wagtailcore_tags responsive %} {% for child in page.flexible_features %} -
+

{{ child.value.title }}

{% if child.value.image %} diff --git a/home/templates/home/modules/getting-started.html b/home/templates/home/modules/getting-started.html index 16671deee..e418ae4e5 100644 --- a/home/templates/home/modules/getting-started.html +++ b/home/templates/home/modules/getting-started.html @@ -1,6 +1,6 @@ {% load responsive %} -
+

{{ page.getting_started_title }}

diff --git a/home/templates/home/modules/iati-in-action.html b/home/templates/home/modules/iati-in-action.html index 01380f951..77cf45a67 100644 --- a/home/templates/home/modules/iati-in-action.html +++ b/home/templates/home/modules/iati-in-action.html @@ -1,6 +1,6 @@ {% load responsive %} -
+

{{ page.iati_in_action_title }}

{% if page.iati_in_action_description %} diff --git a/home/templates/home/modules/iati-tools.html b/home/templates/home/modules/iati-tools.html index b964e0dee..5d379bd1b 100644 --- a/home/templates/home/modules/iati-tools.html +++ b/home/templates/home/modules/iati-tools.html @@ -1,7 +1,7 @@ {% load responsive i18n tool_utils %} -
-
+
+

{{ page.iati_tools_title }}

{% if page.iati_tools_description %}
diff --git a/home/templates/home/modules/news-tweets.html b/home/templates/home/modules/news-tweets.html index c0d5c3b47..9447d3aa5 100644 --- a/home/templates/home/modules/news-tweets.html +++ b/home/templates/home/modules/news-tweets.html @@ -3,8 +3,6 @@

{{ page.latest_news_title }}

-
-
{% for item in page.news %}
{% endfor %} {{ page.latest_news_link_label }} -
-
diff --git a/home/templates/home/modules/statistics.html b/home/templates/home/modules/statistics.html index 6bb9dc89e..bdc25a5dd 100644 --- a/home/templates/home/modules/statistics.html +++ b/home/templates/home/modules/statistics.html @@ -1,5 +1,6 @@ {% load static responsive iati_tags %} +
{% if page.testimonial %} @@ -30,3 +31,4 @@

+
diff --git a/iati/settings/base.py b/iati/settings/base.py index ce1e4af3f..6af99fd2e 100644 --- a/iati/settings/base.py +++ b/iati/settings/base.py @@ -653,3 +653,5 @@ } COMPRESS_OFFLINE = True + +IATI_STANDARD_LATEST_VERSION = "2.03" diff --git a/iati/templates/base.html b/iati/templates/base.html index c93ab15b2..05b8bcffd 100644 --- a/iati/templates/base.html +++ b/iati/templates/base.html @@ -39,6 +39,9 @@ {% block extra_css %} {# Override this in templates to add extra stylesheets #} {% endblock %} + + {% block html_header_seo %} + {% endblock %} diff --git a/iati_standard/models.py b/iati_standard/models.py index 1d13e9c0d..b2213af1d 100644 --- a/iati_standard/models.py +++ b/iati_standard/models.py @@ -1,10 +1,12 @@ """Model definitions for the iati_standard app.""" import os +import re from bs4 import BeautifulSoup from datetime import datetime from django import forms +from django.conf import settings from django.db.models import JSONField from django.db import models from django.utils.functional import cached_property @@ -397,10 +399,35 @@ def save(self, *args, **kwargs): class ActivityStandardPage(AbstractGithubPage): - """A model for the Activity Standard Page, an IATI reference page.""" + """A model for the Activity Standard Page, an IATI reference page. + + Used for Standard reference pages like /en/iati-standard/202/ + And guidance developer pages like /en/guidance/developer/ + """ template = 'iati_standard/activity_standard_page.html' + def is_older_version_of_standard(self): + """Is it an older version of the standard? Return Boolean.""" + url = self.get_url() + if re.match(r"^\/\w+\/iati-standard\/\d", url): + regex = r"^\/\w+\/iati-standard\/" + settings.IATI_STANDARD_LATEST_VERSION.replace(".", "") + r"\/" + if not re.match(regex, url): + return True + return False + + def get_sitemap_urls(self, request=None): + """If it's an older version of the standard, we don't want it indexed.""" + if self.is_older_version_of_standard(): + return [] + else: + return [ + { + 'location': self.get_full_url(request), + 'lastmod': (self.last_published_at or self.latest_revision_created_at), + } + ] + class StandardGuidancePage(AbstractGithubPage): """A model for the Standard Guidance Page, an IATI reference page.""" diff --git a/iati_standard/templates/iati_standard/activity_standard_page.html b/iati_standard/templates/iati_standard/activity_standard_page.html index cd293fd6f..0e97a1eb2 100644 --- a/iati_standard/templates/iati_standard/activity_standard_page.html +++ b/iati_standard/templates/iati_standard/activity_standard_page.html @@ -23,6 +23,10 @@ {% endblock %} +{% block html_header_seo %} +{% if page.is_older_version_of_standard %}{% endif %} +{% endblock %} + {% block content %} {% get_current_language as LANGUAGE_CODE %}
diff --git a/patterns/assets/css/modules/_stats.scss b/patterns/assets/css/modules/_stats.scss index 99c589e99..e2b75a514 100644 --- a/patterns/assets/css/modules/_stats.scss +++ b/patterns/assets/css/modules/_stats.scss @@ -8,7 +8,6 @@ } .stat { - background-color: #fff; box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.1); .stats--grid & { border-left: 3px solid $iati-ocean;