Files
fetsite/app/views/themen/_small.html.erb

37 lines
1.2 KiB
Plaintext

<% if can? :show, small %>
<a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %></h2>
</a>
<% if small.is_outdated? %>
<div class="sticker sticker-red"> <%= I18n.t("thema.outdated") %> </div>
<% end %>
<% if small.isdraft %>
<div class="sticker sticker-yellow"><%= I18n.t("thema.isdraft") %> </div>
<% end %>
<%= raw(small.text) %>
<br/>
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
<br/>
<% small.fragen.each do |frage| %>
<p>
<b> <%= frage.title %> </b> <br/>
<%= raw(frage.text) %>
</p>
<% end %>
<% unless small.hideattachment %>
<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %>
<% end %>
<br/>
<%
@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 %>