-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Blog] Filtrage des articles sur l’index et ajout d’un bloc "Derniers…
… articles" pour la page d’accueil (#186) * Start adding filtering capacity * Filter blog articles * Progress on filters * Finish creating filters
- Loading branch information
Showing
21 changed files
with
29,710 additions
and
402 deletions.
There are no files selected for viewing
Binary file not shown.
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
47 changes: 47 additions & 0 deletions
47
blog/migrations/0022_blogindexpage_filter_by_author_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,47 @@ | ||
# Generated by Django 5.0.6 on 2024-07-04 10:09 | ||
|
||
import wagtail.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0021_blogentrypage_header_cta_buttons_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="filter_by_author", | ||
field=models.BooleanField(default=False, verbose_name="Filter by author"), | ||
), | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="filter_by_category", | ||
field=models.BooleanField(default=True, verbose_name="Filter by category"), | ||
), | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="filter_by_source", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="The source is the organization of the post author", | ||
verbose_name="Filter by source", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="filter_by_tag", | ||
field=models.BooleanField(default=True, verbose_name="Filter by tag"), | ||
), | ||
migrations.AlterField( | ||
model_name="category", | ||
name="description", | ||
field=wagtail.fields.RichTextField( | ||
blank=True, | ||
help_text="Displayed on the top of the category page", | ||
max_length=500, | ||
verbose_name="Description", | ||
), | ||
), | ||
] |
26 changes: 26 additions & 0 deletions
26
blog/migrations/0023_organization_person_organization_item.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,26 @@ | ||
# Generated by Django 5.0.6 on 2024-07-08 15:15 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0022_blogindexpage_filter_by_author_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Organization", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("name", models.CharField(max_length=255, verbose_name="Name")), | ||
("slug", models.SlugField(max_length=80)), | ||
], | ||
), | ||
migrations.AddField( | ||
model_name="person", | ||
name="organization_item", | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to="blog.organization"), | ||
), | ||
] |
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,26 @@ | ||
# Generated by Django 5.0.6 on 2024-07-08 15:17 | ||
|
||
from django.db import migrations | ||
from django.utils.text import slugify | ||
|
||
|
||
def link_organizations(apps, schema_editor): | ||
Person = apps.get_model("blog", "Person") | ||
Organization = apps.get_model("blog", "Organization") | ||
for person in Person.objects.all(): | ||
if person.organization: | ||
organization, _created = Organization.objects.get_or_create( | ||
name=person.organization, slug=slugify(person.organization) | ||
) | ||
person.organization_item = organization | ||
person.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0023_organization_person_organization_item"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(link_organizations), | ||
] |
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,16 @@ | ||
# Generated by Django 5.0.6 on 2024-07-08 15:52 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0024_transfer_organizations"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="person", | ||
name="organization", | ||
), | ||
] |
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,16 @@ | ||
# Generated by Django 5.0.6 on 2024-07-08 15:57 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0025_remove_person_organization"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="organization", | ||
options={"verbose_name": "Organization"}, | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
blog/migrations/0027_rename_organization_item_person_organization.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,17 @@ | ||
# Generated by Django 5.0.6 on 2024-07-08 16:16 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0026_alter_organization_options"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="person", | ||
old_name="organization_item", | ||
new_name="organization", | ||
), | ||
] |
Oops, something went wrong.