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

💻 Small redesign language menu bar #5632

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 4 additions & 5 deletions templates/incl/menubar.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<svg id="language_arrow" class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg>
</div>
</a>
<div class="dropdown-menu dropdown-blue" id="language_dropdown" style="display: none;"
<div class="dropdown-menu dropdown-blue h-96 overflow-auto" id="language_dropdown" style="display: none;"
_="on mutation of @style
set arrow to #language_arrow
if *display == 'none'
Expand All @@ -63,13 +63,12 @@
add .rotate-180 to arrow
end">
<div class="mb-4">
<input id="search_language" placeholder="{{_('search')}}" class="border text-black border-gray-500 rounded h-8 px-2 w-full">
</div>
<div class="flex flex-row flex-wrap w-min justify-start content-start items-start" style="max-height: {{((other_languages()|length)//3 + ((other_languages()|length)%3 > 0)*1)*3}}rem; width: 39rem;">
<input id="search_language" placeholder="{{_('search')}} {{other_languages()|length}}" class="border text-black border-gray-500 rounded h-8 px-2 w-full">
</div>
<div class="flex flex-row flex-wrap w-min justify-start content-start items-start">
{% for lang in other_languages() %}
<div class="dropdown-item language" data-english="{{ lang.english }}" onclick="hedyApp.change_language ('{{lang.lang}}');event.preventDefault();" data-cy="switch_lang_{{lang.lang}}">{{ lang.sym }}</div>
{% endfor %}

<a id="add_language_btn" class="add-language-item language" href="https://hosted.weblate.org/new-lang/hedy/adventures/">{{_('add_your_language')}}</a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ describe('Language choice button', () => {
it('passes', () => {
goToHome();
cy.get('.dropdown > .menubar-text').click();
cy.get('#language_dropdown').should('be.visible');

cy.get('.language').each(($el) => {
cy.wrap($el).should('be.visible').should('be.not.empty').should('be.not.disabled');
})
cy.wrap($el).scrollIntoView({ easing: 'linear', duration: 100 })
.should('be.visible')
.should('be.not.empty')
.should('be.not.disabled');
})
})
});
});
Loading