Suggestions
<% if @approaches.length > 0 %>
<% if @approaches.first.changes.empty? %>
No changes necessary.
<% else %>
<%= pluralize(@approaches.length, 'approach') %> in
<%= pluralize(@grouped_approaches.length, 'group') %>
<%= params[:affected_users] ? "– #{params[:affected_users] == 'few' ? "fewer" : "most"} affected users first" : "" %>
<% @grouped_approaches.each_with_index do |grouped_approach, group_index| %>
<% ([grouped_approach.approach] + grouped_approach.similar_approaches).each_with_index do |approach, index| %>
- class="<%= index == 0 ? 'primary' : "secondary" %> group-<%= group_index %>">
Affected users <%= affected_users_count(approach) %>
Complexity <%= approach.weight %>
<%= link_to_function "Diagram", "show_suggest_graph('#{serialize_changes(approach)}', '#{serialize_relevant_roles(approach)}', '#{@context}', relevant_user_ids())", :class => "show-approach" %>
<% approach.changes.each do |action| %>
<% (action.to_a[0].is_a?(Enumerable) ? action.to_a : [action.to_a]).each do |step| %>
-
<%= describe_step(step.to_a, :with_removal => true) %>
<% end %>
<% end %>
<% if index == 0 %>
<% if grouped_approach.similar_approaches.empty? %>
No further suggestions in this group
<% else %>
<%= link_to_function "Show further #{pluralize grouped_approach.similar_approaches.length, "suggestion"} in this group", "show_group_approaches(#{group_index})", :class => "show-others-in-group" %>
<% end %>
<% end %>
<%= link_to_function "Hide further suggestions", "hide_group_approaches(#{group_index})" if index > 0 and index == grouped_approach.similar_approaches.length %>
<% if index == 0 and group_index == 2 and @grouped_approaches.length > 3 %>
- ><%= link_to_function "Show further #{pluralize(@grouped_approaches.length - 3, 'group')}", "show_all_groups(); $(this).up().hide()" %>
<% end %>
<% end %>
<% end %>
<% end %>
<% else %>
No approach found.
<% end %>