-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ redesign newsletter archive, allow limits + filtering in plugin
- Loading branch information
Showing
6 changed files
with
171 additions
and
20 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
104 changes: 104 additions & 0 deletions
104
fragdenstaat_de/fds_mailing/migrations/0014_remove_emailtemplate_email_body_and_more.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,104 @@ | ||
# Generated by Django 4.2.4 on 2024-04-25 11:19 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cms", "0035_auto_20230822_2208"), | ||
("fds_newsletter", "0003_newsletter_description"), | ||
("fds_mailing", "0001_squashed_0013_auto_20210526_2232"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="emailtemplate", | ||
name="email_body", | ||
), | ||
migrations.AlterField( | ||
model_name="emailactioncmsplugin", | ||
name="cmsplugin_ptr", | ||
field=models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="emailheadercmsplugin", | ||
name="cmsplugin_ptr", | ||
field=models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="emailsectioncmsplugin", | ||
name="cmsplugin_ptr", | ||
field=models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="emailstorycmsplugin", | ||
name="cmsplugin_ptr", | ||
field=models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="NewsletterArchiveCMSPlugin", | ||
fields=[ | ||
( | ||
"cmsplugin_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
( | ||
"number_of_mailings", | ||
models.PositiveIntegerField( | ||
default=6, | ||
help_text="0 means all the mailings. Should be devisible by 3.", | ||
verbose_name="number of mailing", | ||
), | ||
), | ||
( | ||
"newsletter", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="fds_newsletter.newsletter", | ||
), | ||
), | ||
], | ||
bases=("cms.cmsplugin",), | ||
), | ||
] |
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
20 changes: 11 additions & 9 deletions
20
fragdenstaat_de/fds_mailing/templates/fds_mailing/plugins/archive.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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
<div class="list-group mt-3 mb-3"> | ||
{% load i18n %} | ||
<ul class="row list-unstyled row-gap-2"> | ||
{% for mailing in latest %} | ||
<a class="list-group-item list-group-item-action" | ||
href="{% url 'newsletter_archive_detail' newsletter_slug=newsletter.slug year=mailing.sending_date.year month=mailing.sending_date.month day=mailing.sending_date.day pk=mailing.pk %}"> | ||
<div class="d-flex w-100 justify-content-between"> | ||
<h5 class="mb-1">{{ mailing.email_template.subject }}</h5> | ||
<small class="text-body-secondary">{{ mailing.sending_date|date:"DATE_FORMAT" }}</small> | ||
</div> | ||
</a> | ||
<li class="col-12 col-md-6 col-lg-4 px-1 d-flex"> | ||
<article class="box-card position-relative border-gray p-3 text-bg-body"> | ||
<h3 class="h5">{{ mailing.email_template.subject }}</h3> | ||
<p class="text-body-secondary">{{ mailing.sending_date|date:"DATE_FORMAT" }}</p> | ||
<a class="stretched-link mt-auto" | ||
href="{% url 'newsletter_archive_detail' newsletter_slug=mailing.newsletter.slug year=mailing.sending_date.year month=mailing.sending_date.month day=mailing.sending_date.day pk=mailing.pk %}">→ {% trans "Read more" %}</a> | ||
</article> | ||
</li> | ||
{% endfor %} | ||
</div> | ||
</ul> |
34 changes: 34 additions & 0 deletions
34
...aat_de/fds_newsletter/migrations/0004_alter_newslettercmsplugin_cmsplugin_ptr_and_more.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,34 @@ | ||
# Generated by Django 4.2.4 on 2024-04-25 11:19 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("cms", "0035_auto_20230822_2208"), | ||
("fds_newsletter", "0003_newsletter_description"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="newslettercmsplugin", | ||
name="cmsplugin_ptr", | ||
field=models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
related_name="%(app_label)s_%(class)s", | ||
serialize=False, | ||
to="cms.cmsplugin", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="subscribertag", | ||
name="slug", | ||
field=models.SlugField( | ||
allow_unicode=True, max_length=100, unique=True, verbose_name="slug" | ||
), | ||
), | ||
] |
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