themen scope+ fix search

This commit is contained in:
Andreas Stephanides
2014-10-21 13:29:42 +02:00
parent ba8a20c3d1
commit 42ecb7dbcb
4 changed files with 18 additions and 13 deletions

View File

@@ -23,9 +23,9 @@ class ThemengruppenController < ApplicationController
def show
@themengruppe = Themengruppe.find(params[:id])
if can? :showdraft , Thema
@themen = @themengruppe.themen.order(:priority).reverse
@themen = @themengruppe.themen
else
@themen = @themengruppe.themen.where(:isdraft=>false).order(:priority).reverse
@themen = @themengruppe.themen.public
end
@toolbar_elements = []
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe