mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
Delete button on OP deletes topic
This commit is contained in:
parent
084a873b91
commit
e98fb5592d
|
@ -50,12 +50,18 @@ window.Discourse.PostMenuView = Ember.View.extend Discourse.Presence,
|
|||
# Delete button
|
||||
renderDelete: (post, buffer) ->
|
||||
|
||||
if post.get('post_number') == 1 and @get('controller.content.can_delete')
|
||||
buffer.push("<button title=\"#{Em.String.i18n("topic.actions.delete")}\" data-action=\"deleteTopic\"><i class=\"icon-trash\"></i></button>")
|
||||
return
|
||||
|
||||
# Show the correct button
|
||||
if post.get('deleted_at')
|
||||
if post.get('can_recover')
|
||||
buffer.push("<button title=\"#{Em.String.i18n("post.controls.undelete")}\" data-action=\"recover\"><i class=\"icon-undo\"></i></button>")
|
||||
else if post.get('can_delete')
|
||||
buffer.push("<button title=\"#{Em.String.i18n("post.controls.delete")}\" data-action=\"delete\"><i class=\"icon-trash\"></i></button>")
|
||||
|
||||
clickDeleteTopic: -> @get('controller').deleteTopic()
|
||||
clickRecover: -> @get('controller').recoverPost(@get('post'))
|
||||
clickDelete: -> @get('controller').deletePost(@get('post'))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user