committed by
Joffrey JAFFEUX
parent
c617e512ad
commit
4b455e741e
@@ -1,6 +1,7 @@
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||
import { propertyNotEqual } from "discourse/lib/computed";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend(bufferedProperty("model"), {
|
||||
adminBadges: Ember.inject.controller(),
|
||||
@@ -17,14 +18,13 @@ export default Ember.Controller.extend(bufferedProperty("model"), {
|
||||
readOnly: Ember.computed.alias("buffered.system"),
|
||||
showDisplayName: propertyNotEqual("name", "displayName"),
|
||||
|
||||
hasQuery: function() {
|
||||
const bQuery = this.get("buffered.query");
|
||||
if (bQuery) {
|
||||
return bQuery.trim().length > 0;
|
||||
@computed("model.query", "buffered.query")
|
||||
hasQuery(modelQuery, bufferedQuery) {
|
||||
if (bufferedQuery) {
|
||||
return bufferedQuery.trim().length > 0;
|
||||
}
|
||||
const mQuery = this.get("model.query");
|
||||
return mQuery && mQuery.trim().length > 0;
|
||||
}.property("model.query", "buffered.query"),
|
||||
return modelQuery && modelQuery.trim().length > 0;
|
||||
},
|
||||
|
||||
_resetSaving: function() {
|
||||
this.set("saving", false);
|
||||
|
||||
+4
-3
@@ -1,17 +1,18 @@
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend(bufferedProperty("emailTemplate"), {
|
||||
saved: false,
|
||||
|
||||
hasMultipleSubjects: function() {
|
||||
const buffered = this.get("buffered");
|
||||
@computed("buffered")
|
||||
hasMultipleSubjects(buffered) {
|
||||
if (buffered.getProperties("subject")["subject"]) {
|
||||
return false;
|
||||
} else {
|
||||
return buffered.getProperties("id")["id"];
|
||||
}
|
||||
}.property("buffered"),
|
||||
},
|
||||
|
||||
actions: {
|
||||
saveChanges() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { exportEntity } from "discourse/lib/export-csv";
|
||||
import { outputExportResult } from "discourse/lib/export-result";
|
||||
import StaffActionLog from "admin/models/staff-action-log";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
loading: false,
|
||||
@@ -20,14 +21,14 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
}.observes("filterActionId"),
|
||||
|
||||
actionFilter: function() {
|
||||
var name = this.get("filters.action_name");
|
||||
@computed("filters.action_name")
|
||||
actionFilter(name) {
|
||||
if (name) {
|
||||
return I18n.t("admin.logs.staff_actions.actions." + name);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}.property("filters.action_name"),
|
||||
},
|
||||
|
||||
showInstructions: Ember.computed.gt("model.length", 0),
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
@computed
|
||||
adminRoutes: function() {
|
||||
return this.get("model")
|
||||
.map(p => {
|
||||
@@ -7,7 +10,8 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
})
|
||||
.compact();
|
||||
}.property(),
|
||||
},
|
||||
|
||||
actions: {
|
||||
clearFilter() {
|
||||
this.setProperties({ filter: "", onlyOverridden: false });
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import GrantBadgeController from "discourse/mixins/grant-badge-controller";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend(GrantBadgeController, {
|
||||
adminUser: Ember.inject.controller(),
|
||||
@@ -10,7 +11,8 @@ export default Ember.Controller.extend(GrantBadgeController, {
|
||||
sortedBadges: Ember.computed.sort("model", "badgeSortOrder"),
|
||||
badgeSortOrder: ["granted_at:desc"],
|
||||
|
||||
groupedBadges: function() {
|
||||
@computed("model", "model.[]", "model.expandedBadges.[]")
|
||||
groupedBadges() {
|
||||
const allBadges = this.get("model");
|
||||
|
||||
var grouped = _.groupBy(allBadges, badge => badge.badge_id);
|
||||
@@ -46,7 +48,7 @@ export default Ember.Controller.extend(GrantBadgeController, {
|
||||
.sortBy(group => group.granted_at)
|
||||
.reverse()
|
||||
.value();
|
||||
}.property("model", "model.[]", "model.expandedBadges.[]"),
|
||||
},
|
||||
|
||||
actions: {
|
||||
expandGroup: function(userBadge) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import debounce from "discourse/lib/debounce";
|
||||
import { i18n } from "discourse/lib/computed";
|
||||
import AdminUser from "admin/models/admin-user";
|
||||
import CanCheckEmails from "discourse/mixins/can-check-emails";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend(CanCheckEmails, {
|
||||
model: null,
|
||||
@@ -14,9 +15,10 @@ export default Ember.Controller.extend(CanCheckEmails, {
|
||||
selectAll: false,
|
||||
searchHint: i18n("search_hint"),
|
||||
|
||||
title: function() {
|
||||
return I18n.t("admin.users.titles." + this.get("query"));
|
||||
}.property("query"),
|
||||
@computed("query")
|
||||
title(query) {
|
||||
return I18n.t("admin.users.titles." + query);
|
||||
},
|
||||
|
||||
_filterUsers: debounce(function() {
|
||||
this._refreshUsers();
|
||||
|
||||
Reference in New Issue
Block a user