-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1316] Added banner title and desciption, split off banner image and…
… texts
- Loading branch information
Showing
9 changed files
with
185 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
src/open_inwoner/cms/banner/migrations/0003_auto_20230509_1038.py
This file was deleted.
Oops, something went wrong.
117 changes: 117 additions & 0 deletions
117
src/open_inwoner/cms/banner/migrations/0003_auto_20230510_1355.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Generated by Django 3.2.15 on 2023-05-10 11:55 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import filer.fields.image | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cms", "0022_auto_20180620_1551"), | ||
migrations.swappable_dependency(settings.FILER_IMAGE_MODEL), | ||
("banner", "0002_banner_image_height"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="BannerImage", | ||
fields=[ | ||
( | ||
"cmsplugin_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="banner_bannerimage", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
help_text="The name of the image (this will not be shown on the page)", | ||
max_length=250, | ||
verbose_name="Name", | ||
), | ||
), | ||
( | ||
"image_height", | ||
models.PositiveIntegerField( | ||
blank=True, | ||
help_text='The image custom height as number in pixels. Example: "720" and not "720px".Leave this field empty if you want the original height of the image to be applied.', | ||
null=True, | ||
verbose_name="Custom image height", | ||
), | ||
), | ||
( | ||
"image", | ||
filer.fields.image.FilerImageField( | ||
blank=True, | ||
help_text="Banner image", | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to=settings.FILER_IMAGE_MODEL, | ||
verbose_name="Banner image", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=("cms.cmsplugin",), | ||
), | ||
migrations.CreateModel( | ||
name="BannerText", | ||
fields=[ | ||
( | ||
"cmsplugin_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="banner_bannertext", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
( | ||
"name", | ||
models.CharField( | ||
help_text="The name of the text block (this will not be shown on the page)", | ||
max_length=250, | ||
verbose_name="Name", | ||
), | ||
), | ||
( | ||
"title", | ||
models.CharField( | ||
blank=True, | ||
help_text="The title of the text block", | ||
max_length=250, | ||
null=True, | ||
verbose_name="Title", | ||
), | ||
), | ||
( | ||
"description", | ||
models.TextField( | ||
blank=True, | ||
help_text="The description of the text block", | ||
null=True, | ||
verbose_name="Description", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=("cms.cmsplugin",), | ||
), | ||
migrations.DeleteModel( | ||
name="Banner", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...r/templates/cms/banner/banner_plugin.html → ...lates/cms/banner/banner_image_plugin.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/open_inwoner/templates/cms/banner/banner_text_plugin.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% if instance.title %} | ||
<h1 class="h1">{{ instance.title }} {{ request.user.get_full_name }}</h1> | ||
{% endif %} | ||
{% if instance.description %} | ||
<p class="p">{{ instance.description|linebreaksbr }}</p> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters