committed by
Joffrey JAFFEUX
parent
c617e512ad
commit
4b455e741e
@@ -1,7 +1,10 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
faqOverriden: Ember.computed.gt("siteSettings.faq_url.length", 0),
|
||||
|
||||
contactInfo: function() {
|
||||
@computed
|
||||
contactInfo() {
|
||||
if (this.siteSettings.contact_url) {
|
||||
return I18n.t("about.contact_info", {
|
||||
contact_info:
|
||||
@@ -18,5 +21,5 @@ export default Ember.Controller.extend({
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}.property()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
badgeGroups: function() {
|
||||
var sorted = _.sortBy(this.get("model"), function(badge) {
|
||||
@computed("model")
|
||||
badgeGroups(model) {
|
||||
var sorted = _.sortBy(model, function(badge) {
|
||||
var pos = badge.get("badge_grouping.position");
|
||||
var type = badge.get("badge_type_id");
|
||||
var name = badge.get("name");
|
||||
@@ -31,5 +34,5 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
|
||||
return grouped;
|
||||
}.property("model")
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,9 +12,10 @@ export default Ember.Controller.extend(BadgeSelectController, {
|
||||
application: Ember.inject.controller(),
|
||||
hiddenSetTitle: true,
|
||||
|
||||
filteredList: function() {
|
||||
return this.get("userBadgesAll").filterBy("badge.allow_title", true);
|
||||
}.property("userBadgesAll"),
|
||||
@computed("userBadgesAll")
|
||||
filteredList(userBadgesAll) {
|
||||
return userBadgesAll.filterBy("badge.allow_title", true);
|
||||
},
|
||||
|
||||
@computed("username")
|
||||
user(username) {
|
||||
|
||||
@@ -39,6 +39,7 @@ function loadDraft(store, opts) {
|
||||
((draft.title && draft.title !== "") || (draft.reply && draft.reply !== ""))
|
||||
) {
|
||||
const composer = store.createRecord("composer");
|
||||
|
||||
composer.open({
|
||||
draftKey,
|
||||
draftSequence,
|
||||
@@ -301,14 +302,12 @@ export default Ember.Controller.extend({
|
||||
}
|
||||
},
|
||||
|
||||
showWarning: function() {
|
||||
@computed("model.creatingPrivateMessage", "model.targetUsernames")
|
||||
showWarning(creatingPrivateMessage, usernames) {
|
||||
if (!Discourse.User.currentProp("staff")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var usernames = this.get("model.targetUsernames");
|
||||
var hasTargetGroups = this.get("model.hasTargetGroups");
|
||||
|
||||
// We need exactly one user to issue a warning
|
||||
if (
|
||||
Ember.isEmpty(usernames) ||
|
||||
@@ -317,8 +316,8 @@ export default Ember.Controller.extend({
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return this.get("model.creatingPrivateMessage");
|
||||
}.property("model.creatingPrivateMessage", "model.targetUsernames"),
|
||||
return creatingPrivateMessage;
|
||||
},
|
||||
|
||||
@computed("model.topic")
|
||||
draftTitle(topic) {
|
||||
@@ -1102,15 +1101,13 @@ export default Ember.Controller.extend({
|
||||
$(".d-editor-input").autocomplete({ cancel: true });
|
||||
},
|
||||
|
||||
canEdit: function() {
|
||||
return (
|
||||
this.get("model.action") === "edit" &&
|
||||
Discourse.User.current().get("can_edit")
|
||||
);
|
||||
}.property("model.action"),
|
||||
@computed("model.action")
|
||||
canEdit(action) {
|
||||
return action === "edit" && Discourse.User.current().get("can_edit");
|
||||
},
|
||||
|
||||
visible: function() {
|
||||
var state = this.get("model.composeState");
|
||||
@computed("model.composeState")
|
||||
visible(state) {
|
||||
return state && state !== "closed";
|
||||
}.property("model.composeState")
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
import { setting } from "discourse/lib/computed";
|
||||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
import {
|
||||
default as computed,
|
||||
on
|
||||
} from "ember-addons/ember-computed-decorators";
|
||||
import { emailValid } from "discourse/lib/utilities";
|
||||
import InputValidation from "discourse/models/input-validation";
|
||||
import PasswordValidation from "discourse/mixins/password-validation";
|
||||
@@ -51,7 +54,16 @@ export default Ember.Controller.extend(
|
||||
this._createUserFields();
|
||||
},
|
||||
|
||||
submitDisabled: function() {
|
||||
@computed(
|
||||
"passwordRequired",
|
||||
"nameValidation.failed",
|
||||
"emailValidation.failed",
|
||||
"usernameValidation.failed",
|
||||
"passwordValidation.failed",
|
||||
"userFieldsValidation.failed",
|
||||
"formSubmitted"
|
||||
)
|
||||
submitDisabled() {
|
||||
if (!this.get("emailValidation.failed") && !this.get("passwordRequired"))
|
||||
return false; // 3rd party auth
|
||||
if (this.get("formSubmitted")) return true;
|
||||
@@ -62,51 +74,44 @@ export default Ember.Controller.extend(
|
||||
if (this.get("userFieldsValidation.failed")) return true;
|
||||
|
||||
return false;
|
||||
}.property(
|
||||
"passwordRequired",
|
||||
"nameValidation.failed",
|
||||
"emailValidation.failed",
|
||||
"usernameValidation.failed",
|
||||
"passwordValidation.failed",
|
||||
"userFieldsValidation.failed",
|
||||
"formSubmitted"
|
||||
),
|
||||
},
|
||||
|
||||
usernameRequired: Ember.computed.not("authOptions.omit_username"),
|
||||
|
||||
fullnameRequired: function() {
|
||||
@computed
|
||||
fullnameRequired() {
|
||||
return (
|
||||
this.get("siteSettings.full_name_required") ||
|
||||
this.get("siteSettings.enable_names")
|
||||
);
|
||||
}.property(),
|
||||
},
|
||||
|
||||
passwordRequired: function() {
|
||||
return Ember.isEmpty(this.get("authOptions.auth_provider"));
|
||||
}.property("authOptions.auth_provider"),
|
||||
@computed("authOptions.auth_provider")
|
||||
passwordRequired(authProvider) {
|
||||
return Ember.isEmpty(authProvider);
|
||||
},
|
||||
|
||||
disclaimerHtml: function() {
|
||||
@computed
|
||||
disclaimerHtml() {
|
||||
return I18n.t("create_account.disclaimer", {
|
||||
tos_link: this.get("siteSettings.tos_url") || Discourse.getURL("/tos"),
|
||||
privacy_link:
|
||||
this.get("siteSettings.privacy_policy_url") ||
|
||||
Discourse.getURL("/privacy")
|
||||
});
|
||||
}.property(),
|
||||
},
|
||||
|
||||
// Check the email address
|
||||
emailValidation: function() {
|
||||
@computed("accountEmail", "rejectedEmails.[]")
|
||||
emailValidation(email, rejectedEmails) {
|
||||
// If blank, fail without a reason
|
||||
let email;
|
||||
if (Ember.isEmpty(this.get("accountEmail"))) {
|
||||
if (Ember.isEmpty(email)) {
|
||||
return InputValidation.create({
|
||||
failed: true
|
||||
});
|
||||
}
|
||||
|
||||
email = this.get("accountEmail");
|
||||
|
||||
if (this.get("rejectedEmails").includes(email)) {
|
||||
if (rejectedEmails.includes(email)) {
|
||||
return InputValidation.create({
|
||||
failed: true,
|
||||
reason: I18n.t("user.email.invalid")
|
||||
@@ -138,14 +143,15 @@ export default Ember.Controller.extend(
|
||||
failed: true,
|
||||
reason: I18n.t("user.email.invalid")
|
||||
});
|
||||
}.property("accountEmail", "rejectedEmails.[]"),
|
||||
},
|
||||
|
||||
emailValidated: function() {
|
||||
@computed("accountEmail", "authOptions.email", "authOptions.email_valid")
|
||||
emailValidated() {
|
||||
return (
|
||||
this.get("authOptions.email") === this.get("accountEmail") &&
|
||||
this.get("authOptions.email_valid")
|
||||
);
|
||||
}.property("accountEmail", "authOptions.email", "authOptions.email_valid"),
|
||||
},
|
||||
|
||||
authProviderDisplayName(providerName) {
|
||||
const matchingProvider = findAll().find(provider => {
|
||||
@@ -178,9 +184,10 @@ export default Ember.Controller.extend(
|
||||
}.observes("emailValidation", "accountEmail"),
|
||||
|
||||
// Determines whether at least one login button is enabled
|
||||
hasAtLeastOneLoginButton: function() {
|
||||
@computed
|
||||
hasAtLeastOneLoginButton() {
|
||||
return findAll(this.siteSettings).length > 0;
|
||||
}.property(),
|
||||
},
|
||||
|
||||
@on("init")
|
||||
fetchConfirmationValue() {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { endWith } from "discourse/lib/computed";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
import TopicList from "discourse/models/topic-list";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
const controllerOpts = {
|
||||
discovery: Ember.inject.controller(),
|
||||
@@ -96,26 +97,24 @@ const controllerOpts = {
|
||||
return filter.match(new RegExp(filterType + "$", "gi")) ? true : false;
|
||||
},
|
||||
|
||||
showDismissRead: function() {
|
||||
return (
|
||||
this.isFilterPage(this.get("model.filter"), "unread") &&
|
||||
this.get("model.topics.length") > 0
|
||||
);
|
||||
}.property("model.filter", "model.topics.length"),
|
||||
@computed("model.filter", "model.topics.length")
|
||||
showDismissRead(filter, topicsLength) {
|
||||
return this.isFilterPage(filter, "unread") && topicsLength > 0;
|
||||
},
|
||||
|
||||
showResetNew: function() {
|
||||
return (
|
||||
this.get("model.filter") === "new" && this.get("model.topics.length") > 0
|
||||
);
|
||||
}.property("model.filter", "model.topics.length"),
|
||||
@computed("model.filter", "model.topics.length")
|
||||
showResetNew(filter, topicsLength) {
|
||||
return filter === "new" && topicsLength > 0;
|
||||
},
|
||||
|
||||
showDismissAtTop: function() {
|
||||
@computed("model.filter", "model.topics.length")
|
||||
showDismissAtTop(filter, topicsLength) {
|
||||
return (
|
||||
(this.isFilterPage(this.get("model.filter"), "new") ||
|
||||
this.isFilterPage(this.get("model.filter"), "unread")) &&
|
||||
this.get("model.topics.length") >= 15
|
||||
(this.isFilterPage(filter, "new") ||
|
||||
this.isFilterPage(filter, "unread")) &&
|
||||
topicsLength >= 15
|
||||
);
|
||||
}.property("model.filter", "model.topics.length"),
|
||||
},
|
||||
|
||||
hasTopics: Ember.computed.gt("model.topics.length", 0),
|
||||
allLoaded: Ember.computed.empty("model.more_topics_url"),
|
||||
@@ -128,10 +127,9 @@ const controllerOpts = {
|
||||
weekly: Ember.computed.equal("period", "weekly"),
|
||||
daily: Ember.computed.equal("period", "daily"),
|
||||
|
||||
footerMessage: function() {
|
||||
if (!this.get("allLoaded")) {
|
||||
return;
|
||||
}
|
||||
@computed("allLoaded", "model.topics.length")
|
||||
footerMessage(allLoaded, topicsLength) {
|
||||
if (!allLoaded) return;
|
||||
|
||||
const category = this.get("category");
|
||||
if (category) {
|
||||
@@ -140,7 +138,7 @@ const controllerOpts = {
|
||||
});
|
||||
} else {
|
||||
const split = (this.get("model.filter") || "").split("/");
|
||||
if (this.get("model.topics.length") === 0) {
|
||||
if (topicsLength === 0) {
|
||||
return I18n.t("topics.none." + split[0], {
|
||||
category: split[1]
|
||||
});
|
||||
@@ -150,14 +148,11 @@ const controllerOpts = {
|
||||
});
|
||||
}
|
||||
}
|
||||
}.property("allLoaded", "model.topics.length"),
|
||||
},
|
||||
|
||||
footerEducation: function() {
|
||||
if (
|
||||
!this.get("allLoaded") ||
|
||||
this.get("model.topics.length") > 0 ||
|
||||
!this.currentUser
|
||||
) {
|
||||
@computed("allLoaded", "model.topics.length")
|
||||
footerEducation(allLoaded, topicsLength) {
|
||||
if (!allLoaded || topicsLength > 0 || !this.currentUser) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -173,7 +168,7 @@ const controllerOpts = {
|
||||
`${this.currentUser.get("username_lower")}/preferences`
|
||||
)
|
||||
});
|
||||
}.property("allLoaded", "model.topics.length")
|
||||
}
|
||||
};
|
||||
|
||||
Object.keys(queryParams).forEach(function(p) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { extractError } from "discourse/lib/ajax-error";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
// Modal for editing / creating a category
|
||||
export default Ember.Controller.extend(ModalFunctionality, {
|
||||
@@ -28,39 +29,44 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
}
|
||||
}.observes("model.description"),
|
||||
|
||||
title: function() {
|
||||
if (this.get("model.id")) {
|
||||
@computed("model.id", "model.name")
|
||||
title(id, name) {
|
||||
if (id) {
|
||||
return I18n.t("category.edit_dialog_title", {
|
||||
categoryName: this.get("model.name")
|
||||
categoryName: name
|
||||
});
|
||||
}
|
||||
return I18n.t("category.create");
|
||||
}.property("model.id", "model.name"),
|
||||
},
|
||||
|
||||
titleChanged: function() {
|
||||
this.set("modal.title", this.get("title"));
|
||||
}.observes("title"),
|
||||
|
||||
disabled: function() {
|
||||
if (this.get("saving") || this.get("deleting")) return true;
|
||||
if (!this.get("model.name")) return true;
|
||||
if (!this.get("model.color")) return true;
|
||||
@computed("saving", "model.name", "model.color", "deleting")
|
||||
disabled(saving, name, color, deleting) {
|
||||
if (saving || deleting) return true;
|
||||
if (!name) return true;
|
||||
if (!color) return true;
|
||||
return false;
|
||||
}.property("saving", "model.name", "model.color", "deleting"),
|
||||
},
|
||||
|
||||
deleteDisabled: function() {
|
||||
return this.get("deleting") || this.get("saving") || false;
|
||||
}.property("disabled", "saving", "deleting"),
|
||||
@computed("saving", "deleting")
|
||||
deleteDisabled(saving, deleting) {
|
||||
return deleting || saving || false;
|
||||
},
|
||||
|
||||
categoryName: function() {
|
||||
const name = this.get("name") || "";
|
||||
@computed("name")
|
||||
categoryName(name) {
|
||||
name = name || "";
|
||||
return name.trim().length > 0 ? name : I18n.t("preview");
|
||||
}.property("name"),
|
||||
},
|
||||
|
||||
saveLabel: function() {
|
||||
if (this.get("saving")) return "saving";
|
||||
return this.get("model.id") ? "category.save" : "category.create";
|
||||
}.property("saving", "model.id"),
|
||||
@computed("saving", "model.id")
|
||||
saveLabel(saving, id) {
|
||||
if (saving) return "saving";
|
||||
return id ? "category.save" : "category.create";
|
||||
},
|
||||
|
||||
actions: {
|
||||
saveCategory() {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
var ButtonBackBright = {
|
||||
classes: "btn-primary",
|
||||
action: "back",
|
||||
@@ -25,13 +27,14 @@ export default Ember.Controller.extend({
|
||||
thrown: null,
|
||||
lastTransition: null,
|
||||
|
||||
@computed
|
||||
isNetwork: function() {
|
||||
// never made it on the wire
|
||||
if (this.get("thrown.readyState") === 0) return true;
|
||||
// timed out
|
||||
if (this.get("thrown.jqTextStatus") === "timeout") return true;
|
||||
return false;
|
||||
}.property(),
|
||||
},
|
||||
|
||||
isNotFound: Ember.computed.equal("thrown.status", 404),
|
||||
isForbidden: Ember.computed.equal("thrown.status", 403),
|
||||
@@ -48,7 +51,8 @@ export default Ember.Controller.extend({
|
||||
this.set("loading", false);
|
||||
}.on("init"),
|
||||
|
||||
reason: function() {
|
||||
@computed("isNetwork", "isServer", "isUnknown")
|
||||
reason() {
|
||||
if (this.get("isNetwork")) {
|
||||
return I18n.t("errors.reasons.network");
|
||||
} else if (this.get("isServer")) {
|
||||
@@ -61,11 +65,12 @@ export default Ember.Controller.extend({
|
||||
// TODO
|
||||
return I18n.t("errors.reasons.unknown");
|
||||
}
|
||||
}.property("isNetwork", "isServer", "isUnknown"),
|
||||
},
|
||||
|
||||
requestUrl: Ember.computed.alias("thrown.requestedUrl"),
|
||||
|
||||
desc: function() {
|
||||
@computed("networkFixed", "isNetwork", "isServer", "isUnknown")
|
||||
desc() {
|
||||
if (this.get("networkFixed")) {
|
||||
return I18n.t("errors.desc.network_fixed");
|
||||
} else if (this.get("isNetwork")) {
|
||||
@@ -80,9 +85,10 @@ export default Ember.Controller.extend({
|
||||
// TODO
|
||||
return I18n.t("errors.desc.unknown");
|
||||
}
|
||||
}.property("networkFixed", "isNetwork", "isServer", "isUnknown"),
|
||||
},
|
||||
|
||||
enabledButtons: function() {
|
||||
@computed("networkFixed", "isNetwork", "isServer", "isUnknown")
|
||||
enabledButtons() {
|
||||
if (this.get("networkFixed")) {
|
||||
return [ButtonLoadPage];
|
||||
} else if (this.get("isNetwork")) {
|
||||
@@ -90,7 +96,7 @@ export default Ember.Controller.extend({
|
||||
} else {
|
||||
return [ButtonBackBright, ButtonTryAgain];
|
||||
}
|
||||
}.property("networkFixed", "isNetwork", "isServer", "isUnknown"),
|
||||
},
|
||||
|
||||
actions: {
|
||||
back: function() {
|
||||
|
||||
@@ -39,7 +39,8 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
return flagTopic ? "flagging_topic.title" : "flagging.title";
|
||||
},
|
||||
|
||||
flagsAvailable: function() {
|
||||
@computed("post", "flagTopic", "model.actions_summary.@each.can_act")
|
||||
flagsAvailable() {
|
||||
if (!this.get("flagTopic")) {
|
||||
// flagging post
|
||||
let flagsAvailable = this.get("model.flagsAvailable");
|
||||
@@ -71,16 +72,18 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
});
|
||||
});
|
||||
}
|
||||
}.property("post", "flagTopic", "model.actions_summary.@each.can_act"),
|
||||
},
|
||||
|
||||
staffFlagsAvailable: function() {
|
||||
@computed("post", "flagTopic", "model.actions_summary.@each.can_act")
|
||||
staffFlagsAvailable() {
|
||||
return (
|
||||
this.get("model.flagsAvailable") &&
|
||||
this.get("model.flagsAvailable").length > 1
|
||||
);
|
||||
}.property("post", "flagTopic", "model.actions_summary.@each.can_act"),
|
||||
},
|
||||
|
||||
submitEnabled: function() {
|
||||
@computed("selected.is_custom_flag", "message.length")
|
||||
submitEnabled() {
|
||||
const selected = this.get("selected");
|
||||
if (!selected) return false;
|
||||
|
||||
@@ -92,7 +95,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}.property("selected.is_custom_flag", "message.length"),
|
||||
},
|
||||
|
||||
submitDisabled: Ember.computed.not("submitEnabled"),
|
||||
|
||||
|
||||
@@ -284,17 +284,18 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||
}
|
||||
},
|
||||
|
||||
authMessage: function() {
|
||||
if (Ember.isEmpty(this.get("authenticate"))) return "";
|
||||
@computed("authenticate")
|
||||
authMessage(authenticate) {
|
||||
if (Ember.isEmpty(authenticate)) return "";
|
||||
const method = findAll(
|
||||
this.siteSettings,
|
||||
this.capabilities,
|
||||
this.isMobileDevice
|
||||
).findBy("name", this.get("authenticate"));
|
||||
).findBy("name", authenticate);
|
||||
if (method) {
|
||||
return method.get("message");
|
||||
}
|
||||
}.property("authenticate"),
|
||||
},
|
||||
|
||||
authenticationComplete(options) {
|
||||
const self = this;
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import NavigationDefaultController from "discourse/controllers/navigation/default";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default NavigationDefaultController.extend({
|
||||
discoveryCategories: Ember.inject.controller("discovery/categories"),
|
||||
|
||||
draft: function() {
|
||||
@computed("discoveryCategories.model", "discoveryCategories.model.draft")
|
||||
draft() {
|
||||
return this.get("discoveryCategories.model.draft");
|
||||
}.property("discoveryCategories.model", "discoveryCategories.model.draft")
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
discovery: Ember.inject.controller(),
|
||||
discoveryTopics: Ember.inject.controller("discovery/topics"),
|
||||
|
||||
@computed("discoveryTopics.model", "discoveryTopics.model.draft")
|
||||
draft: function() {
|
||||
return this.get("discoveryTopics.model.draft");
|
||||
}.property("discoveryTopics.model", "discoveryTopics.model.draft")
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
saving: false,
|
||||
newBio: null,
|
||||
|
||||
saveButtonText: function() {
|
||||
return this.get("saving") ? I18n.t("saving") : I18n.t("user.change");
|
||||
}.property("saving")
|
||||
@computed("saving")
|
||||
saveButtonText(saving) {
|
||||
return saving ? I18n.t("saving") : I18n.t("user.change");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -77,9 +77,10 @@ export default Ember.Controller.extend(PreferencesTabController, {
|
||||
});
|
||||
},
|
||||
|
||||
userSelectableThemes: function() {
|
||||
@computed
|
||||
userSelectableThemes() {
|
||||
return listThemes(this.site);
|
||||
}.property(),
|
||||
},
|
||||
|
||||
@computed("userSelectableThemes")
|
||||
showThemeSelector(themes) {
|
||||
|
||||
@@ -26,13 +26,14 @@ export default Ember.Controller.extend(ModalFunctionality, Ember.Evented, {
|
||||
"categoriesSorting"
|
||||
),
|
||||
|
||||
showApplyAll: function() {
|
||||
@computed("categoriesBuffered.@each.hasBufferedChanges")
|
||||
showApplyAll() {
|
||||
let anyChanged = false;
|
||||
this.get("categoriesBuffered").forEach(bc => {
|
||||
anyChanged = anyChanged || bc.get("hasBufferedChanges");
|
||||
});
|
||||
return anyChanged;
|
||||
}.property("categoriesBuffered.@each.hasBufferedChanges"),
|
||||
},
|
||||
|
||||
moveDir(cat, dir) {
|
||||
const cats = this.get("categoriesOrdered");
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Ember.Controller.extend(ModalFunctionality, {
|
||||
showGoogleSearch: function() {
|
||||
@computed
|
||||
showGoogleSearch() {
|
||||
return !Discourse.SiteSettings.login_required;
|
||||
}.property()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -16,12 +16,12 @@ export default Ember.Controller.extend({
|
||||
pmTaggingEnabled: Ember.computed.alias("site.can_tag_pms"),
|
||||
tagId: null,
|
||||
|
||||
showNewPM: function() {
|
||||
@computed("user.viewingSelf")
|
||||
showNewPM(viewingSelf) {
|
||||
return (
|
||||
this.get("user.viewingSelf") &&
|
||||
Discourse.User.currentProp("can_send_private_messages")
|
||||
viewingSelf && Discourse.User.currentProp("can_send_private_messages")
|
||||
);
|
||||
}.property("user.viewingSelf"),
|
||||
},
|
||||
|
||||
@computed("selected.[]", "bulkSelectEnabled")
|
||||
hasSelection(selected, bulkSelectEnabled) {
|
||||
|
||||
Reference in New Issue
Block a user