Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated guidance on only display once per question. Added break betw… #1829

Merged
merged 2 commits into from
Aug 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 38 additions & 24 deletions app/views/guidance_groups/_index_by_theme.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,48 @@
</div>
</div>
<% guidance_groups_by_theme.each_pair do |guidance_group, theme_hash| %>
<% guidances_output = [] %>
<% theme_hash.each_pair do |theme, guidances| %>
<div class="panel panel-default">
<div
class="heading-button"
role="button"
data-toggle="collapse"
href="<%= "##{guidances.object_id}" %>"
aria-expanded="false"
aria-controls="<%= "##{guidances.object_id}" %>">
<div class="panel-heading" role="tab" id="<%= "panel-heading-#{guidances.object_id}" %>">
<h2 class="panel-title">
<%= theme.title %>
<i class="fa fa-plus pull-right" aria-hidden="true"></i>
</h2>
<%# if guidances with this theme have not been output %>
<% if (guidances.map(&:id) - guidances_output).any? %>
<div class="panel panel-default">
<div
class="heading-button"
role="button"
data-toggle="collapse"
href="<%= "##{guidances.object_id}" %>"
aria-expanded="false"
aria-controls="<%= "##{guidances.object_id}" %>">
<div class="panel-heading" role="tab" id="<%= "panel-heading-#{guidances.object_id}" %>">
<h2 class="panel-title">
<%= theme.title %>
<i class="fa fa-plus pull-right" aria-hidden="true"></i>
</h2>
</div>
</div>
</div>
<div
id="<%= "#{guidances.object_id}" %>"
class="panel-collapse collapse"
role="tabpanel"
aria-labelledby="<%= "panel-heading-#{guidances.object_id}" %>">
<div class="panel-body">
<% guidances.each do |guidance| %>
<%= raw(guidance.text) %>
<% end %>
<div
id="<%= "#{guidances.object_id}" %>"
class="panel-collapse collapse"
role="tabpanel"
aria-labelledby="<%= "panel-heading-#{guidances.object_id}" %>">
<div class="panel-body">
<% multiple = false %>
<% guidances.each do |guidance| %>
<% if multiple %>
<hr>
<% end %>
<p>
<% unless guidances_output.include?(guidance.id) %>
<%= raw(guidance.text) %>
<% guidances_output << guidance.id %>
<% multiple = true %>
<% end %>
</p>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>