Skip to content

Commit bdbe24e

Browse files
committed
setting: Add Image Ratio Buttons (981)
1 parent d9ddeb2 commit bdbe24e

File tree

4 files changed

+65
-2
lines changed

4 files changed

+65
-2
lines changed

meinberlin/assets/extra_css/_ckeditor.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,37 @@
258258
.ck-content .text-huge {
259259
font-size: 1.8em;
260260
}
261+
262+
.ck-content::after {
263+
content: "";
264+
display: block;
265+
clear: both;
266+
}
267+
268+
269+
/* Custom Image Aspect Ratio Styles */
270+
271+
/* 4:3 Aspect Ratio Container */
272+
.ck-content figure.image-aspect-ratio-43 {
273+
max-width: 50%;
274+
275+
img {
276+
aspect-ratio: 4/3 !important;
277+
width: 100% !important;
278+
height: 100% !important;
279+
object-fit: cover;
280+
object-position: center;
281+
}
282+
}
283+
284+
/* 2:1 Aspect Ratio Container */
285+
.ck-content figure.image-aspect-ratio-21 {
286+
min-width: 100%;
287+
img {
288+
aspect-ratio: 2/1 !important;
289+
width: 100% !important;
290+
height: 100% !important;
291+
object-fit: cover;
292+
object-position: center;
293+
}
294+
}

meinberlin/config/settings/base.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,26 @@
614614
"imageStyle:inline",
615615
"imageStyle:wrapText",
616616
"imageStyle:breakText",
617+
"imageStyle:side",
617618
"imageStyle:alignLeft",
618619
"imageStyle:alignRight",
620+
"imageAspectRatio43",
621+
"imageAspectRatio21",
619622
],
620623
"insert": {"type": "auto"},
621624
},
625+
"htmlSupport": {
626+
"allow": [
627+
{
628+
"name": "figure",
629+
"classes": [
630+
"image",
631+
"image-aspect-ratio-43",
632+
"image-aspect-ratio-21",
633+
],
634+
}
635+
]
636+
},
622637
"list": {
623638
"properties": {
624639
"styles": "true",
@@ -663,9 +678,23 @@
663678
"imageStyle:breakText",
664679
"imageStyle:alignLeft",
665680
"imageStyle:alignRight",
681+
"imageAspectRatio43",
682+
"imageAspectRatio21",
666683
],
667684
"insert": {"type": "auto"},
668685
},
686+
"htmlSupport": {
687+
"allow": [
688+
{
689+
"name": "figure",
690+
"classes": [
691+
"image",
692+
"image-aspect-ratio-43",
693+
"image-aspect-ratio-21",
694+
],
695+
}
696+
]
697+
},
669698
"list": {
670699
"properties": {
671700
"styles": "true",

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ zeep==4.3.1
2121
celery==5.4.0
2222
django-allauth==0.61.1
2323
django-autoslug==1.9.9
24-
https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.13-liqd/django_ckeditor_5-0.2.13-py3-none-any.whl
24+
https://raw.githubusercontent.com/liqd/django-ckeditor-5/gg_2025_10_picture_upload/dist/django_ckeditor_5-0.2.14-py3-none-any.whl
2525
django-filter==24.3
2626
django-widget-tweaks==1.5.0
2727
Django==4.2.22

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Faker==33.1.0
77
flake8==7.1.1
88
freezegun==1.5.1
99
isort==5.13.2
10-
psycopg[binary]==3.1.18
10+
psycopg[binary]==3.2.3
1111
pytest==8.3.4
1212
pytest-cov==6.0.0
1313
pytest-django==4.9.0

0 commit comments

Comments
 (0)