Skip to content

Commit

Permalink
Change main menu (part II) (#112)
Browse files Browse the repository at this point in the history
* Rename 'Welcome' to 'Start here'

* Add 'Home' link in menu

* Fix menu on medium breakpoints

Suggested on code review
  • Loading branch information
andreslucena authored Nov 17, 2022
1 parent 477504b commit de288f1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
15 changes: 15 additions & 0 deletions app/packs/stylesheets/decidim/metadecidim-theme/_navbar.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
.main-nav__link a {
@include breakpoint(medium) {
padding: 0.75em 1em;
font-size: .9rem;
}

@include breakpoint(large) {
font-size: 1rem;
}
}

.topbar__search {
@include breakpoint(medium) {
max-width: 120px;
}

@include breakpoint(large) {
max-width: 220px;
}
}
14 changes: 10 additions & 4 deletions config/initializers/metadecidim_menu.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# frozen_string_literal: true

Decidim.menu :metadecidim_menu do |menu|
welcome_path = Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_path("Welcome")
menu.add_item :welcome,
I18n.t("menu.welcome", scope: "decidim"),
welcome_path,
menu.add_item :root,
I18n.t("menu.home", scope: "decidim"),
decidim.root_path,
position: 1,
active: :exclusive

start_here_path = Decidim::ParticipatoryProcesses::Engine.routes.url_helpers.participatory_process_path("Welcome")
menu.add_item :start_here,
I18n.t("menu.start_here", scope: "decidim"),
start_here_path,
position: 10,
active: :inclusive

Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ en:
meetings: Meetings
news: News
participate: Participate
welcome: Welcome
start_here: Start here
sms:
text: "Your code to be verified at Metadecidim is: %{code}"
layouts:
Expand Down
3 changes: 2 additions & 1 deletion spec/features/menu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
visit decidim.root_path

within ".navbar" do
expect(page).to have_content("Welcome")
expect(page).to have_content("Home")
expect(page).to have_content("Start here")
expect(page).to have_content("Participate")
expect(page).to have_content("Meetings")
expect(page).to have_content("Our governance")
Expand Down

0 comments on commit de288f1

Please sign in to comment.