-
Notifications
You must be signed in to change notification settings - Fork 0
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
Allow project administrators to conditionally show sidebar items #109
Comments
@Raruto @volterra79 I suggest to implement it with more options, i.e.:
How do you prefer this options inside the config ? |
@wlorenzetti i think that a configuration can be a project level:
@Raruto what dou you thin about? |
Generate some custom css (server side) and then include it on the page, eg: .sidebar-menu > li:is(#metadata, #spatialbookmarks, #print) { display: none; }
Maybe you missed: g3w-suite/g3w-admin#944 (comment) |
Yes, as I was saying, you just need to inject some css rules (on the fly) into client template: # somwhere within your djang app
elements_to_hide = ['#metadata', '#spatialbookmarks', '#print'] # here your django options.. 😃
SETTINGS.CLIENT_CUSTOM_CSS = f".sidebar-menu > li:is({', '.join(elements_to_hide)})" # https://github.com/g3w-suite/g3w-client/blob/0322c7bf066eecd92617b7f4c4d7f06c2448ba77/src/index.html
{% if SETTINGS.CLIENT_CUSTOM_CSS %}
<style>{{ SETTINGS.CLIENT_CUSTOM_CSS | safe }}</style>
{% endif %} Then, if you're feeling fancy, you could even add two text areas to each project, so anyone can customize any project as they wish.. and then append it to any previous (server side generated) custom css: SETTINGS.CLIENT_CUSTOM_CSS += TEXT_AREA_CUSTOM_CSS |
Checklist
Motivation
When publishing a project, a form option should make it optional to display the session Metadata in the client
Suggested solution
A simple check option in the form
Alternatives considered
No response
The text was updated successfully, but these errors were encountered: