Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Show edit indicator on review queue
If a flagged post has edits, show the pencil icon and pop up the history window when clicked.
- Loading branch information
Showing
9 changed files
with
122 additions
and
54 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app/assets/javascripts/discourse/components/reviewable-flagged-post.js.es6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import computed from "ember-addons/ember-computed-decorators"; | ||
import { longDate } from "discourse/lib/formatter"; | ||
import { historyHeat } from "discourse/widgets/post-edits-indicator"; | ||
import showModal from "discourse/lib/show-modal"; | ||
|
||
export default Ember.Component.extend({ | ||
hasEdits: Ember.computed.gt("reviewable.version", 1), | ||
|
||
@computed("reviewable.post_updated_at") | ||
historyClass(updatedAt) { | ||
return historyHeat(this.siteSettings, new Date(updatedAt)); | ||
}, | ||
|
||
@computed("reviewable.post_updated_at") | ||
editedDate(updatedAt) { | ||
return longDate(updatedAt); | ||
}, | ||
|
||
actions: { | ||
showEditHistory() { | ||
let postId = this.get("reviewable.post_id"); | ||
this.store.find("post", postId).then(post => { | ||
let historyController = showModal("history", { | ||
model: post, | ||
modalClass: "history-modal" | ||
}); | ||
historyController.refresh(postId, "latest"); | ||
historyController.set("post", post); | ||
historyController.set("topicController", null); | ||
}); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
app/assets/javascripts/discourse/templates/components/reviewable-flagged-post.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15c9b00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has been mentioned on Discourse Meta. There might be relevant details there:
https://meta.discourse.org/t/edited-flagged-posts-leaves-no-paper-trail-of-flagging/107489/17