From 618f56ad3344e3e9910f18952c07151861f41e72 Mon Sep 17 00:00:00 2001 From: Todd Dembrey <todd.dembrey@torchbox.com> Date: Wed, 10 Jan 2018 15:20:31 +0000 Subject: [PATCH] Update the public funds to the new folder structure --- opentech/public/funds/__init__.py | 1 + opentech/{publicpages => public/funds}/admin.py | 0 opentech/public/funds/apps.py | 6 ++++++ opentech/{publicpages => public/funds}/blocks.py | 6 +++--- .../funds}/migrations/0001_initial.py | 2 +- .../{publicpages => public/funds/migrations}/__init__.py | 0 opentech/{publicpages => public/funds}/models.py | 4 ++-- .../funds/templates/funds}/blocks/related_projects.html | 0 .../funds/templates/funds}/blocks/related_reviewers.html | 0 .../funds/templates/funds}/fund_index.html | 0 .../funds/templates/funds}/fund_page.html | 0 .../funds/templates/funds}/includes/fund_apply_cta.html | 0 .../funds/templates/funds}/includes/project_listing.html | 0 opentech/{publicpages => public/funds}/tests.py | 0 opentech/{publicpages => public/funds}/views.py | 0 opentech/publicpages/apps.py | 5 ----- opentech/publicpages/migrations/__init__.py | 0 opentech/settings/base.py | 2 +- 18 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 opentech/public/funds/__init__.py rename opentech/{publicpages => public/funds}/admin.py (100%) create mode 100644 opentech/public/funds/apps.py rename opentech/{publicpages => public/funds}/blocks.py (69%) rename opentech/{publicpages => public/funds}/migrations/0001_initial.py (97%) rename opentech/{publicpages => public/funds/migrations}/__init__.py (100%) rename opentech/{publicpages => public/funds}/models.py (93%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/blocks/related_projects.html (100%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/blocks/related_reviewers.html (100%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/fund_index.html (100%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/fund_page.html (100%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/includes/fund_apply_cta.html (100%) rename opentech/{publicpages/templates/publicpages => public/funds/templates/funds}/includes/project_listing.html (100%) rename opentech/{publicpages => public/funds}/tests.py (100%) rename opentech/{publicpages => public/funds}/views.py (100%) delete mode 100644 opentech/publicpages/apps.py delete mode 100644 opentech/publicpages/migrations/__init__.py diff --git a/opentech/public/funds/__init__.py b/opentech/public/funds/__init__.py new file mode 100644 index 000000000..2d9aa6a15 --- /dev/null +++ b/opentech/public/funds/__init__.py @@ -0,0 +1 @@ +default_app_config = 'opentech.public.funds.apps.FundsConfig' diff --git a/opentech/publicpages/admin.py b/opentech/public/funds/admin.py similarity index 100% rename from opentech/publicpages/admin.py rename to opentech/public/funds/admin.py diff --git a/opentech/public/funds/apps.py b/opentech/public/funds/apps.py new file mode 100644 index 000000000..5c980bcdf --- /dev/null +++ b/opentech/public/funds/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class FundsConfig(AppConfig): + name = 'opentech.public.funds' + label = 'public_funds' diff --git a/opentech/publicpages/blocks.py b/opentech/public/funds/blocks.py similarity index 69% rename from opentech/publicpages/blocks.py rename to opentech/public/funds/blocks.py index 556a0090c..65dbea765 100644 --- a/opentech/publicpages/blocks.py +++ b/opentech/public/funds/blocks.py @@ -1,20 +1,20 @@ from wagtail.wagtailcore.blocks import StaticBlock -from opentech.utils.blocks import StoryBlock +from opentech.public.utils.blocks import StoryBlock class ProjectsBlock(StaticBlock): class Meta: icon = 'grip' label = 'List of Projects funded' - template = 'publicpages/blocks/related_projects.html' + template = 'funds/blocks/related_projects.html' class ReviewersBlock(StaticBlock): class Meta: icon = 'grip' label = 'List of fund Reviewers' - template = 'publicpages/blocks/related_reviewers.html' + template = 'funds/blocks/related_reviewers.html' class FundBlock(StoryBlock): diff --git a/opentech/publicpages/migrations/0001_initial.py b/opentech/public/funds/migrations/0001_initial.py similarity index 97% rename from opentech/publicpages/migrations/0001_initial.py rename to opentech/public/funds/migrations/0001_initial.py index b63054064..5cab88a42 100644 --- a/opentech/publicpages/migrations/0001_initial.py +++ b/opentech/public/funds/migrations/0001_initial.py @@ -47,7 +47,7 @@ class Migration(migrations.Migration): ('listing_title', models.CharField(blank=True, help_text='Override the page title used when this page appears in listings', max_length=255)), ('listing_summary', models.CharField(blank=True, help_text="The text summary used when this page appears in listings. It's also used as the description for search engines if the 'Search description' field above is not defined.", max_length=255)), ('introduction', models.TextField(blank=True)), - ('body', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title', icon='title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('quote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.CharBlock(classname='title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('job_title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('embed', wagtail.wagtailembeds.blocks.EmbedBlock()), ('call_to_action', wagtail.wagtailsnippets.blocks.SnippetChooserBlock('utils.CallToActionSnippet', template='blocks/call_to_action_block.html')), ('document', wagtail.wagtailcore.blocks.StructBlock((('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('project_list', opentech.publicpages.blocks.ProjectsBlock()), ('reviewer_list', opentech.publicpages.blocks.ReviewersBlock())))), + ('body', wagtail.wagtailcore.fields.StreamField((('heading', wagtail.wagtailcore.blocks.CharBlock(classname='full title', icon='title')), ('paragraph', wagtail.wagtailcore.blocks.RichTextBlock()), ('image', wagtail.wagtailcore.blocks.StructBlock((('image', wagtail.wagtailimages.blocks.ImageChooserBlock()), ('caption', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('quote', wagtail.wagtailcore.blocks.StructBlock((('quote', wagtail.wagtailcore.blocks.CharBlock(classname='title')), ('attribution', wagtail.wagtailcore.blocks.CharBlock(required=False)), ('job_title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('embed', wagtail.wagtailembeds.blocks.EmbedBlock()), ('call_to_action', wagtail.wagtailsnippets.blocks.SnippetChooserBlock('utils.CallToActionSnippet', template='blocks/call_to_action_block.html')), ('document', wagtail.wagtailcore.blocks.StructBlock((('document', wagtail.wagtaildocs.blocks.DocumentChooserBlock()), ('title', wagtail.wagtailcore.blocks.CharBlock(required=False))))), ('project_list', opentech.public.funds.blocks.ProjectsBlock()), ('reviewer_list', opentech.public.funds.blocks.ReviewersBlock())))), ('fund_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailcore.Page')), ('header_image', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='images.CustomImage')), ('listing_image', models.ForeignKey(blank=True, help_text='Choose the image you wish to be displayed when this page appears in listings', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='images.CustomImage')), diff --git a/opentech/publicpages/__init__.py b/opentech/public/funds/migrations/__init__.py similarity index 100% rename from opentech/publicpages/__init__.py rename to opentech/public/funds/migrations/__init__.py diff --git a/opentech/publicpages/models.py b/opentech/public/funds/models.py similarity index 93% rename from opentech/publicpages/models.py rename to opentech/public/funds/models.py index ef5634469..c5b012db1 100644 --- a/opentech/publicpages/models.py +++ b/opentech/public/funds/models.py @@ -9,7 +9,7 @@ from wagtail.wagtailadmin.edit_handlers import ( ) from wagtail.wagtailcore.fields import StreamField -from opentech.utils.models import BasePage +from opentech.public.utils.models import BasePage from .blocks import FundBlock @@ -30,7 +30,7 @@ class FundPage(BasePage): content_panels = BasePage.content_panels + [ FieldPanel('introduction'), - PageChooserPanel('fund_type', 'apply.FundType'), + PageChooserPanel('fund_type', 'funds.FundType'), StreamFieldPanel('body'), ] diff --git a/opentech/publicpages/templates/publicpages/blocks/related_projects.html b/opentech/public/funds/templates/funds/blocks/related_projects.html similarity index 100% rename from opentech/publicpages/templates/publicpages/blocks/related_projects.html rename to opentech/public/funds/templates/funds/blocks/related_projects.html diff --git a/opentech/publicpages/templates/publicpages/blocks/related_reviewers.html b/opentech/public/funds/templates/funds/blocks/related_reviewers.html similarity index 100% rename from opentech/publicpages/templates/publicpages/blocks/related_reviewers.html rename to opentech/public/funds/templates/funds/blocks/related_reviewers.html diff --git a/opentech/publicpages/templates/publicpages/fund_index.html b/opentech/public/funds/templates/funds/fund_index.html similarity index 100% rename from opentech/publicpages/templates/publicpages/fund_index.html rename to opentech/public/funds/templates/funds/fund_index.html diff --git a/opentech/publicpages/templates/publicpages/fund_page.html b/opentech/public/funds/templates/funds/fund_page.html similarity index 100% rename from opentech/publicpages/templates/publicpages/fund_page.html rename to opentech/public/funds/templates/funds/fund_page.html diff --git a/opentech/publicpages/templates/publicpages/includes/fund_apply_cta.html b/opentech/public/funds/templates/funds/includes/fund_apply_cta.html similarity index 100% rename from opentech/publicpages/templates/publicpages/includes/fund_apply_cta.html rename to opentech/public/funds/templates/funds/includes/fund_apply_cta.html diff --git a/opentech/publicpages/templates/publicpages/includes/project_listing.html b/opentech/public/funds/templates/funds/includes/project_listing.html similarity index 100% rename from opentech/publicpages/templates/publicpages/includes/project_listing.html rename to opentech/public/funds/templates/funds/includes/project_listing.html diff --git a/opentech/publicpages/tests.py b/opentech/public/funds/tests.py similarity index 100% rename from opentech/publicpages/tests.py rename to opentech/public/funds/tests.py diff --git a/opentech/publicpages/views.py b/opentech/public/funds/views.py similarity index 100% rename from opentech/publicpages/views.py rename to opentech/public/funds/views.py diff --git a/opentech/publicpages/apps.py b/opentech/publicpages/apps.py deleted file mode 100644 index 53878bf25..000000000 --- a/opentech/publicpages/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class PublicpagesConfig(AppConfig): - name = 'publicpages' diff --git a/opentech/publicpages/migrations/__init__.py b/opentech/publicpages/migrations/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/opentech/settings/base.py b/opentech/settings/base.py index 63dba99ec..f072b3d64 100644 --- a/opentech/settings/base.py +++ b/opentech/settings/base.py @@ -13,7 +13,6 @@ BASE_DIR = os.path.dirname(PROJECT_DIR) INSTALLED_APPS = [ 'opentech.images', - 'opentech.publicpages', 'opentech.apply.categories', 'opentech.apply.funds', @@ -23,6 +22,7 @@ INSTALLED_APPS = [ 'opentech.public.esi', 'opentech.public.forms', + 'opentech.public.funds', 'opentech.public.home', 'opentech.public.navigation', 'opentech.public.news', -- GitLab