Browse Source

Allow card grid inside hero unit. Squash migrations in project template. (#84)

Fixes #64
Vince Salvino 6 years ago
parent
commit
96115d71d2

+ 7 - 4
coderedcms/blocks/__init__.py

@@ -50,13 +50,16 @@ BASIC_LAYOUT_STREAMBLOCKS = [
 ]
 
 LAYOUT_STREAMBLOCKS = [
-    ('row', GridBlock(CONTENT_STREAMBLOCKS)),
-    ('cardgrid', CardGridBlock([
-        ('card', CardBlock()),])
-    ),
     ('hero', HeroBlock([
         ('row', GridBlock(CONTENT_STREAMBLOCKS)),
+        ('cardgrid', CardGridBlock([
+            ('card', CardBlock()),])
+        ),
         ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),])
     ),
+    ('row', GridBlock(CONTENT_STREAMBLOCKS)),
+    ('cardgrid', CardGridBlock([
+        ('card', CardBlock()),])
+    ),
     ('html', blocks.RawHTMLBlock(icon='code', classname='monospace', label=_('HTML'))),
 ]

File diff suppressed because it is too large
+ 23 - 0
coderedcms/migrations/0008_auto_20190122_1242.py


File diff suppressed because it is too large
+ 4 - 3
coderedcms/project_template/website/migrations/0001_initial.py


+ 1 - 2
coderedcms/project_template/website/migrations/0002_initial_data.py

@@ -16,7 +16,6 @@ def initial_data(apps, schema_editor):
     webpage_content_type, created = ContentType.objects.get_or_create(
         model='webpage',
         app_label='website',
-        defaults={'name': 'webpage'} if DJANGO_VERSION < (1, 8) else {}
     )
 
     # Delete the default home page generated by wagtail,
@@ -24,7 +23,7 @@ def initial_data(apps, schema_editor):
     curr_homepage = Page.objects.filter(slug='home').delete()
 
     homepage = WebPage.objects.create(
-        title = "Home Page",
+        title = "Home",
         slug='home',
         custom_template='coderedcms/pages/web_page_notitle.html',
         content_type=webpage_content_type,

File diff suppressed because it is too large
+ 0 - 22
coderedcms/project_template/website/migrations/0003_auto_20180912_1636.py


+ 0 - 27
coderedcms/project_template/website/migrations/0004_auto_20181015_1935.py

@@ -1,27 +0,0 @@
-# Generated by Django 2.0.9 on 2018-10-15 23:35
-
-import coderedcms.blocks.base_blocks
-from django.conf import settings
-from django.db import migrations, models
-import django.db.models.deletion
-import wagtail.contrib.table_block.blocks
-import wagtail.core.blocks
-import wagtail.core.fields
-import wagtail.documents.blocks
-import wagtail.images.blocks
-import wagtail.snippets.blocks
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('website', '0003_auto_20180912_1636'),
-    ]
-
-    operations = [
-        migrations.AlterField(
-            model_name='articlepage',
-            name='author',
-            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Author'),
-        ),
-    ]

File diff suppressed because it is too large
+ 0 - 23
coderedcms/project_template/website/migrations/0005_auto_20181214_2214.py


+ 0 - 17
coderedcms/project_template/website/migrations/0006_auto_20190102_1506.py

@@ -1,17 +0,0 @@
-# Generated by Django 2.1.4 on 2019-01-02 20:06
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('website', '0005_auto_20181214_2214'),
-    ]
-
-    operations = [
-        migrations.AlterModelOptions(
-            name='formpagefield',
-            options={'ordering': ['sort_order']},
-        ),
-    ]

+ 3 - 0
coderedcms/static/css/codered-front.css

@@ -11,6 +11,9 @@ CodeRed CMS custom styles
     background-position: center center;
     color:white;
 }
+.hero-bg .card {
+    color: #212529; /* reset to bootstrap default. See bug https://github.com/twbs/bootstrap/issues/28102 */
+}
 
 .hero-bg.parallax {
     background-attachment: fixed;

+ 8 - 2
docs/contributing/index.rst

@@ -18,8 +18,14 @@ To create a test project locally:
    4 and 5 in :doc:`/getting_started/install` with a fresh database before making migrations.
 #. When model or block changes affect the local test project (i.e. the "website" app), run
    ``makemigrations website`` in the test project to generate the relevant migration files locally.
-   Apply and test the migrations. When satisfied, copy the new migration files to the
-   ``project_template/website/migrations/`` directory.
+   Apply and test the migrations. When satisfied, re-generate the 0001_initial.py migration in
+   ``project_template/website/migrations/`` as so:
+
+       #. Create a new test project using ``coderedcms start testproject``.
+       #. Before running migrations, DELETE all migrations in ``testproject/website/migrations/``.
+       #. Run ``python manage.py makemigrations website``. This should generate an ``0001_initial.py``
+          migration.
+       #. Replace ``project_template/website/migrations/0001_initial.py`` with your newly generated migration.
 
 When making changes that are potentially destructive or backwards incompatible, increment the minor
 version number until coderedcms reaches a stable 1.0 release. Each production project that uses

+ 1 - 0
docs/releases/v0.11.rst

@@ -13,6 +13,7 @@ New features
 Bug fixes
 ---------
 
+* Can now create Card Grids inside of a Hero Unit.
 * Fixed invalid HTML syntax in "Latest Pages" block.
 * Fix appearance of search page when no query is specified.
 * Allow reordering form fields in generated website app.

Some files were not shown because too many files changed in this diff