Vince Salvino 4 years ago
parent
commit
dd346a5aee
2 changed files with 39 additions and 2 deletions
  1. 14 0
      coderedcms/blocks/base_blocks.py
  2. 25 2
      coderedcms/settings.py

+ 14 - 0
coderedcms/blocks/base_blocks.py

@@ -160,6 +160,20 @@ class CoderedAdvSettings(blocks.StructBlock):
         max_length=255,
         label=_('Custom ID'),
     )
+    padding = blocks.ChoiceBlock(
+        choices=cr_settings['FRONTEND_PADDING_CHOICES'],
+        default=cr_settings['FRONTEND_PADDING_DEFAULT'],
+        required=False,
+        label=_('Padding'),
+        help_text=_('Add additional spacing around this block.'),
+    )
+    align_text = blocks.ChoiceBlock(
+        choices=cr_settings['FRONTEND_ALIGN_CHOICES'],
+        default=cr_settings['FRONTEND_ALIGN_DEFAULT'],
+        required=False,
+        label=_('Alignment'),
+        help_text=_('Aligns text, images, and buttons within this block.'),
+    )
 
     class Meta:
         form_template = 'wagtailadmin/block_forms/base_block_settings_struct.html'

+ 25 - 2
coderedcms/settings.py

@@ -12,7 +12,18 @@ DEFAULTS = {
     'PROTECTED_MEDIA_URL': '/protected/',
     'PROTECTED_MEDIA_ROOT': os.path.join(BASE_DIR, 'protected'),
     'PROTECTED_MEDIA_UPLOAD_WHITELIST': [],
-    'PROTECTED_MEDIA_UPLOAD_BLACKLIST': ['.sh', '.exe', '.bat', '.ps1', '.app', '.jar', '.py', '.php', '.pl', '.rb'],  # noqa
+    'PROTECTED_MEDIA_UPLOAD_BLACKLIST': [
+        '.sh', '.exe', '.bat', '.ps1', '.app', '.jar', '.py', '.php', '.pl', '.rb'
+    ],
+
+    'FRONTEND_ALIGN_DEFAULT': '',
+    'FRONTEND_ALIGN_CHOICES': (
+        ('', 'Default'),
+        ('text-left', 'Left'),
+        ('text-center', 'Center'),
+        ('text-right', 'Right'),
+        ('text-justify', 'Right'),
+    ),
 
     'FRONTEND_BTN_SIZE_DEFAULT': '',
     'FRONTEND_BTN_SIZE_CHOICES': (
@@ -97,7 +108,19 @@ DEFAULTS = {
         ('navbar-expand-xl', 'xl - Show on extra large screens (desktop, wide monitor)'),
     ),
 
-    'FRONTEND_THEME_HELP': "Change the color palette of your site with a Bootstrap theme. Powered by Bootswatch https://bootswatch.com/.",  # noqa
+    'FRONTEND_PADDING_DEFAULT': '',
+    'FRONTEND_PADDING_CHOICES': (
+        ('', 'Default'),
+        ('cr-p-0', 'No padding'),
+        ('cr-p-1', 'Small padding'),
+        ('cr-p-2', 'Medium padding'),
+        ('cr-p-3', 'Large padding'),
+    ),
+
+    'FRONTEND_THEME_HELP': (
+        "Change the color palette of your site with a Bootstrap theme. "
+        "Powered by Bootswatch https://bootswatch.com/."
+    ),
     'FRONTEND_THEME_DEFAULT': '',
     'FRONTEND_THEME_CHOICES': (
         ('', 'Default - Classic Bootstrap'),