From ed5b2b868520621d398e63689045d4d3ef01219d Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 23 Jul 2014 22:57:40 +0530 Subject: [PATCH] thmen nur rendern wenn erlaubt --- app/views/layouts/_pretty_toolbar.html.erb | 4 ++-- app/views/themen/_small.html.erb | 4 ++++ app/views/themen/_thema.html.erb | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_pretty_toolbar.html.erb b/app/views/layouts/_pretty_toolbar.html.erb index 3ec90f4..096cac6 100644 --- a/app/views/layouts/_pretty_toolbar.html.erb +++ b/app/views/layouts/_pretty_toolbar.html.erb @@ -6,8 +6,8 @@ Verwendung: Aufruf mit --> <% toolbar_elements = !pretty_toolbar.nil? ? pretty_toolbar : @toolbar_elements %> <% unless toolbar_elements.nil? || toolbar_elements.empty? %> -<%= I18n.t("common.actions")%> -
+
<% toolbar_elements.each do |t| %> <% unless t[:method]==:versions %> <% text=''.html_safe+t[:text] %> diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index dfa0fc3..2e4b269 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -1,3 +1,4 @@ +<% if can? :show, small %>

<%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

@@ -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 %> diff --git a/app/views/themen/_thema.html.erb b/app/views/themen/_thema.html.erb index ede7bb2..7d24eff 100644 --- a/app/views/themen/_thema.html.erb +++ b/app/views/themen/_thema.html.erb @@ -1,2 +1,2 @@ - <%= thema.title%> + <%= thema.title if can? :show , thema %>