richie 2.30.1.dev21__py2.py3-none-any.whl → 2.30.1.dev23__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of richie might be problematic. Click here for more details.
- frontend/scss/colors/_theme.scss +4 -0
- frontend/scss/components/_index.scss +1 -0
- frontend/scss/components/templates/richie/simpletext/_simpletext.scss +43 -0
- richie/apps/courses/settings/__init__.py +2 -1
- richie/plugins/simple_text_ckeditor/cms_plugins.py +1 -1
- richie/plugins/simple_text_ckeditor/defaults.py +12 -0
- richie/plugins/simple_text_ckeditor/forms.py +1 -1
- richie/plugins/simple_text_ckeditor/migrations/0002_add_variant_and_cmsplugin_ptr.py +42 -0
- richie/plugins/simple_text_ckeditor/models.py +10 -0
- richie/plugins/simple_text_ckeditor/templates/richie/simple_text_ckeditor/simple_text.html +2 -0
- richie/static/richie/css/main.css +1 -1
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/METADATA +3 -3
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/RECORD +17 -15
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/LICENSE +0 -0
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/WHEEL +0 -0
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/top_level.txt +0 -0
- {richie-2.30.1.dev21.dist-info → richie-2.30.1.dev23.dist-info}/zip-safe +0 -0
frontend/scss/colors/_theme.scss
CHANGED
|
@@ -147,6 +147,10 @@ $r-theme: (
|
|
|
147
147
|
content-color: r-color('slate-grey'),
|
|
148
148
|
description-color: r-color('slate-grey'),
|
|
149
149
|
),
|
|
150
|
+
simpletext-variant-box: (
|
|
151
|
+
primary-color: r-color('denim'),
|
|
152
|
+
secondary-color: r-color('white'),
|
|
153
|
+
),
|
|
150
154
|
blogpost-glimpse: (
|
|
151
155
|
card-background: r-color('white'),
|
|
152
156
|
title-color: r-color('black'),
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
@import './templates/courses/plugins/category_plugin';
|
|
61
61
|
@import './templates/courses/plugins/licence_plugin';
|
|
62
|
+
@import './templates/richie/simpletext/simpletext';
|
|
62
63
|
@import './templates/richie/section/section';
|
|
63
64
|
@import './templates/richie/large_banner/large_banner';
|
|
64
65
|
@import './templates/richie/large_banner/compacted_banner';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// CKEditor 'simple text' plugin
|
|
2
|
+
//
|
|
3
|
+
// This aims to only adjust every possible plugins so they correctly fit since they
|
|
4
|
+
// were done for 100% size only. No colour, font or anything else should be changed
|
|
5
|
+
// here.
|
|
6
|
+
//
|
|
7
|
+
$r-simpletext-margin-bottom: 0.5rem !default;
|
|
8
|
+
$r-simpletext-variant-padding: 1rem !default;
|
|
9
|
+
$r-simpletext-variant-radius: 0.75rem !default;
|
|
10
|
+
|
|
11
|
+
.simple-text {
|
|
12
|
+
margin-bottom: $r-simpletext-margin-bottom;
|
|
13
|
+
|
|
14
|
+
& > *:last-child {
|
|
15
|
+
margin-bottom: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&__variant-round-box {
|
|
19
|
+
padding: $r-simpletext-variant-padding;
|
|
20
|
+
border: 1px solid transparent;
|
|
21
|
+
border-radius: $r-simpletext-variant-radius;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__variant-stroked {
|
|
25
|
+
border-color: r-theme-val(simpletext-variant-box, primary-color);
|
|
26
|
+
background: r-theme-val(simpletext-variant-box, secondary-color);
|
|
27
|
+
|
|
28
|
+
h1,
|
|
29
|
+
h2,
|
|
30
|
+
h3,
|
|
31
|
+
h4,
|
|
32
|
+
h5,
|
|
33
|
+
h6 {
|
|
34
|
+
color: r-theme-val(simpletext-variant-box, primary-color);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__variant-fulfilled {
|
|
39
|
+
color: r-theme-val(simpletext-variant-box, secondary-color);
|
|
40
|
+
border-color: r-theme-val(simpletext-variant-box, primary-color);
|
|
41
|
+
background: r-theme-val(simpletext-variant-box, primary-color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -32,7 +32,7 @@ def richie_placeholder_conf(name):
|
|
|
32
32
|
"""
|
|
33
33
|
return {
|
|
34
34
|
"name": name,
|
|
35
|
-
"excluded_plugins": ["
|
|
35
|
+
"excluded_plugins": ["GoogleMapPlugin"],
|
|
36
36
|
"parent_classes": {
|
|
37
37
|
"BlogPostPlugin": ["SectionPlugin"],
|
|
38
38
|
"CategoryPlugin": ["SectionPlugin"],
|
|
@@ -55,6 +55,7 @@ def richie_placeholder_conf(name):
|
|
|
55
55
|
"OrganizationPlugin",
|
|
56
56
|
"PersonPlugin",
|
|
57
57
|
"ProgramPlugin",
|
|
58
|
+
"CKEditorPlugin",
|
|
58
59
|
],
|
|
59
60
|
"NestedItemPlugin": ["NestedItemPlugin", "LinkPlugin"],
|
|
60
61
|
},
|
|
@@ -32,7 +32,7 @@ class CKEditorPlugin(CMSPluginBase):
|
|
|
32
32
|
name = _("Simple text")
|
|
33
33
|
render_template = "richie/simple_text_ckeditor/simple_text.html"
|
|
34
34
|
|
|
35
|
-
fieldsets = ((None, {"fields": ["body"]}),)
|
|
35
|
+
fieldsets = ((None, {"fields": ["body", "variant"]}),)
|
|
36
36
|
|
|
37
37
|
def get_form(self, request, obj=None, change=False, **kwargs):
|
|
38
38
|
"""
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
"""Default settings for Richie's simple text plugin."""
|
|
2
2
|
|
|
3
3
|
from django.conf import settings
|
|
4
|
+
from django.utils.translation import gettext_lazy as _
|
|
4
5
|
|
|
5
6
|
SIMPLETEXT_CONFIGURATION = getattr(settings, "RICHIE_SIMPLETEXT_CONFIGURATION", [])
|
|
7
|
+
|
|
8
|
+
SIMPLETEXT_VARIANTS = getattr(
|
|
9
|
+
settings,
|
|
10
|
+
"RICHIE_SIMPLETEXT_VARIANTS",
|
|
11
|
+
[
|
|
12
|
+
("", _("None")),
|
|
13
|
+
("round-box", _("Transparent box")),
|
|
14
|
+
("fulfilled", _("Fulfilled box")),
|
|
15
|
+
("stroked", _("Stroked box")),
|
|
16
|
+
],
|
|
17
|
+
)
|
|
@@ -25,7 +25,7 @@ class CKEditorPluginForm(forms.ModelForm):
|
|
|
25
25
|
|
|
26
26
|
model = SimpleText
|
|
27
27
|
widgets = {"body": TextEditorWidget}
|
|
28
|
-
fields = ["body"]
|
|
28
|
+
fields = ["body", "variant"]
|
|
29
29
|
|
|
30
30
|
def clean_body(self):
|
|
31
31
|
"""Normalize and unescape the text submitted by CKEditor then remove useless spaces."""
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated by Django 4.2.16 on 2024-11-13 00:09
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
from ..defaults import SIMPLETEXT_VARIANTS
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Migration(migrations.Migration):
|
|
10
|
+
|
|
11
|
+
dependencies = [
|
|
12
|
+
("cms", "0022_auto_20180620_1551"),
|
|
13
|
+
("simple_text_ckeditor", "0001_initial"),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
operations = [
|
|
17
|
+
migrations.AddField(
|
|
18
|
+
model_name="simpletext",
|
|
19
|
+
name="variant",
|
|
20
|
+
field=models.CharField(
|
|
21
|
+
blank=True,
|
|
22
|
+
choices=SIMPLETEXT_VARIANTS,
|
|
23
|
+
default="",
|
|
24
|
+
help_text="Enable a themed box to enclose content.",
|
|
25
|
+
max_length=50,
|
|
26
|
+
verbose_name="Box variant",
|
|
27
|
+
),
|
|
28
|
+
),
|
|
29
|
+
migrations.AlterField(
|
|
30
|
+
model_name="simpletext",
|
|
31
|
+
name="cmsplugin_ptr",
|
|
32
|
+
field=models.OneToOneField(
|
|
33
|
+
auto_created=True,
|
|
34
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
35
|
+
parent_link=True,
|
|
36
|
+
primary_key=True,
|
|
37
|
+
related_name="%(app_label)s_%(class)s",
|
|
38
|
+
serialize=False,
|
|
39
|
+
to="cms.cmsplugin",
|
|
40
|
+
),
|
|
41
|
+
),
|
|
42
|
+
]
|
|
@@ -11,6 +11,8 @@ from django.utils.translation import gettext_lazy as _
|
|
|
11
11
|
from cms.models.pluginmodel import CMSPlugin
|
|
12
12
|
from djangocms_text_ckeditor.html import clean_html
|
|
13
13
|
|
|
14
|
+
from .defaults import SIMPLETEXT_VARIANTS
|
|
15
|
+
|
|
14
16
|
|
|
15
17
|
class SimpleText(CMSPlugin):
|
|
16
18
|
"""
|
|
@@ -21,6 +23,14 @@ class SimpleText(CMSPlugin):
|
|
|
21
23
|
"""
|
|
22
24
|
|
|
23
25
|
body = models.TextField(_("body"))
|
|
26
|
+
variant = models.CharField(
|
|
27
|
+
_("Box variant"),
|
|
28
|
+
max_length=50,
|
|
29
|
+
blank=True,
|
|
30
|
+
choices=SIMPLETEXT_VARIANTS,
|
|
31
|
+
default="",
|
|
32
|
+
help_text=_("Enable a themed box to enclose content."),
|
|
33
|
+
)
|
|
24
34
|
|
|
25
35
|
def __str__(self):
|
|
26
36
|
return Truncator(strip_tags(self.body)).words(6, truncate="...")
|