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

Fix style of selected language in dropdown #2076

Merged
merged 3 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Changelog
2.3.0 (unreleased)
------------------

- #2076Fix style of selected language in dropdown
- #2074 Allow to disable global Auditlogging
- #2072 Refactor report filename generation to own method
- #2071 Move sample reports to report catalog, add batch ID and email sent flag to listing
Expand Down
33 changes: 17 additions & 16 deletions src/senaite/core/browser/viewlets/templates/languageselector.pt
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@
</a>

<!-- Available Languages -->
<ul class="dropdown-menu dropdown-menu-right"
<div class="dropdown-menu dropdown-menu-right"
role="menu"
aria-labelledby="portal-languageselector"
tal:define="languages view/languages;
base_url context/@@plone_context_state/current_base_url;">

<tal:language repeat="lang languages">

<li tal:define="code lang/code;
qs request/QUERY_STRING;
params python:filter(lambda x: x and not x.startswith('set_language'), qs.split('&'));
lang_param string:set_language=${code};
new_params python:'&'.join(params + [lang_param]);
selected lang/selected;
codeclass string:language-${code};
current python: selected and 'currentLanguage active ' or '';"
tal:attributes="class string:${codeclass} nav-item">
<div tal:define="code lang/code;
qs request/QUERY_STRING;
params python:filter(lambda x: x and not x.startswith('set_language'), qs.split('&'));
lang_param string:set_language=${code};
new_params python:'&'.join(params + [lang_param]);
selected lang/selected;
codeclass string:language-${code};
current python: selected and 'currentLanguage active dropdown-item' or 'dropdown-item';
current_item python: selected and 'text-light' or '';"
tal:attributes="class string:${codeclass} ${current}">
<a href="#"
tal:define="name lang/native|lang/name;"
tal:attributes="href string:${base_url}?${new_params};
class string:${current} nav-link;
title name">
tal:define="name lang/native|lang/name;"
tal:attributes="href string:${base_url}?${new_params};
class string:${current_item} text-decoration-none;
title name">
<span tal:content="name"/>
</a>
</li>
</div>
</tal:language>
</ul>
</div>
</nav>
</tal:language>