Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e2f7c53
feat: #999 only cms admin edit static placeholder
wesleyboar Feb 11, 2026
f52b8b2
feat: #999 add 'header-logo' placeholder
wesleyboar Feb 11, 2026
ead8569
refactor: simplify code and format docstring
wesleyboar Feb 11, 2026
53cfef6
refactor!: header-logo → header-content
wesleyboar Mar 5, 2026
e1d19d9
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Mar 5, 2026
9fef1c3
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Apr 2, 2026
7459528
docs: heaader_logo comments
wesleyboar Apr 2, 2026
d156af6
refactor: legible header content parsing logic
wesleyboar Apr 2, 2026
d5b2a36
fix: GH-999 CMS admin can change header logo (#1142)
wesleyboar Apr 21, 2026
c7f4454
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jun 4, 2026
15a1c2d
docs(gh-999): add editable header implementation plan
wesleyboar Jun 4, 2026
053fdd7
feat: GH-999 CMS admin can change header logo - via plugin (#1171)
wesleyboar Jun 11, 2026
79f14b3
chore: delete cruft
wesleyboar Jun 11, 2026
c42f211
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jun 11, 2026
15fc05c
feat(gh-999): default Header logo form values on add (#1183)
wesleyboar Jun 16, 2026
07c0c2a
fix(gh-999): align header logo markup with settings path (#1184)
wesleyboar Jun 17, 2026
27fa19d
feat(gh-999): default Header logo alt text on add
wesleyboar Jun 17, 2026
96ed5cd
fix(gh-999): restrict Header logo plugin to header-content
wesleyboar Jun 17, 2026
7070552
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jun 17, 2026
3ee0438
refactor(gh-999): centralize header-content placeholder slot
wesleyboar Jun 17, 2026
fc6bb82
chore: whitespace
wesleyboar Jun 17, 2026
1937592
chore: plugin order (logo plugin not deprecated)
wesleyboar Jun 17, 2026
fc7eb38
fix: revert settings test change
wesleyboar Jun 17, 2026
0d4fd91
refactor: rename a constant
wesleyboar Jun 17, 2026
42a801a
docs: gh-999
wesleyboar Jun 17, 2026
c85cc71
feat(gh-999): name static placeholders in Structure sidebar
wesleyboar Jun 17, 2026
2cabc1c
chore: whitespace
wesleyboar Jun 17, 2026
e56e434
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jun 17, 2026
b737a87
Merge branches 'feat/GH-999-let-cms-admin-edit-header' and 'feat/GH-9…
wesleyboar Jun 17, 2026
34988a7
deps: @tacc/core-styles v2.57.1
wesleyboar Jun 17, 2026
440ceba
deps: @tacc/core-styles v2.57.2
wesleyboar Jun 18, 2026
606a0eb
docs(GH-999): document img-only header logo CMS limitation
wesleyboar Jun 18, 2026
559dbf7
fix(GH-1185): apply portal-logo class for img-only header logos
wesleyboar Jun 18, 2026
9beaf61
docs: clean up "Known Limitations"
wesleyboar Jun 18, 2026
a4f1a43
Merge branch 'fix/GH-1185-header-logo-portal-logo-class' of github.co…
wesleyboar Jun 18, 2026
1d01d08
chore: reduce diff
wesleyboar Jun 18, 2026
9ff3bc2
fix: expected plugins in header logo placeholder
wesleyboar Jun 18, 2026
958e340
fix: lost `portal-logo` class
wesleyboar Jun 18, 2026
74241ec
chore: delete outdated tests
wesleyboar Jun 18, 2026
56931f1
refactor: rename plugin
wesleyboar Jun 18, 2026
f878b60
chore(test): revert unused _FakePicture attributes_str helper
wesleyboar Jun 18, 2026
97d3382
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jun 18, 2026
d8d6114
refactor(gh-999): simplify header logo rendering (#1189)
wesleyboar Jun 19, 2026
7450f3f
refactor: rename a const
wesleyboar Jun 19, 2026
a6b9209
refactor: rename a const
wesleyboar Jun 19, 2026
4c79ddf
docs: clarity
wesleyboar Jun 19, 2026
cead748
docs: remove cruft
wesleyboar Jun 19, 2026
950ed99
fix(header-logo): always set id on Header logo plugin markup
wesleyboar Jun 19, 2026
d361e90
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 1, 2026
1d96a54
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 1, 2026
39a8386
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 3, 2026
b41b1a6
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 21, 2026
791d412
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 27, 2026
0d31361
Merge branch 'main' into feat/GH-999-let-cms-admin-edit-header
wesleyboar Jul 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions taccsite_cms/_settings/djangocms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
]
DJANGOCMS_PICTURE_TEMPLATES = [
('no_link_to_ext_image', _('Do not link to external image')),
('header_logo', _('Header logo')),
]

########################
Expand Down
31 changes: 28 additions & 3 deletions taccsite_cms/management/commands/util.py

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To no longer let basic CMS editor edit placeholders.1

Footnotes

  1. I auto-added this permission before I realized I should not.

Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@ def add_perm(group, app_label, model_name, perm_name):
else:
group.permissions.add( Permission.objects.get( name=perm_name ))

def del_perm(group, app_label, model_name, perm_name):
"""
Delete specific permission from a given group
"""
logger.debug(f'Removing permission ({app_label}.{model_name}) "{perm_name}"')
if app_label and model_name:
model = model_name.lower().replace(' ', '')
content_type = ContentType.objects.get(
app_label=app_label,
model=model
)
group.permissions.remove(
Permission.objects.get(
name=perm_name,
content_type=content_type
)
)
else:
group.permissions.remove(Permission.objects.get(name=perm_name))


# Page
Expand All @@ -44,9 +63,15 @@ def let_view_page_and_structure(group):
add_perm(group, 'cms', 'page', 'Can change page')

add_perm(group, 'cms', 'placeholder', 'Can use Structure mode')
# HELP: Not necessary on TACC (as of Core-CMS v4.17.1)
# Is necessary on WTCS (as of Core-CMS v4.20.2)
add_perm(group, 'cms', 'static placeholder', 'Can change static placeholder')
# To delete undesired permission from sites that still have it:
# ```py
# add_perm(group, 'cms', 'static placeholder', 'Can change static placeholder')
# ```
# HELP: Should "Sitewide Content Manager" keep this perm?
# SEE: https://weteachcs.org/admin/auth/group/9/change/
# FAQ: Only superuser may edit static placeholders (footer, header-logo)
# TODO: After this is deployed on all sites once, delete this code
del_perm(group, 'cms', 'static placeholder', 'Can change static placeholder')



Expand Down
9 changes: 8 additions & 1 deletion taccsite_cms/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,14 @@ def get_subdirs_as_module_names(path):
}

CMS_PERMISSION = True
CMS_PLACEHOLDER_CONF = {}
CMS_PLACEHOLDER_CONF = {
'header-logo': {
'plugins': ['PicturePlugin'],
'limits': {
'global': 1
},
},
Comment on lines +571 to +581

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name the placeholder and limit its content to a header logo.

}

THUMBNAIL_HIGH_RESOLUTION = True
THUMBNAIL_PROCESSORS = (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{# Header logo from Picture plugin: pass plugin_logo and use shared header_logo.html. #}
{% load header_logo_tags %}
{% header_logo_from_picture instance picture_link as plugin_logo %}
{% include "header_logo.html" with plugin_logo=plugin_logo %}
3 changes: 3 additions & 0 deletions taccsite_cms/templates/header.html

@wesleyboar wesleyboar Jun 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The keystone code is in this file.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{# @var settings #}
{% load cms_tags %}

{# WARNING: Some markup is duplicated in other repositories #}
{# SEE: https://confluence.tacc.utexas.edu/x/LoCnCQ #}
Expand All @@ -22,7 +23,9 @@
{% endif %}
">
<!-- Portal Logo -->
{% static_placeholder "header-logo" or %}
{% include "header_logo.html" %}
{% endstatic_placeholder %}

<!-- Navbar Accordian Toggle on Small Screens -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExpandTarget" aria-controls="navbarsExpandTarget" aria-expanded="false" aria-label="Toggle navigation">
Expand Down
26 changes: 24 additions & 2 deletions taccsite_cms/templates/header_logo.html

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as big a change a it looks. I basically moved it to ./header_logo_via_settings.html which this conditionally calls.

what file looks like, sans diff
{% load header_tags %}

{% render_header_logo as header_logo %}
{% if header_logo %}
  {{ header_logo }}
{% else %}
  {% include "header_logo_via_settings.html" %}
{% endif %}

Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
{# @var logo, className #}
{# @var plugin_logo (optional), className #}
{% load static custom_portal_settings %}

{% if settings.LOGO %}
{% if plugin_logo %}

{% with plugin_logo as logo %}
<a
id="header-logo"
class="navbar-brand {{className}}"
href="{{ logo.link_href }}"
target="{{ logo.link_target }}"
>
<img
class="portal-logo {{ logo.img_class }}"
src="{% if logo.is_remote %}{{ logo.img_file_src }}{% else %}{% static logo.img_file_src %}{% endif %}"
{% if logo.img_crossorigin %}
crossorigin="{{ logo.img_crossorigin }}"
{% endif %}
{% if logo.img_alt_text %}
alt="{{ logo.img_alt_text }}"
{% endif %}
/>
</a>
{% endwith %}

{% elif settings.LOGO %}

{% 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 %}
Expand Down
27 changes: 27 additions & 0 deletions taccsite_cms/templatetags/header_logo_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""Template tags for header logo (e.g. building plugin_logo from Picture plugin)."""
from django import template

register = template.Library()


@register.simple_tag
def header_logo_from_picture(instance, picture_link):
"""
Build a plugin_logo dict from a djangocms_picture instance for use in header_logo.html.

Usage: {% header_logo_from_picture instance picture_link as plugin_logo %}
Then: {% include "header_logo.html" with plugin_logo=plugin_logo %}
"""
attributes = getattr(instance, 'attributes', None) or {}
picture = getattr(instance, 'picture', None)
alt = attributes.get('alt') or (getattr(picture, 'default_alt_text', None) if picture else None) or ''
img_src = getattr(instance, 'img_src', None) or ''
return {
'link_href': picture_link or '#',
'link_target': getattr(instance, 'link_target', None) or '',
'img_class': '',
'img_file_src': img_src,
'is_remote': True,
'img_crossorigin': '',
'img_alt_text': alt,
}