From dd346a5aeedba07a69e55e258b518aa9323ff5ed Mon Sep 17 00:00:00 2001 From: Vince Salvino Date: Sun, 2 Aug 2020 22:02:55 -0400 Subject: [PATCH] WIP --- coderedcms/blocks/base_blocks.py | 14 ++++++++++++++ coderedcms/settings.py | 27 +++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/coderedcms/blocks/base_blocks.py b/coderedcms/blocks/base_blocks.py index a64e4fab..898dba63 100644 --- a/coderedcms/blocks/base_blocks.py +++ b/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' diff --git a/coderedcms/settings.py b/coderedcms/settings.py index acfdc0d7..ca88686e 100644 --- a/coderedcms/settings.py +++ b/coderedcms/settings.py @@ -12,7 +12,18 @@ '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 @@ ('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'),