mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 03:48:22 +02:00
editing for profile comments
This commit is contained in:
parent
f681e6c704
commit
6277a94a5b
12 changed files with 80 additions and 13 deletions
12
app.rb
12
app.rb
|
@ -869,10 +869,20 @@ 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]
|
||||
event.add_site_comment current_site, params[:message]
|
||||
{result: 'ok'}.to_json
|
||||
end
|
||||
|
||||
post '/event/:event_id/update_profile_comment' do |event_id|
|
||||
require_login
|
||||
content_type :json
|
||||
event = Event[id: event_id]
|
||||
return {result: 'error'}.to_json unless current_site.id == event.profile_comment.actioning_site_id
|
||||
|
||||
event.profile_comment.update message: params[:message]
|
||||
return {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