mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
flagging workflow changes per http://meta.discourse.org/t/we-need-an-archive-flag-notification-button/7450
This commit is contained in:
@@ -14,15 +14,32 @@ Discourse.AdminFlagsController = Ember.ArrayController.extend({
|
||||
@method clearFlags
|
||||
@param {Discourse.FlaggedPost} item The post whose flags we want to clear
|
||||
**/
|
||||
clearFlags: function(item) {
|
||||
disagreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.clearFlags().then((function() {
|
||||
item.disagreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
agreeFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.agreeFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
|
||||
deferFlags: function(item) {
|
||||
var adminFlagsController = this;
|
||||
item.deferFlags().then((function() {
|
||||
adminFlagsController.removeObject(item);
|
||||
}), function() {
|
||||
bootbox.alert(Em.String.i18n("admin.flags.error"));
|
||||
});
|
||||
},
|
||||
/**
|
||||
Deletes a post
|
||||
|
||||
|
||||
@@ -63,10 +63,22 @@ Discourse.FlaggedPost = Discourse.Post.extend({
|
||||
}
|
||||
},
|
||||
|
||||
clearFlags: function() {
|
||||
return Discourse.ajax("/admin/flags/clear/" + this.id, { type: 'POST', cache: false });
|
||||
disagreeFlags: function() {
|
||||
return Discourse.ajax("/admin/flags/disagree/" + this.id, { type: 'POST', cache: false });
|
||||
},
|
||||
|
||||
deferFlags: function() {
|
||||
return Discourse.ajax("/admin/flags/defer/" + this.id, { type: 'POST', cache: false });
|
||||
},
|
||||
|
||||
agreeFlags: function() {
|
||||
return Discourse.ajax("/admin/flags/agree/" + this.id, { type: 'POST', cache: false });
|
||||
},
|
||||
|
||||
postHidden: function() {
|
||||
return (this.get('hidden') === "t");
|
||||
}.property(),
|
||||
|
||||
hiddenClass: function() {
|
||||
if (this.get('hidden') === "t") return "hidden-post";
|
||||
}.property()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each flag in content}}
|
||||
<tr {{bindAttr class="hiddenClass"}}>
|
||||
<tr {{bindAttr class="flag.hiddenClass"}}>
|
||||
<td class='user'>{{#linkTo 'adminUser' flag.user}}{{avatar flag.user imageSize="small"}}{{/linkTo}}</td>
|
||||
<td class='excerpt'>{{#if flag.topicHidden}}<i title='{{i18n topic_statuses.invisible.help}}' class='icon icon-eye-close'></i> {{/if}}<h3><a href='{{unbound flag.url}}'>{{flag.title}}</a></h3><br>{{{flag.excerpt}}}
|
||||
</td>
|
||||
@@ -33,8 +33,15 @@
|
||||
<td class='last-flagged'>{{date flag.lastFlagged}}</td>
|
||||
<td class='action'>
|
||||
{{#if adminActiveFlagsView}}
|
||||
<button title='{{i18n admin.flags.clear_title}}' class='btn' {{action clearFlags flag}}>{{i18n admin.flags.clear}}</button>
|
||||
<button title='{{i18n admin.flags.delete_title}}' class='btn' {{action deletePost flag}}>{{i18n admin.flags.delete}}</button>
|
||||
{{#if flag.postHidden}}
|
||||
<button title='{{i18n admin.flags.disagree_unhide_title}}' class='btn' {{action disagreeFlags flag}}>{{i18n admin.flags.disagree_unhide}}</button>
|
||||
<button title='{{i18n admin.flags.defer_title}}' class='btn' {{action deferFlags flag}}>{{i18n admin.flags.defer}}</button>
|
||||
{{else}}
|
||||
<button title='{{i18n admin.flags.agree_hide_title}}' class='btn' {{action agreeFlags flag}}>{{i18n admin.flags.agree_hide}}</button>
|
||||
<button title='{{i18n admin.flags.disagree_title}}' class='btn' {{action disagreeFlags flag}}>{{i18n admin.flags.disagree}}</button>
|
||||
{{/if}}
|
||||
|
||||
<button title='{{i18n admin.flags.delete_post_title}}' class='btn' {{action deletePost flag}}>{{i18n admin.flags.delete_post}}</button>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -286,6 +286,10 @@ table {
|
||||
.flaggers { padding: 0 10px; }
|
||||
.last-flagged { padding: 0 10px; }
|
||||
.flag-summary { font-size: 11px; }
|
||||
.action {
|
||||
button { margin: 4px; display: block;}
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dashboard */
|
||||
|
||||
Reference in New Issue
Block a user