Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Oct 9, 2024
1 parent 411b5a8 commit a69305c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
8 changes: 7 additions & 1 deletion bedrock/mozorg/templates/mozorg/cms/about/leadership.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@

{% extends "base-protocol-mozilla.html" %}

{% block page_title_full %}{{ page.seo_title }}{% endblock %}
{% if page.seo_title %}
{% set meta_title = page.seo_title %}
{% else %}
{% set meta_title = page.title %}
{% endif %}

{% block page_title_full %}{{ meta_title }}{% endblock %}
{% block page_desc %}{{ page.search_description }}{% endblock %}
{% block body_class %}{{ super() }} about-leadership{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

# Generated by Django 4.2.16 on 2024-10-09 09:53

import uuid

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0093_uploadedfile"),
("products", "0001_initial"),
]

operations = [
migrations.AddField(
model_name="vpncalltoactionsnippet",
name="locale",
field=models.ForeignKey(
default=1, editable=False, on_delete=django.db.models.deletion.PROTECT, related_name="+", to="wagtailcore.locale"
),
preserve_default=False,
),
migrations.AddField(
model_name="vpncalltoactionsnippet",
name="translation_key",
field=models.UUIDField(default=uuid.uuid4, editable=False),
),
migrations.AlterUniqueTogether(
name="vpncalltoactionsnippet",
unique_together={("translation_key", "locale")},
),
]
5 changes: 3 additions & 2 deletions bedrock/products/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
from django.db import models

from wagtail.admin.panels import FieldPanel
from wagtail.models import TranslatableMixin
from wagtail.snippets.models import register_snippet

from bedrock.cms.models.pages import ArticleDetailPageBase, ArticleIndexPageBase
from bedrock.products.views import vpn_available


class VPNCallToActionSnippet(models.Model):
class VPNCallToActionSnippet(TranslatableMixin):
heading = models.CharField(
max_length=255,
)
Expand Down Expand Up @@ -65,7 +66,7 @@ def get_context(self, request, *args, **kwargs):
ARTICLE_GROUP_SIZE = 6
context = super().get_context(request)
vpn_available_in_country = vpn_available(request)
article_data = VPNResourceCenterDetailPage.objects.live().public()
article_data = VPNResourceCenterDetailPage.objects.filter(locale=self.locale).live().public()

first_article_group, second_article_group = (
article_data[:ARTICLE_GROUP_SIZE],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@

{% extends "products/vpn/base.html" %}

{% block page_title_full %}{{ page.seo_title }}{% endblock %}
{% if page.seo_title %}
{% set meta_title = page.seo_title %}
{% else %}
{% set meta_title = page.title %}
{% endif %}

{% block page_title_full %}{{ meta_title }}{% endblock %}
{% block page_desc %}{{ page.search_description }}{% endblock %}

{% block site_header %}
Expand Down

0 comments on commit a69305c

Please sign in to comment.