-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comunity theming horizon zen #1072
Conversation
d8bce44
to
513011b
Compare
invenio_communities/communities/records/systemfields/community_theme.py
Outdated
Show resolved
Hide resolved
invenio_communities/templates/semantic-ui/invenio_communities/base.html
Outdated
Show resolved
Hide resolved
bf8930b
to
2f8a39f
Compare
invenio_communities/communities/records/jsonschemas/communities/communities-v1.0.0.json
Outdated
Show resolved
Hide resolved
invenio_communities/communities/records/jsonschemas/communities/communities-v1.0.0.json
Outdated
Show resolved
Hide resolved
invenio_communities/communities/records/systemfields/community_theme.py
Outdated
Show resolved
Hide resolved
a36c402
to
e9dcd1b
Compare
MANIFEST.in
Outdated
@@ -18,6 +18,7 @@ include babel.ini | |||
include docs/requirements.txt | |||
include LICENSE | |||
include pytest.ini | |||
recursive-include *community_theme_template.css |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recursive-include *community_theme_template.css | |
include *community_theme_template.css |
minor: I think it is enough to include since it is not a folder, but a single file
return ( | ||
template, | ||
200, | ||
{"Cache-control": "max-age 1 year", "Content-Type": "text/css; charset=utf-8"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: maybe worth adding also Content-Disposition: inline
header
theme_config = community.data.get("theme", {}).get("config") | ||
|
||
if theme_config is None: | ||
template = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't it generate a request to get an empty file? not sure what will happen in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That happens only if you request a theme for a community that doesn't have one so it returns empty css. I don't understand the generate a request... you mean to return a 404 instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably 404 would be better, yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried but abort(404)
it is getting caught from our 404 handler and it generates a 404 page, which generates much bigger response than just the empty string.... I would leave it as is and we can evaluate it again once we focus on the horizon zen sprint if needed.
ff5ccf5
to
eeb9a58
Compare
* 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]>
eeb9a58
to
bf4d9d0
Compare
closes zenodo/horizon-zen#46