mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
star voting system for proposals
This commit is contained in:
parent
2314d943e1
commit
834362491e
17 changed files with 157 additions and 3 deletions
|
|
@ -26,6 +26,7 @@ class Admin::EventsController < ApplicationController
|
|||
@event_types = @conference.event_types
|
||||
@comments = @event.root_comments
|
||||
@comment_count = @event.comment_threads.count
|
||||
@ratings = @event.votes.includes(:person)
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
@ -76,4 +77,18 @@ class Admin::EventsController < ApplicationController
|
|||
expire_page :controller => '/schedule', :action => :index
|
||||
redirect_to(admin_conference_events_path(:conference_id => @conference.short_title), :notice => "Updated state")
|
||||
end
|
||||
|
||||
def vote
|
||||
event = Event.find(params[:id])
|
||||
|
||||
if votes = current_user.person.votes.find_by_event_id(params[:id])
|
||||
votes.update_attributes(:rating => params[:rating])
|
||||
else
|
||||
@myvote = event.votes.build
|
||||
@myvote.person = current_user.person
|
||||
@myvote.rating = params[:rating]
|
||||
@myvote.save
|
||||
end
|
||||
redirect_to admin_conference_event_path(@conference.short_title, event)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue