thmen nur rendern wenn erlaubt

This commit is contained in:
2014-07-23 22:57:40 +05:30
parent 74546b1d8d
commit 3347ac89d9
3 changed files with 7 additions and 3 deletions

View File

@@ -6,8 +6,8 @@ Verwendung: Aufruf mit
-->
<% toolbar_elements = !pretty_toolbar.nil? ? pretty_toolbar : @toolbar_elements %>
<% unless toolbar_elements.nil? || toolbar_elements.empty? %>
<span class="label"><%= I18n.t("common.actions")%></span>
<div class="btn-group">
<!--<span class="label"><% I18n.t("common.actions")%></span>
--><div class="btn-group">
<% toolbar_elements.each do |t| %>
<% unless t[:method]==:versions %>
<% text='<i class="'.html_safe+ t[:hicon].to_s.html_safe + '"></i>'.html_safe+t[:text] %>

View File

@@ -1,3 +1,4 @@
<% 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>
@@ -30,3 +31,6 @@
@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 %>

View File

@@ -1,2 +1,2 @@
<%= thema.title%>
<%= thema.title if can? :show , thema %>