Skip to content
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

ui: display a different logo/color for each orga. #706

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

blankoworld
Copy link
Contributor

@blankoworld blankoworld commented Jan 22, 2020

  • Adds RERO_ILS_THEME_ORGANISATION_CSS_ENDPOINT configuration variable to gives a
    way for each organisation to have a specific stylesheet

Co-Authored-by: Olivier DOSSMANN [email protected]

Why are you opening this PR?

How to test?

  1. Launch server
  2. Go to each given URL:
  1. Each URL should have a different logo and color in the header

Code review check list

  • Commit message template compliance.
  • Commit message without typos.
  • File names.
  • Functions names.
  • Functions docstrings.
  • Unnecessary commited files?

@blankoworld blankoworld force-pushed the doo-#1200-layout-per-institution branch 2 times, most recently from 263a3a5 to fca1847 Compare January 22, 2020 10:53
@blankoworld blankoworld force-pushed the doo-#1200-layout-per-institution branch from fca1847 to 22b9442 Compare January 22, 2020 13:20
Copy link
Contributor

@jma jma left a comment

Choose a reason for hiding this comment

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

This is a naive approach that needs to be changed in a near future.

@@ -63,5 +63,6 @@
{%- block header %}{% endblock header %}
{%- block css %}
{% assets "rero_ils_main_css" %}<link href="{{ ASSET_URL }}" rel="stylesheet">{% endassets %}
<link href="{{ config.get('RERO_ILS_THEME_ORGANISATION_CSS_ENDPOINT') }}{{ viewcode }}.css" rel="stylesheet" title="{{ viewcode }}">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check that this works in production (non debug mode). Probably it will failed due to APP_DEFAULT_SECURE_HEADERS policies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right this approach is the simplest I found regarding given constraint: change the CSS even if the server is launched. So yes I know that's a naive one. And that in the future it will evolve.

It avoids problems with static files that are (re)generated at each deployment, that the production don't keep them in kubernetes and so on.

I also think about APP_DEFAULT_SECURE_HEADERS policy, and found nothing about CSS and images.
Seems to be OK with ENV=production in invenio.cfg file.

@blankoworld blankoworld force-pushed the doo-#1200-layout-per-institution branch from 22b9442 to f1eab00 Compare January 22, 2020 14:28
Copy link
Contributor

@AoNoOokami AoNoOokami left a comment

Choose a reason for hiding this comment

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

Tested on Chrome and working fine. I saw the issue with the logo on Firefox.

Copy link
Contributor Author

@blankoworld blankoworld left a comment

Choose a reason for hiding this comment

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

@AoNoOokami I fixed the problem on Firefox, but CSS files needs to be updated on https://ressources.rero.ch/, you can use https://o9.re/ils/css/ instead.

@blankoworld blankoworld force-pushed the doo-#1200-layout-per-institution branch from f1eab00 to ae8fe5b Compare January 23, 2020 13:21
* Adds RERO_ILS_THEME_ORGANISATION_CSS_ENDPOINT configuration variable to
gives a way for each organisation to have a specific stylesheet

Co-Authored-by: Olivier DOSSMANN <[email protected]>
@blankoworld blankoworld force-pushed the doo-#1200-layout-per-institution branch from ae8fe5b to b02bfe3 Compare January 24, 2020 13:41
@AoNoOokami AoNoOokami self-requested a review January 24, 2020 15:21
@blankoworld blankoworld merged commit 2d19c6d into rero:dev Jan 24, 2020
@blankoworld blankoworld deleted the doo-#1200-layout-per-institution branch March 30, 2020 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants