discourse/app/assets/javascripts/admin/helpers/disposition-icon.js.es6

27 lines
576 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import { iconHTML } from "discourse-common/lib/icon-library";
2017-09-12 04:44:20 +08:00
export default Ember.Helper.extend({
compute([disposition]) {
2018-06-15 23:03:24 +08:00
if (!disposition) {
return null;
}
2017-09-12 04:44:20 +08:00
let icon;
2018-06-15 23:03:24 +08:00
let title = "admin.flags.dispositions." + disposition;
2017-09-12 04:44:20 +08:00
switch (disposition) {
2018-06-15 23:03:24 +08:00
case "deferred": {
icon = "external-link";
break;
}
case "agreed": {
icon = "thumbs-o-up";
break;
}
case "disagreed": {
icon = "thumbs-o-down";
break;
}
2017-09-12 04:44:20 +08:00
}
return iconHTML(icon, { title }).htmlSafe();
}
});