abilities und beispiel delete
This commit is contained in:
@@ -7,7 +7,7 @@ class FetprofilesController < ApplicationController
|
||||
|
||||
@fetprofiles = Fetprofile.active.order(:vorname,:nachname)
|
||||
@fetprofiles = Fetprofile.order(:vorname,:nachname) if params[:filter]== "all"
|
||||
@fetprofiles = Fetprofile.where(:active=>false).order(:vorname,:nachname) if params[:filter]== "notactive"
|
||||
@fetprofiles = Fetprofile.where(:active=>false).order(:nachname,:vorname) if params[:filter]== "notactive"
|
||||
|
||||
@gremientabs = Gremium.tabs
|
||||
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('profile.new_profile'),:path => new_fetprofile_path(@fetprofile) } if can? :new, @fetprofile
|
||||
|
||||
@@ -27,10 +27,20 @@ class HomeController < ApplicationController
|
||||
render 'links_notimplemented'
|
||||
end
|
||||
def search
|
||||
|
||||
unless params['query'].nil? || params['query'].empty?
|
||||
@neuigkeiten=Neuigkeit.search(params['query'])
|
||||
if can?(:showintern, Neuigkeit)
|
||||
@neuigkeiten=Neuigkeit.search(params['query'])
|
||||
else
|
||||
@neuigkeiten =Neuigkeit.search(params['query']).public
|
||||
end
|
||||
@fetprofiles = Fetprofile.search(params['query'])
|
||||
@themen=Thema.search(params['query'])
|
||||
if can?(:showintern, Neuigkeit)
|
||||
@themen=Thema.search(params['query'])
|
||||
else
|
||||
@themen=Thema.search(params['query']).public
|
||||
end
|
||||
|
||||
else
|
||||
@neuigkeiten=[]
|
||||
@fetprofiles=[]
|
||||
|
||||
@@ -2,13 +2,15 @@ class RubrikenController < ApplicationController
|
||||
before_filter {@toolbar_elements=[]}
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
if can?(:shownonpublic, Rubrik)
|
||||
if can?(:showintern, Rubrik)
|
||||
@rubriken = Rubrik.all
|
||||
@neuigkeiten = Neuigkeit.recent
|
||||
else
|
||||
@rubriken = Rubrik.where(:public=>true)
|
||||
@neuigkeiten = Neuigkeit.public.recent
|
||||
end
|
||||
@neuigkeiten = @rubriken.collect(&:neuigkeiten).map(&:recent).flatten
|
||||
@calentries= @rubriken.collect(&:calentries).flatten
|
||||
|
||||
@calentries= @rubriken.collect(&:calentries).flatten
|
||||
end
|
||||
def intern
|
||||
|
||||
|
||||
Reference in New Issue
Block a user