redmine_glossary/app/views/glossary_terms/index.html.erb

23 lines
696 B
Plaintext
Raw Normal View History

<h2><%=l :label_glossary_terms %></h2>
2018-05-01 17:42:01 +02:00
2018-05-05 14:04:21 +02:00
<div class="contextual">
<%= link_to_if_authorized l(:label_glossary_term_new),
{ controller: :glossary_terms, action: :new, project_id: @project },
class: 'icon icon-add' %>
2018-05-05 14:04:21 +02:00
</div>
<%= render partial: 'sidebar' %>
<% categorized_terms = @glossary_terms.reject { |t| t.category_id.nil? } %>
<% uncategorized_terms = @glossary_terms.where(category_id: nil) %>
<% categorized_terms.group_by(&:category).each do |category, terms| %>
<h3><%= category.name %></h3>
<%= render partial: 'index_in_category', locals: {terms: terms} %>
<% end %>
<h3><%=l :label_not_categorized %></h3>
<%= render 'index_in_category', terms: uncategorized_terms %>