-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into task/GH-101-header-redesign
- Loading branch information
Showing
6 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
taccsite_cms/contrib/bootstrap4_djangocms_link/cms_plugins.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# To support generic Link plugin without uninstalling Bootstrap4's | ||
# FAQ: Bootstrap Link plugin has features not desirable within TACC plugins | ||
# FAQ: We must not break sites that already use Bootstrap Link plugin | ||
try: | ||
# CAVEAT: Solution must be more than that for `bootstrap4_djangocms_picture` | ||
# SEE: https://github.com/django-cms/djangocms-bootstrap4/pull/138 | ||
import copy | ||
|
||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from cms.plugin_pool import plugin_pool | ||
|
||
from djangocms_link.cms_plugins import LinkPlugin | ||
from djangocms_bootstrap4.contrib.bootstrap4_link.cms_plugins import Bootstrap4LinkPlugin | ||
|
||
# To unlink Bootstrap's plugin fieldsets from Generic's | ||
# SEE: https://github.com/django-cms/djangocms-bootstrap4/blob/2.0.0/djangocms_bootstrap4/contrib/bootstrap4_link/cms_plugins.py#L44 | ||
Bootstrap4LinkPlugin.fieldsets = copy.deepcopy(Bootstrap4LinkPlugin.fieldsets) | ||
|
||
# To restore generic Link plugin fieldsets to state before Bootstrap's | ||
# SEE: https://github.com/django-cms/djangocms-link/blob/3.0.0/djangocms_link/cms_plugins.py#L19-L24 | ||
# SEE: https://github.com/django-cms/djangocms-bootstrap4/blob/2.0.0/djangocms_bootstrap4/contrib/bootstrap4_link/cms_plugins.py#L38-L42 | ||
LinkPlugin.fieldsets[0] = ( | ||
None, { | ||
'fields': ( | ||
'name', | ||
('external_link', 'internal_link'), | ||
) | ||
} | ||
) | ||
|
||
# To signal to users that plugin is not desirable | ||
Bootstrap4LinkPlugin.name = _('⚠️ Link / Button') | ||
Bootstrap4LinkPlugin.fieldsets.insert(0, ( | ||
None, { | ||
'description': _('⚠️ This plugin is <strong>deprecated</strong>. Please use "Generic" > "Link" plugin instead.<br /><small>If the "Generic" > "Link" plugin is inadequate, please inform the CMS development team.</small>'), | ||
'fields': () | ||
} | ||
)) | ||
|
||
# To re-register generic Link plugin | ||
# SEE: https://github.com/django-cms/djangocms-bootstrap4/blob/master/djangocms_bootstrap4/contrib/bootstrap4_link/cms_plugins.py#L81 | ||
plugin_pool.register_plugin(LinkPlugin) | ||
|
||
# To avoid server crash if Boostrap plugin is not registered | ||
# CAVEAT: If import statement fails for reason other than Bootstrap presence, | ||
# then that failure, and the failure of this plugin, is silent | ||
except ImportError: | ||
pass |
29 changes: 29 additions & 0 deletions
29
taccsite_cms/contrib/bootstrap4_djangocms_picture/cms_plugins.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# To support generic Image plugin without uninstalling Bootstrap's | ||
# FAQ: Bootstrap Image plugin has features not desirable in TACC plugins | ||
# FAQ: We must not break sites that already use Bootstrap Image plugin | ||
try: | ||
from django.utils.translation import gettext_lazy as _ | ||
|
||
from cms.plugin_pool import plugin_pool | ||
|
||
from djangocms_picture.cms_plugins import PicturePlugin | ||
from djangocms_bootstrap4.contrib.bootstrap4_picture.cms_plugins import Bootstrap4PicturePlugin | ||
|
||
# To signal to users that plugin is not desirable | ||
Bootstrap4PicturePlugin.name = _('⚠️ Picture / Image') | ||
Bootstrap4PicturePlugin.fieldsets.insert(0, ( | ||
None, { | ||
'description': _('⚠️ This plugin is <strong>deprecated</strong>. Please use "Generic" > "Image" plugin instead.<br /><small>If the "Generic" > "Image" plugin is inadequate, please inform the CMS development team.</small>'), | ||
'fields': () | ||
} | ||
)) | ||
|
||
# To re-register generic Picture plugin | ||
# SEE: https://github.com/django-cms/djangocms-bootstrap4/blob/master/djangocms_bootstrap4/contrib/bootstrap4_picture/cms_plugins.py#L54 | ||
plugin_pool.register_plugin(PicturePlugin) | ||
|
||
# To avoid server crash if Boostrap plugin is not registered | ||
# CAVEAT: If import statement fails for reason other than Bootstrap presence, | ||
# then that failure, and the failure of this plugin, is silent | ||
except ImportError: | ||
pass |
18 changes: 18 additions & 0 deletions
18
taccsite_cms/contrib/taccsite_data_list/migrations/0002_auto_20210824_0803.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.2.16 on 2021-08-24 13:03 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('taccsite_data_list', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='taccsitedatalistitem', | ||
name='key', | ||
field=models.CharField(blank=True, help_text='A label for the data value.', max_length=50, verbose_name='Label'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters