forked from bofh/fetsite
meeting
This commit is contained in:
@@ -2,12 +2,41 @@ class MeetingsController < ApplicationController
|
||||
|
||||
|
||||
|
||||
load_and_authorize_resource
|
||||
# load_and_authorize_resource
|
||||
def index
|
||||
parent=params[:parent_type].constantize.find(params[:parent_id])
|
||||
unless parent.nil?
|
||||
#authorize! :show, parent
|
||||
if params[:filter]=="upcomming"
|
||||
@meetings=parent.meetings.includes(:calentry).where("calentries.start>?",1.hour.ago)
|
||||
else
|
||||
@meetings=parent.meetings
|
||||
end
|
||||
@parent=parent
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html {redirect_to rubriken_path}
|
||||
format.js
|
||||
end
|
||||
end
|
||||
def announce
|
||||
m=Meeting.find(params[:id])
|
||||
m.create_announcement(current_user)
|
||||
m.save
|
||||
|
||||
respond_to do |format|
|
||||
format.html {redirect_to m.parent}
|
||||
format.js {render action: :show}
|
||||
end
|
||||
end
|
||||
def show
|
||||
m=Meeting.find(params[:id])
|
||||
respond_to do |format|
|
||||
format.html {redirect_to m.parent}
|
||||
format.js
|
||||
|
||||
end
|
||||
end
|
||||
def new
|
||||
@meeting=Meeting.new
|
||||
@meeting.parent=params[:parent_type].constantize.find(params[:parent_id])
|
||||
|
||||
@@ -112,13 +112,13 @@ class NeuigkeitenController < ApplicationController
|
||||
end
|
||||
|
||||
@calentries1=@neuigkeit.calentries
|
||||
@nlink_search = Neuigkeit::LINKTYPES.clone
|
||||
nlink_search = Neuigkeit::LINKTYPES.clone
|
||||
nlink_search.collect!{|t| t.constantize}
|
||||
# @nlink_search.collect!{|t| t.search(params[:query]).limit(2)}
|
||||
@results= Sunspot.search nlink_search do
|
||||
fulltext params[:query]
|
||||
end
|
||||
|
||||
@nlink_search.collect!{|t| t.constantize}
|
||||
@nlink_search.collect!{|t| t.search(params[:query]).limit(2)}
|
||||
|
||||
|
||||
@nlink_search.flatten!
|
||||
respond_to do |format|
|
||||
format.html { render action:"show" }
|
||||
format.js
|
||||
|
||||
@@ -29,7 +29,7 @@ class RubrikenController < ApplicationController
|
||||
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
@moderatoren=User.with_role(:newsmoderator,@rubrik)
|
||||
@calentries= @rubrik.calentries
|
||||
@calentries= @rubrik.calendar.calentries
|
||||
if can?(:showunpublished, Neuigkeit)
|
||||
@neuigkeiten = @rubrik.neuigkeiten.page(params[:page]).per(3)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user