app/views/concepts/hierarchical/_treeview.html.erb in iqvoc-4.1.0 vs app/views/concepts/hierarchical/_treeview.html.erb in iqvoc-4.1.1

- old
+ new

@@ -1,20 +1,18 @@ -<%- hcpath = hierarchical_concepts_path(:format => :json, - :published => params[:published], :broader => broader || nil) -%> +<% hcpath = hierarchical_concepts_path(:format => :json, :published => params[:published], :broader => broader || nil) %> <ul class="hybrid-treeview" data-url="<%= hcpath %>"> + <% concepts.select { |c| can? :read, c }.each do |concept| %> + <% has_children = broader ? concept.broader_relations.any? : concept.narrower_relations.any? %> - <%- concepts.each do |concept| -%> - <%- has_children = broader ? concept.broader_relations.any? : concept.narrower_relations.any? -%> - <li class="<%= has_children ? "hasChildren" : "" %>" id="<%= concept.id %>"> <%= link_to(concept.pref_label.to_s, concept_url(:id => concept)) %> - <%- if concept.additional_info.present? -%> + <% if concept.additional_info.present? %> (<%= concept.additional_info %>) - <%- end -%> - <%- if has_children -%> + <% end %> + <% if has_children %> <ul> <li><span class="placeholder">&nbsp;</span></li> </ul> - <%- end -%> + <% end %> </li> - <%- end -%> + <% end %> </ul>