Skip to content

Commit

Permalink
Merge pull request #793 from IATI/develop
Browse files Browse the repository at this point in the history
Merge develop into main
  • Loading branch information
odscjames authored Nov 13, 2024
2 parents 8ce2f68 + 0aec3cc commit f7bf0a2
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions home/templates/home/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
4 changes: 2 additions & 2 deletions home/templates/home/modules/about-iati.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load iati_tags %}

<div class="row">
<div class="section-alt-top section-alt-bottom">
<div class="section">
<div class="row">
<h2 class="section__heading">{{ page.about_iati_title }}</h2>
{% if page.about_iati_video %}
<div class="l-2up">
Expand Down
2 changes: 1 addition & 1 deletion home/templates/home/modules/flexible-features.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load wagtailcore_tags responsive %}

{% for child in page.flexible_features %}
<div class="{% cycle 'section' 'section-alt' %}">
<div class="{% cycle 'section' 'section-alt section-alt-top' %}">
<div class="row">
<h2 class="section__heading">{{ child.value.title }}</h2>
{% if child.value.image %}
Expand Down
2 changes: 1 addition & 1 deletion home/templates/home/modules/getting-started.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load responsive %}

<div class="section">
<div class="section-alt">
<div class="row">
<h2 class="section__heading">{{ page.getting_started_title }}</h2>
<div class="l-3up">
Expand Down
2 changes: 1 addition & 1 deletion home/templates/home/modules/iati-in-action.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load responsive %}

<div class="section section-alt-bottom">
<div class="section-alt section-alt-top section-alt-bottom">
<div class="row">
<h2 class="section__heading">{{ page.iati_in_action_title }}</h2>
{% if page.iati_in_action_description %}
Expand Down
4 changes: 2 additions & 2 deletions home/templates/home/modules/iati-tools.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load responsive i18n tool_utils %}

<div class="row">
<div class="section-alt">
<div class="section-alt section-alt-top">
<div class="row">
<h2 class="section__heading">{{ page.iati_tools_title }}</h2>
{% if page.iati_tools_description %}
<div class="max-meter is-typeset is-typeset--article">
Expand Down
7 changes: 0 additions & 7 deletions home/templates/home/modules/news-tweets.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
<div {% if not notalt %}class="section-alt-top section-alt-bottom"{% else %}class="section"{% endif %}>
<div class="row">
<h2 class="section__heading">{{ page.latest_news_title }}</h2>
<div class="l-2up">
<div class="l-2up__col">
{% for item in page.news %}
<article class="listing listing--article listing--article--minor">
<aside class="listing__aside">
Expand All @@ -31,11 +29,6 @@ <h3 class="listing__heading">{{ item.heading }}</h3>
</article>
{% endfor %}
<a href="{{ page.news_index.url }}" class="button">{{ page.latest_news_link_label }}</a>
</div>
<div class="l-2up__col">
<a class="twitter-timeline" data-height="800" href="https://twitter.com/{{ global.twitter_handle }}?ref_src=twsrc%5Etfw">{{ page.latest_news_tweets_title }} {% trans "by" %} {{ global.twitter_handle }}</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions home/templates/home/modules/statistics.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% load static responsive iati_tags %}

<div class="section">
<div class="row">
<div class="stats stats--standout">
{% if page.testimonial %}
Expand Down Expand Up @@ -30,3 +31,4 @@ <h2 class="stat__heading stat__heading--large" id="stat-publishers" data-inc-dur
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions iati/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,5 @@
}

COMPRESS_OFFLINE = True

IATI_STANDARD_LATEST_VERSION = "2.03"
3 changes: 3 additions & 0 deletions iati/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
{% block extra_css %}
{# Override this in templates to add extra stylesheets #}
{% endblock %}

{% block html_header_seo %}
{% endblock %}
</head>

<body class="body--message {% block body_class %}{% endblock %}" id="{% block body_id %}{% endblock %}">
Expand Down
29 changes: 28 additions & 1 deletion iati_standard/models.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
</style>
{% endblock %}

{% block html_header_seo %}
{% if page.is_older_version_of_standard %}<meta name="robots" content="noindex, nofollow">{% endif %}
{% endblock %}

{% block content %}
{% get_current_language as LANGUAGE_CODE %}
<div class="hero hero--minor">
Expand Down
1 change: 0 additions & 1 deletion patterns/assets/css/modules/_stats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7bf0a2

Please sign in to comment.