-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
global: add support for community theming
* adds new data field called `theme` * adds specific template loader that handles themed templates per community * enables feature only for system user at the moment programmtically * disables indexing of community theme information Co-authored-by: Karolina Przerwa <[email protected]>
- Loading branch information
Showing
24 changed files
with
471 additions
and
57 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
invenio_communities/communities/dumpers/community_theme.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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of Invenio. | ||
# Copyright (C) 2024 CERN. | ||
# | ||
# Invenio is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Community theme dumper. | ||
Dumper used to remove the theme field on dump of a community from a search body. | ||
""" | ||
|
||
from invenio_records.dumpers import SearchDumperExt | ||
|
||
|
||
class CommunityThemeDumperExt(SearchDumperExt): | ||
"""Dumper to remove community theme field from indexing.""" | ||
|
||
def __init__(self, key="theme"): | ||
"""Initialize the dumper.""" | ||
self.key = key | ||
|
||
def dump(self, record, data): | ||
"""Remove theme information from indexing.""" | ||
data.pop("theme", None) |
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
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
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
45 changes: 45 additions & 0 deletions
45
invenio_communities/templates/semantic-ui/invenio_communities/community_theme_template.css
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,45 @@ | ||
.page-subheader-outer { | ||
background-color: {{ theme.mainHeaderBackgroundColor }} !important; | ||
} | ||
|
||
.theme-secondary, .ui.secondary.button { | ||
background-color: {{ theme.secondaryColor }} !important; | ||
color: {{ theme.secondaryTextColor }} !important; | ||
} | ||
|
||
.invenio-page-body .ui.search.button { | ||
background-color: {{ theme.secondaryColor }} !important; | ||
color: {{ theme.secondaryTextColor }} !important; | ||
} | ||
|
||
.theme-primary a, .theme-primary h1, .theme-primary h2 { | ||
color: {{ theme.primaryTextColor }} !important; | ||
} | ||
|
||
.theme-primary.pointing.menu .item.active { | ||
border-color: {{ theme.secondaryColor }} !important; | ||
} | ||
|
||
.theme-primary-menu .item.active { | ||
background-color: {{ theme.primaryColor }} !important; | ||
} | ||
|
||
.theme-primary .item, .theme-primary-menu, .page-subheader-outer{ | ||
font-family: {{ theme.font.family }} !important; | ||
font-weight: {{ theme.font.weight }} !important; | ||
font-size: {{ theme.font.size }}; | ||
} | ||
|
||
.theme-primary { | ||
background-color: {{ theme.primaryColor }} !important; | ||
} | ||
|
||
.theme-tertiary, .ui.tertiary.button { | ||
background-color: {{ theme.tertiaryColor }} !important; | ||
color: {{ theme.tertiaryTextColor }}; | ||
} | ||
|
||
.invenio-accordion-field .title, .ui.primary.button{ | ||
background-color: {{ theme.primaryColor }} !important; | ||
color: {{ theme.primaryTextColor }} !important; | ||
} |
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
Oops, something went wrong.