<% if can? :show, small %>

<%= link_to small.title,small %> <% if can?(:edit,small) %> <% end %>

<%= image_tag small.titlepics.first.datei.url unless small.titlepics.first.nil? %> <% if small.is_outdated? %>
<%= I18n.t("thema.outdated") %> <%= link_to"Als aktuell markieren",is_updated_thema_path(small), :class=>:btn if can? :is_updated, small%>
<% end %> <% if small.isdraft %>
<%= I18n.t("thema.isdraft") %>
<% end %>
<%= raw(small.text) %>

<%= raw("FAQs:") unless small.fragen.empty? %>
<% small.fragen.each do |frage| %>

<%= frage.title %>
<%= raw(frage.text) %>

<% end %> <% if can?(:edit,small) %>
<% if !small.meetings.empty? %> Treffen/Sitzungen <%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
<%= render :partial=>"meetings/meeting_list", object: small.meetings, locals: {parent: small} %> <% end %> <% end %> <% if can?(:edit,small) %>
<% unless small.documents.empty? %> Dokumente <%= link_to "Neues Dokument", new_document_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %> <% small.documents.each do |d| %> <%= render d %> <% end%> <% end%> <% end%> <% unless small.hideattachment %> <%= render partial: "attachments/attachment_list", object: small.attachments, locals:{editor: false, parent: small} unless small.attachments.empty? %> <% end %>
<% @small_elements = [] @small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small @small_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('thema.remove'), :path=>small, :method=>:delete,:confirm=>I18n.t('thema.sure')} if can? :delete, small %> <% render :partial=>'layouts/pretty_toolbar', :object=>@small_elements unless @small_elements.empty? %> <% else %> Error <% end %>
<%= render_attachments_for(small) %>