This commit is contained in:
Andreas Stephanides
2014-12-14 21:30:21 +01:00
parent aa98919e88
commit 07944bce89
16 changed files with 104 additions and 26 deletions

View File

@@ -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])