mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 17:46:05 +02:00
more work on comments for events
This commit is contained in:
parent
eba4a6e3f5
commit
b96730b83f
17 changed files with 2298 additions and 43 deletions
8
app.rb
8
app.rb
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue