Skip to content

Commit

Permalink
Remove sidebar when conference has no components (decidim#12849)
Browse files Browse the repository at this point in the history
* add conditional render for layouts

* pass rubocop

* adjust column size

* add title to conference spec check

* remove title from spec

* refactor adding a variable
  • Loading branch information
ElviaBth authored May 16, 2024
1 parent dbaeed9 commit 8afa643
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ edit_link(

<%= render partial: "conference_hero" %>

<%= render layout: "layouts/decidim/shared/layout_two_col", locals: { reverse: true, main_enabled: false } do %>
<% layout_style = conference_nav_items(current_participatory_space).any? ? "layout_two_col" : "layout_center" %>
<%= render layout: "layouts/decidim/shared/#{layout_style}", locals: { reverse: true, main_enabled: false, columns: 10 } do %>

<%= participatory_space_floating_help %>

Expand Down
16 changes: 16 additions & 0 deletions decidim-conferences/spec/system/conferences_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@
visit decidim_conferences.conference_path(conference)
end

it "has a sidebar" do
expect(page).to have_css(".conference__nav-container")
end

describe "follow button" do
let!(:user) { create(:user, :confirmed, organization:) }
let(:followable) { conference }
Expand Down Expand Up @@ -267,4 +271,16 @@
end
end
end

describe "when the conference has no components" do
let!(:conference) { base_conference }

before do
visit decidim_conferences.conference_path(conference)
end

it "has no sidebar" do
expect(page).to have_no_css(".conference__nav-container")
end
end
end

0 comments on commit 8afa643

Please sign in to comment.