mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
news feed: confirm before removal of event
This commit is contained in:
parent
5adef9adb9
commit
b5ca5f0bc9
2 changed files with 25 additions and 1 deletions
|
@ -107,4 +107,12 @@ class Event < Sequel::Model
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def name
|
||||||
|
return 'follow' if follow_id
|
||||||
|
return 'tip' if tip_id
|
||||||
|
return 'tag' if tag_id
|
||||||
|
return 'site change' if site_change_id
|
||||||
|
return 'comment' if profile_comment_id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,7 +15,23 @@
|
||||||
<a id="editLink" href="#" onclick="ProfileComment.displayEditor('<%= event.id %>'); return false">Edit</a>
|
<a id="editLink" href="#" onclick="ProfileComment.displayEditor('<%= event.id %>'); return false">Edit</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if event.created_by?(current_site) || event.site_id == current_site.id %>
|
<% if event.created_by?(current_site) || event.site_id == current_site.id %>
|
||||||
<a href="#" onclick="Event.delete(<%= event.id %>, '<%= csrf_token %>'); return false">Delete</a>
|
<a href="#deleteEvent<%= event.id %>" data-toggle="modal">Delete</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal hide fade" id="deleteEvent<%= event.id %>" tabindex="-1" role="dialog" aria-labelledby="deleteEventLabel<%= event.id %>" aria-hidden="true">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button class="close" type="button" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
|
||||||
|
<h3 id="addTagLabel">Delete</h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<p>
|
||||||
|
Are you sure you want to remove this <%= event.name %> from the news feed?
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn cancel" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
||||||
|
<button type="submit" class="btn-Action" onclick="Event.delete(<%= event.id %>, '<%= csrf_token %>'); return false">Delete</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Add table
Reference in a new issue