Skip to content

Commit

Permalink
Fix style of selected language in dropdown (#2076)
Browse files Browse the repository at this point in the history
* Fix style of selected language in dropdown

* Changelog

* Update CHANGES.rst

Co-authored-by: Jordi Puiggené <jp@naralabs.com>
  • Loading branch information
ramonski and xispa authored Aug 1, 2022
1 parent 825e8c9 commit 5f99f12
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
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)
------------------

- #2076 Fix 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>

0 comments on commit 5f99f12

Please sign in to comment.