Skip to content

Commit

Permalink
Improve style to improve header language selector dropdown menu
Browse files Browse the repository at this point in the history
- Prevents languages from being wrapped on multiple lines.
  • Loading branch information
mjanez committed Sep 16, 2024
1 parent 69e04f3 commit 66dc66d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion ckanext/schemingdcat/assets/css/schemingdcat.css
Original file line number Diff line number Diff line change
Expand Up @@ -3028,13 +3028,22 @@ input#lang-r:checked ~ div .example-r {
color: #a8a6a3;
text-decoration: none;
display: block;
white-space: nowrap; /* prevents text from being wrapped on multiple lines */
overflow: hidden; /* Hide text overflow */
text-overflow: ellipsis; /* Add ellipses if text is too long */
}

.nav-item.dropdown .dropdown-menu a:hover {
background-color:transparent;
background-color: transparent;
color: #003164;
}

/* Make sure the list items behave like blocks */
.nav-item.dropdown .dropdown-menu li {
display: block;
width: 100%;
}

/* CKAN 2.10 */
/* Fix Flask debug panels */
/* Selects all elements whose ID begins with 'flDebug' and ends with 'Panel-content' */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% set current_lang = request.environ.CKAN_LANG %}
{% set current_locale = h.lang_native_name() %}
<a class="nav-link dropdown-toggle" href="#" id="languageDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="fas fa-globe"></i> {{ current_locale }}
<i class="fas fa-globe"></i> {{ current_locale | capitalize }}
</a>
<ul class="dropdown-menu" aria-labelledby="languageDropdown">
{% for locale in h.get_available_locales() %}
<li>
<a class="dropdown-item" href="{% url_for h.current_url(), locale=locale.short_name %}" {% if locale.short_name == current_lang %}aria-current="true"{% endif %}>
{% set lang_label = locale.display_name or locale.english_name %}
{{ lang_label |capitalize }}
{{ lang_label | capitalize }}
</a>
</li>
{% endfor %}
Expand Down

0 comments on commit 66dc66d

Please sign in to comment.