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": {
|
2019-01-23 03:42:00 +08:00
|
|
|
icon = "external-link-alt";
|
2018-06-15 23:03:24 +08:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
});
|