Skip to content

Commit

Permalink
Merge pull request #621 from alphagov/fix-publication-sidebar
Browse files Browse the repository at this point in the history
Fix sidebar rendering on publications
  • Loading branch information
sihugh authored Dec 19, 2017
2 parents 80b37de + 5e14841 commit 3e8700b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 1 addition & 5 deletions app/controllers/content_items_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ def present(content_item)
end

def content_item_template
if publication_with_sidebar?
publication_with_sidebar_template_name
else
@content_item.schema_name
end
@content_item.schema_name
end

def render_template
Expand Down
14 changes: 7 additions & 7 deletions app/views/shared/_sidebar_navigation.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<% if local_assigns.has_key?(:tasklist) && current_tasklist_ab_test.show_tasklist_sidebar? %>
<%= render 'shared/sidebar_tasklist', tasklist: tasklist %>
<% elsif @navigation.should_present_taxonomy_navigation? -%>
<div class="column-third add-title-margin">
<%= render partial: 'govuk_component/taxonomy_sidebar', locals: @content_item.taxonomy_sidebar %>
</div>
<% if local_assigns.has_key?(:tasklist_content) && current_tasklist_ab_test.show_tasklist_sidebar? %>
<%= render 'shared/sidebar_tasklist', tasklist_content: tasklist_content %>
<% else %>
<div class="column-third add-title-margin">
<div class="column-third">
<% if @navigation.should_present_taxonomy_navigation? -%>
<%= render partial: 'govuk_component/taxonomy_sidebar', locals: @content_item.taxonomy_sidebar %>
<% else %>
<%= render partial: 'components/related-navigation', locals: @content_item.related_navigation %>
<% end %>
</div>
<% end %>

0 comments on commit 3e8700b

Please sign in to comment.