<%= t('page.listing', :model => t('activerecord.models.subject')) -%>

<%= link_to @classification.category, @classification -%>

<%= form_for :subjects, :url => classification_subjects_path(@classification), :html => {:method => 'get'} do -%>

<%= t('page.search_term') -%>: <%= search_field_tag 'query', h(@query), {:id => 'search_form_top', :class => 'search_form', :placeholder => t('page.search_term')} -%> <%= submit_tag t('page.search') -%> <%- if can? :create, WorkHasSubject -%> <%= render 'page/add' %> <%- end -%>

<%- end -%>
<%- subjects.each do |subject| -%> "> <%- end -%>
<%= t('activerecord.attributes.subject.term') -%>
<%= link_to subject.term, subject -%> <%- if can? :update, subject -%> <%= link_to t('page.edit'), edit_subject_path(subject) -%> <% end %> <%- if params[:mode] == 'add' -%> <%- if can? :update, subject -%> <%= link_to t('page.add'), new_classification_subject_has_classification_path(@classification, :subject_id => subject.id) unless @classification.subjects.include?(subject) -%> <% end %> <%- else -%> <%- has_classification = @classification.subject_has_classifications.find_by_subject_id(subject) -%> <% if can? :delete, has_classification %> <%= link_to t('page.destroy'), classification_subject_has_classification_path(@classification, has_classification), :data => {:confirm => t('page.are_you_sure')}, :method => :delete if has_classification -%> <% end %> <%- end -%>
<%= paginate(subjects) -%>