From 66c790599ea8449d6bef52db235a540ef9ba400e Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 16 Jun 2026 17:26:31 -0500
Subject: [PATCH 1/4] fix(gh-999): align header logo markup (navbar-brand on
plugin render)
Apply navbar-brand at HeaderLogoPlugin render; align settings fallback template.
Pairs with Core-Styles header logo styling.
---
.../contrib/taccsite_header_logo/cms_plugins.py | 13 +++++++------
taccsite_cms/contrib/taccsite_header_logo/forms.py | 7 -------
.../templates/header_logo_via_settings.html | 6 ++----
3 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/taccsite_cms/contrib/taccsite_header_logo/cms_plugins.py b/taccsite_cms/contrib/taccsite_header_logo/cms_plugins.py
index 25dc0470b..4d91e8ad8 100644
--- a/taccsite_cms/contrib/taccsite_header_logo/cms_plugins.py
+++ b/taccsite_cms/contrib/taccsite_header_logo/cms_plugins.py
@@ -6,15 +6,13 @@
from .forms import HeaderLogoForm
-HEADER_LOGO_ELEMENT_ID = 'header-logo'
+HEADER_LOGO_LINK_CLASS = 'navbar-brand'
@plugin_pool.register_plugin
class HeaderLogoPlugin(PicturePlugin):
"""
- Header > "Header logo" plugin
-
- Full Picture plugin; default id="header-logo" when not set in Attributes.
+ Header > "Header logo" (Picture) plugin
"""
model = Picture
form = HeaderLogoForm
@@ -24,6 +22,9 @@ class HeaderLogoPlugin(PicturePlugin):
def render(self, context, instance, placeholder):
if not instance.attributes:
instance.attributes = {}
- if 'id' not in instance.attributes:
- instance.attributes['id'] = HEADER_LOGO_ELEMENT_ID
+
+ # To add required attributes
+ existing_class = instance.attributes.get('class', '')
+ instance.attributes['class'] = f'{HEADER_LOGO_LINK_CLASS} {existing_class}'.strip()
+
return super().render(context, instance, placeholder)
diff --git a/taccsite_cms/contrib/taccsite_header_logo/forms.py b/taccsite_cms/contrib/taccsite_header_logo/forms.py
index 787b9a680..c814cb0b0 100644
--- a/taccsite_cms/contrib/taccsite_header_logo/forms.py
+++ b/taccsite_cms/contrib/taccsite_header_logo/forms.py
@@ -11,9 +11,6 @@ def default_home_page():
class HeaderLogoForm(PictureForm):
"""
Defaults for new Header logo plugins only (admin add form).
-
- With a link, TACC default picture.html puts Attributes (e.g. class mr-5) on
- the , not the
.
"""
def __init__(self, *args, **kwargs):
@@ -25,10 +22,6 @@ def __init__(self, *args, **kwargs):
if home is not None:
self.initial.setdefault('link_page', home.pk)
- self.initial.setdefault('height', 50)
self.initial.setdefault('use_no_cropping', True)
self.initial.setdefault('use_automatic_scaling', False)
- attributes = dict(self.initial.get('attributes') or {})
- attributes.setdefault('class', 'mr-5')
- self.initial['attributes'] = attributes
diff --git a/taccsite_cms/templates/header_logo_via_settings.html b/taccsite_cms/templates/header_logo_via_settings.html
index 12e3233fb..55b432de9 100644
--- a/taccsite_cms/templates/header_logo_via_settings.html
+++ b/taccsite_cms/templates/header_logo_via_settings.html
@@ -1,4 +1,3 @@
-{# @var className #}
{% load static custom_portal_settings %}
{% if settings.LOGO %}
@@ -7,7 +6,7 @@
{% with settings.LOGO as logo %}
{% with filename=logo|index:1 selectors=logo|index:2 targeturl=logo|index:3 targettype=logo|index:4 accessibility=logo|index:5 corstype=logo|index:6 visibility=logo|index:7 %}
{% if visibility == "True" %}
-
+
{% endif %}
@@ -19,8 +18,7 @@
{# via CMS setting (e.g. CMS developer sets logo image) #}
{% with settings.PORTAL_LOGO as logo %}
Date: Tue, 16 Jun 2026 19:00:50 -0500
Subject: [PATCH 2/4] feat(gh-999): Portal logo picture template for header img
class
Register Portal logo template and picture_attributes_img on default picture; default Header logo to portal_logo with mr-5 on link attributes.
---
package-lock.json | 10 ++++------
package.json | 2 +-
taccsite_cms/_settings/djangocms_plugins.py | 1 +
taccsite_cms/contrib/taccsite_header_logo/forms.py | 10 ++++++++++
taccsite_cms/templates/base.html | 2 +-
.../templates/djangocms_picture/default/picture.html | 3 +++
.../djangocms_picture/portal_logo/picture.html | 2 ++
7 files changed, 22 insertions(+), 8 deletions(-)
create mode 100644 taccsite_cms/templates/djangocms_picture/portal_logo/picture.html
diff --git a/package-lock.json b/package-lock.json
index 1031dc2aa..4a514fc6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,7 @@
"minimist": "^1.2.6"
},
"devDependencies": {
- "@tacc/core-styles": "^2.57.0"
+ "@tacc/core-styles": "github:TACC/core-styles#fix/s-header-navbar-brand-flex"
},
"engines": {
"node": ">=20",
@@ -1511,8 +1511,7 @@
},
"node_modules/@tacc/core-styles": {
"version": "2.57.0",
- "resolved": "https://registry.npmjs.org/@tacc/core-styles/-/core-styles-2.57.0.tgz",
- "integrity": "sha512-MRYts9CdayXrlJfLPRO1fBiWIicNFFoUs4h0lUbcsl8PAT9/YZU3bjY1TzcCe36OUUxi1ENjciU348LTa7EXcQ==",
+ "resolved": "git+ssh://git@github.com/TACC/core-styles.git#349f09976814315ff753ef7fb5c87acce9cfe862",
"dev": true,
"license": "MIT",
"bin": {
@@ -5747,10 +5746,9 @@
}
},
"@tacc/core-styles": {
- "version": "2.57.0",
- "resolved": "https://registry.npmjs.org/@tacc/core-styles/-/core-styles-2.57.0.tgz",
- "integrity": "sha512-MRYts9CdayXrlJfLPRO1fBiWIicNFFoUs4h0lUbcsl8PAT9/YZU3bjY1TzcCe36OUUxi1ENjciU348LTa7EXcQ==",
+ "version": "git+ssh://git@github.com/TACC/core-styles.git#349f09976814315ff753ef7fb5c87acce9cfe862",
"dev": true,
+ "from": "@tacc/core-styles@github:TACC/core-styles#fix/s-header-navbar-brand-flex",
"requires": {}
},
"ansi-regex": {
diff --git a/package.json b/package.json
index ba720132b..63730b4ed 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,6 @@
},
"homepage": "https://github.com/TACC/Core-CMS",
"devDependencies": {
- "@tacc/core-styles": "^2.57.0"
+ "@tacc/core-styles": "github:TACC/core-styles#fix/s-header-navbar-brand-flex"
}
}
diff --git a/taccsite_cms/_settings/djangocms_plugins.py b/taccsite_cms/_settings/djangocms_plugins.py
index 8c54345c5..40ead9e43 100644
--- a/taccsite_cms/_settings/djangocms_plugins.py
+++ b/taccsite_cms/_settings/djangocms_plugins.py
@@ -41,6 +41,7 @@
]
DJANGOCMS_PICTURE_TEMPLATES = [
('no_link_to_ext_image', _('Do not link to external image')),
+ ('portal_logo', _('Portal logo')),
]
########################
diff --git a/taccsite_cms/contrib/taccsite_header_logo/forms.py b/taccsite_cms/contrib/taccsite_header_logo/forms.py
index c814cb0b0..13da644df 100644
--- a/taccsite_cms/contrib/taccsite_header_logo/forms.py
+++ b/taccsite_cms/contrib/taccsite_header_logo/forms.py
@@ -2,6 +2,8 @@
from django.contrib.sites.models import Site
from djangocms_picture.forms import PictureForm
+HEADER_LOGO_PICTURE_TEMPLATE = 'portal_logo'
+
def default_home_page():
site = Site.objects.get_current()
@@ -11,6 +13,9 @@ def default_home_page():
class HeaderLogoForm(PictureForm):
"""
Defaults for new Header logo plugins only (admin add form).
+
+ Uses Portal logo picture template (portal-logo on img). Attributes class
+ applies to the link when a link is set (see default picture.html).
"""
def __init__(self, *args, **kwargs):
@@ -18,6 +23,8 @@ def __init__(self, *args, **kwargs):
if self.instance.pk:
return
+ self.initial.setdefault('template', HEADER_LOGO_PICTURE_TEMPLATE)
+
home = default_home_page()
if home is not None:
self.initial.setdefault('link_page', home.pk)
@@ -25,3 +32,6 @@ def __init__(self, *args, **kwargs):
self.initial.setdefault('use_no_cropping', True)
self.initial.setdefault('use_automatic_scaling', False)
+ attributes = dict(self.initial.get('attributes') or {})
+ attributes.setdefault('class', 'mr-5')
+ self.initial['attributes'] = attributes
diff --git a/taccsite_cms/templates/base.html b/taccsite_cms/templates/base.html
index 10fff4273..f59a4e6e4 100755
--- a/taccsite_cms/templates/base.html
+++ b/taccsite_cms/templates/base.html
@@ -57,7 +57,7 @@
{% render_block "css" %}
-
+
{% cms_toolbar %}
{% block header %}
diff --git a/taccsite_cms/templates/djangocms_picture/default/picture.html b/taccsite_cms/templates/djangocms_picture/default/picture.html
index c082c6222..3f7ccc687 100644
--- a/taccsite_cms/templates/djangocms_picture/default/picture.html
+++ b/taccsite_cms/templates/djangocms_picture/default/picture.html
@@ -66,6 +66,9 @@
{# /TACC #}
{% endblock %}
{# /TACC #}
+ {# TACC (allow attributes to be force-added to
): #}
+ {% block picture_attributes_img %}{% endblock %}
+ {# /TACC #}
>
{% endlocalize %}
diff --git a/taccsite_cms/templates/djangocms_picture/portal_logo/picture.html b/taccsite_cms/templates/djangocms_picture/portal_logo/picture.html
new file mode 100644
index 000000000..03e6af734
--- /dev/null
+++ b/taccsite_cms/templates/djangocms_picture/portal_logo/picture.html
@@ -0,0 +1,2 @@
+{% extends "djangocms_picture/default/picture.html" %}
+{% block picture_attributes_img %}class="portal-logo"{% endblock %}
From 949b2356e8b268751703aa418d130ef64a354e76 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 16 Jun 2026 19:17:13 -0500
Subject: [PATCH 3/4] refactor(HeaderLogoForm): update template initialization
and remove default attributes
- Added conditional logic to set the template based on the PORTAL_IS_TACC_CORE_PORTAL setting.
- Removed the default 'mr-5' class from the attributes in the HeaderLogoForm.
- Updated the body class in base.html to remove the conditional portal class.
---
taccsite_cms/contrib/taccsite_header_logo/forms.py | 11 ++++-------
taccsite_cms/templates/base.html | 2 +-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/taccsite_cms/contrib/taccsite_header_logo/forms.py b/taccsite_cms/contrib/taccsite_header_logo/forms.py
index 13da644df..2692dad83 100644
--- a/taccsite_cms/contrib/taccsite_header_logo/forms.py
+++ b/taccsite_cms/contrib/taccsite_header_logo/forms.py
@@ -1,4 +1,5 @@
from cms.models import Page
+from django.conf import settings
from django.contrib.sites.models import Site
from djangocms_picture.forms import PictureForm
@@ -14,8 +15,7 @@ class HeaderLogoForm(PictureForm):
"""
Defaults for new Header logo plugins only (admin add form).
- Uses Portal logo picture template (portal-logo on img). Attributes class
- applies to the link when a link is set (see default picture.html).
+ On a TACC/Core-Portal instance, defaults to Portal logo picture template.
"""
def __init__(self, *args, **kwargs):
@@ -23,7 +23,8 @@ def __init__(self, *args, **kwargs):
if self.instance.pk:
return
- self.initial.setdefault('template', HEADER_LOGO_PICTURE_TEMPLATE)
+ if settings.PORTAL_IS_TACC_CORE_PORTAL:
+ self.initial.setdefault('template', HEADER_LOGO_PICTURE_TEMPLATE)
home = default_home_page()
if home is not None:
@@ -31,7 +32,3 @@ def __init__(self, *args, **kwargs):
self.initial.setdefault('use_no_cropping', True)
self.initial.setdefault('use_automatic_scaling', False)
-
- attributes = dict(self.initial.get('attributes') or {})
- attributes.setdefault('class', 'mr-5')
- self.initial['attributes'] = attributes
diff --git a/taccsite_cms/templates/base.html b/taccsite_cms/templates/base.html
index f59a4e6e4..10fff4273 100755
--- a/taccsite_cms/templates/base.html
+++ b/taccsite_cms/templates/base.html
@@ -57,7 +57,7 @@
{% render_block "css" %}
-
+
{% cms_toolbar %}
{% block header %}
From 6f57a218de6117810bfcbdc23789581c13d748bb Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Tue, 16 Jun 2026 19:18:35 -0500
Subject: [PATCH 4/4] chore: pin core-styles main hash, not dead branch
---
package-lock.json | 8 ++++----
package.json | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4a514fc6b..32ad80a10 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,7 @@
"minimist": "^1.2.6"
},
"devDependencies": {
- "@tacc/core-styles": "github:TACC/core-styles#fix/s-header-navbar-brand-flex"
+ "@tacc/core-styles": "github:TACC/core-styles#850bb31"
},
"engines": {
"node": ">=20",
@@ -1511,7 +1511,7 @@
},
"node_modules/@tacc/core-styles": {
"version": "2.57.0",
- "resolved": "git+ssh://git@github.com/TACC/core-styles.git#349f09976814315ff753ef7fb5c87acce9cfe862",
+ "resolved": "git+ssh://git@github.com/TACC/core-styles.git#850bb31b2c4fda66c649a7f764bd811c49afab40",
"dev": true,
"license": "MIT",
"bin": {
@@ -5746,9 +5746,9 @@
}
},
"@tacc/core-styles": {
- "version": "git+ssh://git@github.com/TACC/core-styles.git#349f09976814315ff753ef7fb5c87acce9cfe862",
+ "version": "git+ssh://git@github.com/TACC/core-styles.git#850bb31b2c4fda66c649a7f764bd811c49afab40",
"dev": true,
- "from": "@tacc/core-styles@github:TACC/core-styles#fix/s-header-navbar-brand-flex",
+ "from": "@tacc/core-styles@github:TACC/core-styles#850bb31",
"requires": {}
},
"ansi-regex": {
diff --git a/package.json b/package.json
index 63730b4ed..ae2627081 100644
--- a/package.json
+++ b/package.json
@@ -21,6 +21,6 @@
},
"homepage": "https://github.com/TACC/Core-CMS",
"devDependencies": {
- "@tacc/core-styles": "github:TACC/core-styles#fix/s-header-navbar-brand-flex"
+ "@tacc/core-styles": "github:TACC/core-styles#850bb31"
}
}