Skip to content

Commit 6963c4d

Browse files
authored
Merge pull request #964 from okfn/develop
[Deploy to PRD] Translation, Plugin fixes and cleanup
2 parents cd2250e + 067e711 commit 6963c4d

32 files changed

Lines changed: 273 additions & 51 deletions

File tree

docker-entrypoint.d/delete-orphaned-plugins.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Clean remaining AppHooks left from previous removals.
44
# python3 manage.py cms uninstall apphooks <AppHook> --noinput
55

6+
# Clean CMSPlugin objects that are not attached to a page.
7+
python manage.py cms uninstall plugins FilePlugin LinkPlugin QuotePlugin NetworkGroupFlagsPlugin OEmbedVideoPlugin --noinput
68

79
# This will remove data in cms_cmsplugins table from all non-longer-existing plugins
810
python3 manage.py cms delete-orphaned-plugins --noinput

foundation/okfplugins/article_link/templates/article_link_plugin.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<img src="{% if instance.image %}{{ instance.image.url }}{% endif %}" alt="{{ instance.author }}">
44
</div>
55
<div class="description">
6-
<strong class="block mb-5 text-h3">{{ instance.title }}</strong>
7-
<span class="font-mono text-okfn-sm">{{ instance.author }}</span>
6+
<strong class="block mb-5 text-h3 title">{{ instance.title }}</strong>
7+
<span class="font-mono text-okfn-sm author">{{ instance.author }}</span>
88
</div>
99
</a>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.3 on 2023-08-17 08:38
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("banner", "0002_alter_banner_cmsplugin_ptr"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="banner",
14+
name="banner_type",
15+
field=models.CharField(
16+
choices=[
17+
("warning", "warning"),
18+
("success", "success"),
19+
("error", "error"),
20+
("info", "info"),
21+
],
22+
default="",
23+
max_length=20,
24+
),
25+
),
26+
]

foundation/okfplugins/banner/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from cms.models.pluginmodel import CMSPlugin
33

44
BANNER_CHOICES = (
5-
("warning", ""),
5+
("warning", "warning"),
66
("success", "success"),
77
("error", "error"),
88
("info", "info"),

foundation/okfplugins/banner/templates/banner_plugin.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<div class="banner {{ instance.banner_type }} mb-20">
1+
{% load markdown_deux_tags %}
2+
<div class="banner -{{ instance.banner_type }} mb-20">
23
<div class="banner__content">
34
<div class="container">
45
<div class="col-span-full">
5-
<span class="title">{{ instance.title }}</span> {{ instance.text }}
6+
<span class="title">{{ instance.title }}</span>
7+
{{ instance.text|markdown }}
68
</div>
79
</div>
810
</div>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Generated by Django 4.2.3 on 2023-08-16 06:13
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("feature_block", "0008_alter_featureblock_cmsplugin_ptr"),
9+
]
10+
11+
operations = [
12+
migrations.AlterField(
13+
model_name="featureblock",
14+
name="block_type",
15+
field=models.CharField(
16+
choices=[
17+
("yellow_box", "Yellow Box"),
18+
("white_box", "White Box"),
19+
("transparent_title", "Transparent with Title"),
20+
("transparent", "Transparent"),
21+
("background_rounded", "Rounded corners"),
22+
("blue", "Blue Background"),
23+
("yellow", "Yellow Background"),
24+
("purple", "Purple Background"),
25+
],
26+
default="yellow",
27+
max_length=20,
28+
),
29+
),
30+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generated by Django 4.2.3 on 2023-08-16 09:56
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("feature_block", "0009_alter_featureblock_block_type"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="featureblock",
14+
name="text_color",
15+
field=models.CharField(
16+
choices=[("black", "Black"), ("white", "White")],
17+
default="black",
18+
max_length=10,
19+
),
20+
),
21+
]

foundation/okfplugins/feature_block/models.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44

55
BLOCK_CHOICES = (
6-
("yellow", "Yellow"),
7-
("white", "White"),
6+
("yellow_box", "Yellow Box"),
7+
("white_box", "White Box"),
88
("transparent_title", "Transparent with Title"),
99
("transparent", "Transparent"),
1010
("background_rounded", "Rounded corners"),
@@ -14,6 +14,12 @@
1414
)
1515

1616

17+
TEXT_COLOR_CHOICES = (
18+
("black", "Black"),
19+
("white", "White")
20+
)
21+
22+
1723
class FeatureBlock(CMSPlugin):
1824
title = models.CharField(max_length=200, blank=True)
1925
text = models.CharField(max_length=400, blank=True)
@@ -24,6 +30,9 @@ class FeatureBlock(CMSPlugin):
2430
)
2531
image = models.ImageField(upload_to="feature_block/images", blank=True)
2632
url = models.CharField(max_length=400, blank=True)
33+
text_color = models.CharField(
34+
max_length=10, choices=TEXT_COLOR_CHOICES, default="black"
35+
)
2736

2837
def __str__(self):
2938
return self.title

foundation/okfplugins/feature_block/templates/feature_block_plugin.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% if instance.block_type == 'white'%}
1+
{% if instance.block_type == 'white_box'%}
22
{% if instance.url and instance.url != '' %}
33
<a href="{{ instance.url }}" class="relative block px-4 lg:px-8 pt-5 lg:pt-10 pb-28 border-3 border-black bg-white bg-opacity-30 group">
44
{% else %}
@@ -55,13 +55,13 @@ <h3 class="title block mb-8 font-bold text-2xl">{{ instance.title }}</h3>
5555
</div>
5656
{% endif %}
5757
{% elif instance.block_type == 'background_rounded' %}
58-
<a href="{{ instance.url }}" class="relative flex items-center justify-center p-4 group aspect-square rounded-[2rem] overflow-hidden">
58+
<a href="{{ instance.url }}" class="content-grid__item-rounded relative flex items-center justify-center p-4 group aspect-square rounded-[2rem] overflow-hidden">
5959
<h3 class="relative z-10 title block font-bold text-2xl"> {{ instance.title }} </h3>
6060
<div class="image absolute inset-0 z-0">
6161
<img src="{% if instance.image %}{{ instance.image.url}}{% endif %}" alt="OKFN" class="w-full h-full object-cover">
6262
</div>
6363
</a>
64-
{% elif instance.block_type == 'yellow' %}
64+
{% elif instance.block_type == 'yellow_box' %}
6565
{% if instance.url and instance.url != '' %}
6666
<a href="{{ instance.url }}" class="content-grid__item">
6767
{% else %}
@@ -75,9 +75,9 @@ <h3 class="title block mb-8 font-bold text-2xl">{{ instance.title }}</h3>
7575
{% else %}
7676
</div>
7777
{% endif %}
78-
{% elif instance.block_type == 'blue' or instance.block_type == 'purple' %}
79-
<a href="{{ instance.url }}" class="relative flex items-center justify-center p-4 group aspect-square -has-bg-circle -bg-circle-full {% if instance.block_type != 'blue'%}-bg-circle-okfn-{{ instance.block_type }} {% endif %}}">
80-
<h3 class="relative z-10 title block font-bold text-2xl"> {{ instance.title }} </h3>
78+
{% elif instance.block_type == 'blue' or instance.block_type == 'purple' or instance.block_type == 'yellow'%}
79+
<a href="{{ instance.url }}" class="content-grid__item-background relative flex items-center justify-center p-4 group aspect-square -has-bg-circle -bg-circle-full {% if instance.block_type != 'blue'%}-bg-circle-okfn-{{ instance.block_type }} {% endif %} text-{{ instance.text_color }}">
80+
<h3 class="title relative z-10 title block font-bold text-2xl"> {{ instance.title }} </h3>
8181
</a>
8282
{% else %}
8383
{% if instance.url and instance.url != '' %}

foundation/okfplugins/gallery/cms_plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class GalleryPlugin(CMSPluginBase):
1111
module = "OKF v2"
1212
render_template = "gallery_plugin.html"
1313
allow_children = True
14-
name = _("Gallery")
14+
name = _("Running Gallery")
1515

1616
def render(self, context, instance, placeholder):
1717
context = super().render(context, instance, placeholder)

0 commit comments

Comments
 (0)