Skip to content

Commit

Permalink
Merge pull request #22 from hotosm/feat/project-pages
Browse files Browse the repository at this point in the history
individual project and individual news pages mostly complete
  • Loading branch information
luminaryFlowers authored May 14, 2024
2 parents e1b8dc9 + 8007891 commit beab81f
Show file tree
Hide file tree
Showing 63 changed files with 1,400 additions and 81 deletions.
Empty file added app/news/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/news/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions app/news/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class NewsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'app.news'
32 changes: 32 additions & 0 deletions app/news/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.2.7 on 2024-05-13 16:49

from django.db import migrations, models
import django.db.models.deletion
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

initial = True

dependencies = [
('wagtailimages', '0025_alter_image_file_alter_rendition_file'),
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
]

operations = [
migrations.CreateModel(
name='IndividualNewsPage',
fields=[
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')),
('intro', wagtail.fields.RichTextField(blank=True)),
('description', wagtail.fields.StreamField([('text_block', wagtail.blocks.RichTextBlock(features=['h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'link', 'document-link', 'image', 'embed', 'code', 'blockquote']))], null=True, use_json_field=True)),
('image', models.ForeignKey(blank=True, help_text='Cover image', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.image')),
],
options={
'abstract': False,
},
bases=('wagtailcore.page',),
),
]
20 changes: 20 additions & 0 deletions app/news/migrations/0002_alter_individualnewspage_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2024-05-13 16:53

from django.db import migrations
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('news', '0001_initial'),
]

operations = [
migrations.AlterField(
model_name='individualnewspage',
name='description',
field=wagtail.fields.StreamField([('text_block', wagtail.blocks.RichTextBlock(features=['h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'link', 'document-link', 'image', 'embed', 'code', 'blockquote']))], blank=True, null=True, use_json_field=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-05-13 16:59

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('news', '0002_alter_individualnewspage_description'),
]

operations = [
migrations.RenameField(
model_name='individualnewspage',
old_name='description',
new_name='article_body',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.2.7 on 2024-05-13 17:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('news', '0003_rename_description_individualnewspage_article_body'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='related_news_title',
field=models.CharField(default='Related News'),
),
migrations.AddField(
model_name='individualnewspage',
name='related_projects_title',
field=models.CharField(default='Related Projects'),
),
migrations.AddField(
model_name='individualnewspage',
name='view_all_news_text',
field=models.CharField(default='View all News'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.7 on 2024-05-13 18:15

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('news', '0004_individualnewspage_related_news_title_and_more'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='categories_title',
field=models.CharField(default='Categories'),
),
migrations.AddField(
model_name='individualnewspage',
name='tags_title',
field=models.CharField(default='Tags'),
),
]
20 changes: 20 additions & 0 deletions app/news/migrations/0006_newscategory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2024-05-13 19:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('news', '0005_individualnewspage_categories_title_and_more'),
]

operations = [
migrations.CreateModel(
name='NewsCategory',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('category_name', models.CharField()),
],
),
]
23 changes: 23 additions & 0 deletions app/news/migrations/0007_alter_newscategory_options_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.7 on 2024-05-13 19:15

from django.db import migrations
import modelcluster.fields


class Migration(migrations.Migration):

dependencies = [
('news', '0006_newscategory'),
]

operations = [
migrations.AlterModelOptions(
name='newscategory',
options={'verbose_name_plural': 'News Categories'},
),
migrations.AddField(
model_name='individualnewspage',
name='categories',
field=modelcluster.fields.ParentalManyToManyField(blank=True, to='news.newscategory'),
),
]
20 changes: 20 additions & 0 deletions app/news/migrations/0008_individualnewspage_related_projects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2024-05-13 19:52

from django.db import migrations
import modelcluster.fields


class Migration(migrations.Migration):

dependencies = [
('projects', '0007_rename_call_to_action_link_individualprojectpage_call_to_action_link_text_and_more'),
('news', '0007_alter_newscategory_options_and_more'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='related_projects',
field=modelcluster.fields.ParentalManyToManyField(to='projects.individualprojectpage'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.7 on 2024-05-13 21:21

from django.db import migrations
import modelcluster.fields


class Migration(migrations.Migration):

dependencies = [
('projects', '0007_rename_call_to_action_link_individualprojectpage_call_to_action_link_text_and_more'),
('news', '0008_individualnewspage_related_projects'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='related_news',
field=modelcluster.fields.ParentalManyToManyField(blank=True, to='news.individualnewspage'),
),
migrations.AlterField(
model_name='individualnewspage',
name='related_projects',
field=modelcluster.fields.ParentalManyToManyField(blank=True, to='projects.individualprojectpage'),
),
]
20 changes: 20 additions & 0 deletions app/news/migrations/0010_individualnewspage_test_thing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2024-05-13 21:51

from django.db import migrations
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('news', '0009_individualnewspage_related_news_and_more'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='test_thing',
field=wagtail.fields.StreamField([('project_page', wagtail.blocks.PageChooserBlock(page_type=['projects.IndividualProjectPage']))], blank=True, null=True, use_json_field=True),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Generated by Django 4.2.7 on 2024-05-13 21:57

from django.db import migrations
import wagtail.blocks
import wagtail.fields


class Migration(migrations.Migration):

dependencies = [
('news', '0010_individualnewspage_test_thing'),
]

operations = [
migrations.RemoveField(
model_name='individualnewspage',
name='test_thing',
),
migrations.RemoveField(
model_name='individualnewspage',
name='related_news',
),
migrations.RemoveField(
model_name='individualnewspage',
name='related_projects',
),
migrations.AddField(
model_name='individualnewspage',
name='related_news',
field=wagtail.fields.StreamField([('news_page', wagtail.blocks.PageChooserBlock(page_type=['news.IndividualNewsPage']))], blank=True, null=True, use_json_field=True),
),
migrations.AddField(
model_name='individualnewspage',
name='related_projects',
field=wagtail.fields.StreamField([('project_page', wagtail.blocks.PageChooserBlock(page_type=['projects.IndividualProjectPage']))], blank=True, null=True, use_json_field=True),
),
]
20 changes: 20 additions & 0 deletions app/news/migrations/0012_individualnewspage_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2024-05-13 22:55

from django.db import migrations, models
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
('news', '0011_remove_individualnewspage_test_thing_and_more'),
]

operations = [
migrations.AddField(
model_name='individualnewspage',
name='date',
field=models.DateField(default=django.utils.timezone.now, verbose_name='Post date'),
preserve_default=False,
),
]
33 changes: 33 additions & 0 deletions app/news/migrations/0013_newstag_individualnewspage_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by Django 4.2.7 on 2024-05-14 16:44

from django.db import migrations, models
import django.db.models.deletion
import modelcluster.contrib.taggit
import modelcluster.fields


class Migration(migrations.Migration):

dependencies = [
('taggit', '0005_auto_20220424_2025'),
('news', '0012_individualnewspage_date'),
]

operations = [
migrations.CreateModel(
name='NewsTag',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content_object', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='news.individualnewspage')),
('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_items', to='taggit.tag')),
],
options={
'abstract': False,
},
),
migrations.AddField(
model_name='individualnewspage',
name='tags',
field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='news.NewsTag', to='taggit.Tag', verbose_name='Tags'),
),
]
Empty file added app/news/migrations/__init__.py
Empty file.
Loading

0 comments on commit beab81f

Please sign in to comment.