Skip to content

Commit

Permalink
add mobile search block
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed May 27, 2024
1 parent e25693a commit a12d869
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
<h3 class="menu-bar__main-dropdown__title"><%= t("decidim.pages.home.footer_sub_hero.footer_sub_hero_headline", organization: current_organization.name) %></h3>
<p class="menu-bar__main-dropdown__subtitle"><%= organization_description_label %></p>
<div class="main-bar__links-mobile__search-block">
<div class="-translate-y-full">
<%= form_tag(decidim.search_path, method: :get, class: "filter-search") do %>
<%= text_field_tag(
:term,
nil,
id: "input-search-mobile",
value: params[:term] || params.dig(:filter, :term),
placeholder: t("decidim.search.term_input_placeholder"),
title: t("decidim.search.term_input_placeholder"),
"aria-label": t("decidim.search.term_input_placeholder"),
tabindex: "0"
) %>
<button type="submit" aria-label="<%= t("decidim.search.term_input_placeholder") %>">
<%= icon "search-line" %>
</button>
<% end %>
</div>
</div>
10 changes: 5 additions & 5 deletions decidim-core/spec/system/mobile_header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Capybara.current_driver = :iphone
switch_to_host(organization.host)
visit decidim.root_path
click_button "Accept all"
click_link_or_button "Accept all"
end

it "has a login link" do
Expand All @@ -19,13 +19,13 @@

context "when user login is confirmed" do
before do
switch_to_host(organization.host)
login_as user, scope: :user
visit decidim.root_path
switch_to_host(organization.host)
login_as user, scope: :user
visit decidim.root_path
end

it "displays an avatar on the header" do
expect(page).to have_css(".main-bar__avatar")
expect(page).to have_css(".main-bar__avatar")
end
end
end

0 comments on commit a12d869

Please sign in to comment.