From 4fe95cb78ccd21e4d3efe53c7608cf7733e223e6 Mon Sep 17 00:00:00 2001 From: Elvia Benedith <116598037+ElviaBth@users.noreply.github.com> Date: Wed, 15 May 2024 13:47:27 +0200 Subject: [PATCH 1/2] fix main menu language position (#30) * fix main menu language position * fix hompage_spec * fix conferences_spec --- app/helpers/concerns/conference_helper_override.rb | 4 +++- app/packs/stylesheets/partials/_footer.scss | 2 +- spec/system/conferences_spec.rb | 2 +- spec/system/homepage_spec.rb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/helpers/concerns/conference_helper_override.rb b/app/helpers/concerns/conference_helper_override.rb index 7408d403..ed39da96 100644 --- a/app/helpers/concerns/conference_helper_override.rb +++ b/app/helpers/concerns/conference_helper_override.rb @@ -6,13 +6,15 @@ module ConferenceHelperOverride included do alias_method :decidim_conference_nav_items, :conference_nav_items + # rubocop:disable Style/SingleArgumentDig def conference_nav_items(participatory_space) @conference_nav_items ||= begin - divisor = Rails.application.secrets.speakers_divisor[participatory_space.slug.to_sym] + divisor = Rails.application.secrets.speakers_divisor.dig(participatory_space.slug.to_sym) items = decidim_conference_nav_items(participatory_space) items.first[:name] = I18n.t("capital.speakers_divisor.#{divisor.first[:name]}") if participatory_space.speakers.exists? && divisor && divisor&.first&.[](:name) items end end + # rubocop:enable Style/SingleArgumentDig end end diff --git a/app/packs/stylesheets/partials/_footer.scss b/app/packs/stylesheets/partials/_footer.scss index 4e631927..328d910a 100644 --- a/app/packs/stylesheets/partials/_footer.scss +++ b/app/packs/stylesheets/partials/_footer.scss @@ -1,5 +1,5 @@ .main-footer__language { - z-index: 20; + z-index: 21; background-color: white; outline: none !important; width: 10rem; diff --git a/spec/system/conferences_spec.rb b/spec/system/conferences_spec.rb index 6bbd273c..7c8cd513 100644 --- a/spec/system/conferences_spec.rb +++ b/spec/system/conferences_spec.rb @@ -84,7 +84,7 @@ allow(Rails.application.secrets.speakers_divisor).to receive(:dig).with(conference_city.slug.to_sym).and_return(divisor) end - context "when main page" do |_variable| + context "when main page" do before do visit decidim_conferences.conference_path(slug: conference.slug) end diff --git a/spec/system/homepage_spec.rb b/spec/system/homepage_spec.rb index c69102b0..dc211165 100644 --- a/spec/system/homepage_spec.rb +++ b/spec/system/homepage_spec.rb @@ -22,7 +22,7 @@ it "includes the organization logo as its content" do expect(page).to have_css(".main-footer__down") - within ".main-footer__down" do + within ".main-footer__top" do expect(page).to have_css(".footer-logo") expect(page).to have_css(".logos") end From 0b17eec4a6f4e77c85cace80e4a4a264065c6177 Mon Sep 17 00:00:00 2001 From: Elvia Benedith <116598037+ElviaBth@users.noreply.github.com> Date: Wed, 15 May 2024 13:48:24 +0200 Subject: [PATCH 2/2] Delete jump_to when is nothing to show (#33) * create override file * add override file * add script to override * refactor override * add conditional render * change layout * fix homepage system spec * add override file spec * disable rubocop in conference_helper_override * remove byebug * enable rubocop Style/SingleArgumentDig --- .../index/replace_speaker.html.erb.deface | 1 - .../conferences/show/change_layout.html.erb.deface | 10 ++++++++++ spec/lib/overrides_spec.rb | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 app/overrides/decidim/conferences/conferences/show/change_layout.html.erb.deface diff --git a/app/overrides/decidim/conferences/conference_speakers/index/replace_speaker.html.erb.deface b/app/overrides/decidim/conferences/conference_speakers/index/replace_speaker.html.erb.deface index fc10e9ab..53149409 100644 --- a/app/overrides/decidim/conferences/conference_speakers/index/replace_speaker.html.erb.deface +++ b/app/overrides/decidim/conferences/conference_speakers/index/replace_speaker.html.erb.deface @@ -1,7 +1,6 @@ <% divisor = Rails.application.secrets.speakers_divisor.dig(conference.slug.to_sym) %> -
<% if divisor && divisor.respond_to?(:each) %> <% all_filters = divisor.pluck(:position_filter).flatten.filter(&:presence) %> diff --git a/app/overrides/decidim/conferences/conferences/show/change_layout.html.erb.deface b/app/overrides/decidim/conferences/conferences/show/change_layout.html.erb.deface new file mode 100644 index 00000000..4abd2c95 --- /dev/null +++ b/app/overrides/decidim/conferences/conferences/show/change_layout.html.erb.deface @@ -0,0 +1,10 @@ + + +<% +lay = if conference_nav_items(current_participatory_space).empty? + "layouts/decidim/shared/layout_center" + else + "layouts/decidim/shared/layout_two_col" + end +%> +<%= render layout: lay, locals: { reverse: true, main_enabled: false, columns: 10 } do %> \ No newline at end of file diff --git a/spec/lib/overrides_spec.rb b/spec/lib/overrides_spec.rb index bf6535b6..09fc9334 100644 --- a/spec/lib/overrides_spec.rb +++ b/spec/lib/overrides_spec.rb @@ -11,7 +11,8 @@ files: { "/app/controllers/decidim/conferences/conferences_controller.rb" => "4e1bd7427cfd12c79391b451e07a2e2a", "/app/models/decidim/conference.rb" => "095732cb2451adfb9db7a46078dc3a51", - "/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb" => "7f24462f802a2c277697205511103d90" + "/app/cells/decidim/conferences/content_blocks/highlighted_conferences_cell.rb" => "7f24462f802a2c277697205511103d90", + "/app/views/decidim/conferences/conferences/show.html.erb" => "93fa0d48a6117d3b1cb210ad1f17da7e" } }, {