-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add omero.web config option to set custom favicon #311
Conversation
@@ -118,7 +118,7 @@ def redirect_urlpatterns(): | |||
urlpatterns += [ | |||
url( | |||
r"^favicon\.ico$", | |||
lambda request: redirect("%swebgateway/img/ome.ico" % settings.STATIC_URL), | |||
lambda request: redirect("%s%s" % (settings.STATIC_URL, settings.FAVICON_URL)), |
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.
Would an absolute FAVICON_URL ever be in scope?
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 would require additional nginx/webserver config if you want to do it yourself right?
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.
@joshmoore You mean something equivalent to the top_links
logic where we handle local vv absolute links:
try:
link["link"] = reverse(link_id)
except NoReverseMatch:
# assume we've been passed a url
link["link"] = link_id
I guess for favicon_url
you could test url.startswith("http")
or something like that?
omeroweb/settings.py
Outdated
"omero.web.favicon_url": [ | ||
"FAVICON_URL", | ||
'"webgateway/img/ome.ico"', | ||
json.loads, |
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.
Should this not just be str
? Is there a reason for this to be JSON encoded?
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.
Fixed.
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.
You need to loose the quotes in your example in the PR description and the default now I believe.
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.
Thanks, done.
This works fine for me testing locally and code looks good. 👍 |
This PR introduces a config option to overwrite
webgateway/img/ome.ico
with a custom icon.Favicon can be overwritten by setting
favicon_url
option with:The URL to the favicon needs to be specified relative to the Django's static directory.