diff --git a/taccsite_cms/settings.py b/taccsite_cms/settings.py index e132576bb..3037d6aab 100644 --- a/taccsite_cms/settings.py +++ b/taccsite_cms/settings.py @@ -651,6 +651,10 @@ def get_subdirs_as_module_names(path): (CORTAL_ICONS, 'icon', _('TACC "Cortal" Icons')), ] +DJANGOCMS_ICON_TEMPLATES = [ + ('show_label', 'Show Label'), +] + ######################## # IMPORT & EXPORT ######################## diff --git a/taccsite_cms/templates/djangocms_icon/includes/icon.html b/taccsite_cms/templates/djangocms_icon/includes/icon.html new file mode 100644 index 000000000..2f5dac8bd --- /dev/null +++ b/taccsite_cms/templates/djangocms_icon/includes/icon.html @@ -0,0 +1,5 @@ +{# https://github.com/django-cms/djangocms-icon/blob/2.0.0/djangocms_icon/templates/djangocms_icon/includes/icon.html #} +{% load cms_tags %} + +{# @var show_label #} +{% if show_label %} {{ instance.label }}{% endif %} diff --git a/taccsite_cms/templates/djangocms_icon/includes/svg.html b/taccsite_cms/templates/djangocms_icon/includes/svg.html index 3a30ac3a2..99b2f2fc6 100644 --- a/taccsite_cms/templates/djangocms_icon/includes/svg.html +++ b/taccsite_cms/templates/djangocms_icon/includes/svg.html @@ -1,5 +1,5 @@ {# https://github.com/django-cms/djangocms-icon/blob/2.0.0/djangocms_icon/templates/djangocms_icon/includes/icon.html #} -{# @var path #} +{# @var path, show_label #} {% load cms_tags static %} {# FAQ: The allows Django CMS editor to edit via double-click #} @@ -8,3 +8,4 @@ +{% if show_label %} {{ instance.label }}{% endif %} diff --git a/taccsite_cms/templates/djangocms_icon/show_label/icon.html b/taccsite_cms/templates/djangocms_icon/show_label/icon.html new file mode 100644 index 000000000..f9dd0b082 --- /dev/null +++ b/taccsite_cms/templates/djangocms_icon/show_label/icon.html @@ -0,0 +1,8 @@ +{# ../default/icon.html #} +{% load cms_tags %} + +{% if '-logo' in instance.icon %} + {% include 'djangocms_icon/includes/svg.html' with show_label=True path="site_cms/img/icons/logos.svg" %} +{% else %} + {% include 'djangocms_icon/includes/icon.html' with show_label=True %} +{% endif %}