Skip to content

Commit

Permalink
Fix display of language chooser and remove deprecations (#74)
Browse files Browse the repository at this point in the history
* fix: Remove no longer needed meetings controller overrides (#68)

* refactor: Remove deprecated controller override and update overload file

* refactor: Remove calendar file

* fix: Link change for the about page (#69)

Co-authored-by: Quentin Champenois <[email protected]>

* fix: Add menu on mobile

* fix: Fix the display of the language chooser while in cellphone format

* fix: Display both elements at different places when logged in

---------

Co-authored-by: Pauline Bessoles <[email protected]>
Co-authored-by: Quentin Champenois <[email protected]>
Co-authored-by: Quentin <[email protected]>
Co-authored-by: AyakorK <[email protected]>
  • Loading branch information
4 people authored Oct 26, 2023
2 parents 67b1c18 + 825e8e9 commit 558fde6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
24 changes: 24 additions & 0 deletions app/packs/stylesheets/decidim/decidim_application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,28 @@ body, h1, h2, h3, h4, h5, h6, p, a, span {
border-color: transparent;
}
}
}

.g-language-choose-medium {
.goog-te-gadget {
text-indent: -9999px;
font-size: 0;

& > span {
display: none;
}

& > div {
text-indent: 0;
}

select {
font-family: $body-font-family;
font-size: 1rem;
text-align: center;
background-color: transparent;
color: var(--secondary);
border-color: transparent;
}
}
}
3 changes: 3 additions & 0 deletions app/views/layouts/decidim/_language_chooser.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@
<div class="topbar__dropmenu language-choose g-language-choose show-for-medium" data-set="language-holder">
<div class="js-append" id="google_translate_element"></div>
</div>
<div class="g-language-choose-medium hide-for-medium" data-set="language-holder">
<div class="js-append" id="google_translate_element"></div>
</div>
<% end %>
30 changes: 27 additions & 3 deletions app/views/layouts/decidim/_wrapper.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@ end
<span aria-hidden="true">&times;</span>
</button>
<!-- Menu -->
<div class="hide-for-medium" data-set="nav-holder"></div>
<div class="hide-for-medium" data-set="nav-holder">
<div class="navbar js-append">
<div class="row column">
<nav class="main-nav">
<ul>
<li class="main-nav__link">
<a class="main-nav" href="/processes/Citywidepb2023">About</a>
</li>
<li class="main-nav__link">
<a class="main-nav" href="/processes/vote">Election Center</a>
</li>
</ul>
</nav>
</div>
</div>
</div>

<div class="hide-for-medium usermenu-off-canvas-holder"
data-set="nav-login-holder"></div>
<div class="hide-for-medium mt-s ml-s mr-s search-off-canvas-holder"
Expand Down Expand Up @@ -62,7 +78,9 @@ end
</div>

<% if current_user %>
<%= render partial: "layouts/decidim/language_chooser" %>
<div class="topbar__dropmenu language-choose g-language-choose show-for-medium" data-set="language-holder">
<div class="js-append" id="google_translate_element"></div>
</div>
<%= render partial: "layouts/decidim/social_media_links" %>
<%= render partial: "layouts/decidim/admin_links" %>
<nav class="topbar__dropmenu topbar__user__logged" aria-label="<%= t("layouts.decidim.header.user_menu") %>">
Expand All @@ -88,17 +106,23 @@ end
<ul class="menu is-dropdown-submenu js-append usermenu-off-canvas">
<%= render partial: "layouts/decidim/user_menu" %>
</ul>
<div class="js-append hide-for-medium">
<%= render partial: "layouts/decidim/language_chooser" %>
</div>
</div>
</li>
</ul>

</nav>
<% else %>
<div class="topbar__user show-for-medium" data-set="nav-login-holder">
<div class="topbar__user__login js-append">
<%= link_to t("layouts.decidim.header.sign_in"), decidim.new_user_session_path, class: "sign-in-link" %>
</div>
<div class="js-append">
<%= render partial: "layouts/decidim/language_chooser" %>
</div>
</div>
<%= render partial: "layouts/decidim/language_chooser" %>
<%= render partial: "layouts/decidim/social_media_links" %>
<%= render partial: "layouts/decidim/admin_links" %>
<% end %>
Expand Down

0 comments on commit 558fde6

Please sign in to comment.