more work on comments for events

This commit is contained in:
Kyle Drake 2014-05-01 19:20:34 -07:00
parent eba4a6e3f5
commit b96730b83f
17 changed files with 2298 additions and 43 deletions

8
app.rb
View file

@ -865,6 +865,14 @@ post '/event/:event_id/toggle_like' do |event_id|
{result: liked_response, event_like_count: event.likes_dataset.count}.to_json
end
post '/event/:event_id/comment' do |event_id|
require_login
content_type :json
event = Event[id: event_id]
event.add_site_comment current_site, params[:comment]
{result: 'ok'}.to_json
end
def require_admin
redirect '/' unless signed_in? && current_site.is_admin
end