make code prettier 🎀

This commit is contained in:
Régis Hanol
2018-07-18 13:09:16 +02:00
parent 6d6e026e3c
commit f55ac892e4
8 changed files with 17 additions and 12 deletions

View File

@ -6,7 +6,7 @@ export default Ember.Component.extend({
showModal("admin-uploaded-image-list", { showModal("admin-uploaded-image-list", {
admin: true, admin: true,
title: `admin.site_settings.${setting.setting}.title`, title: `admin.site_settings.${setting.setting}.title`,
model: { value, setting }, model: { value, setting }
}).setProperties({ }).setProperties({
save: v => this.set("value", v) save: v => this.set("value", v)
}); });

View File

@ -1,8 +1,7 @@
import { on, observes } from "ember-addons/ember-computed-decorators"; import { on, observes } from "ember-addons/ember-computed-decorators";
import ModalFunctionality from 'discourse/mixins/modal-functionality'; import ModalFunctionality from "discourse/mixins/modal-functionality";
export default Ember.Controller.extend(ModalFunctionality, { export default Ember.Controller.extend(ModalFunctionality, {
@on("init") @on("init")
@observes("model.value") @observes("model.value")
_setup() { _setup() {

View File

@ -10,7 +10,7 @@ const CUSTOM_TYPES = [
"category_list", "category_list",
"value_list", "value_list",
"category", "category",
"uploaded_image_list", "uploaded_image_list"
]; ];
export default Ember.Mixin.create({ export default Ember.Mixin.create({

View File

@ -7,7 +7,9 @@ export default Em.Component.extend(UploadMixin, {
@computed("uploading") @computed("uploading")
uploadButtonText(uploading) { uploadButtonText(uploading) {
return uploading ? I18n.t("uploading") : I18n.t("user.change_avatar.upload_picture"); return uploading
? I18n.t("uploading")
: I18n.t("user.change_avatar.upload_picture");
}, },
validateUploadedFilesOptions() { validateUploadedFilesOptions() {
@ -16,5 +18,5 @@ export default Em.Component.extend(UploadMixin, {
uploadDone(upload) { uploadDone(upload) {
this.sendAction("done", upload); this.sendAction("done", upload);
}, }
}); });

View File

@ -520,9 +520,11 @@ const User = RestModel.extend({
}, },
isAllowedToUploadAFile(type) { isAllowedToUploadAFile(type) {
return this.get("staff") || return (
this.get("staff") ||
this.get("trust_level") > 0 || this.get("trust_level") > 0 ||
Discourse.SiteSettings[`newuser_max_${type}s`] > 0; Discourse.SiteSettings[`newuser_max_${type}s`] > 0
);
}, },
createInvite(email, group_names, custom_message) { createInvite(email, group_names, custom_message) {

View File

@ -38,8 +38,9 @@ export default RestrictedUserRoute.extend({
controller.setProperties(props); controller.setProperties(props);
if (this.siteSettings.selectable_avatars_enabled) { if (this.siteSettings.selectable_avatars_enabled) {
ajax("/site/selectable-avatars.json") ajax("/site/selectable-avatars.json").then(avatars =>
.then(avatars => controller.set("selectableAvatars", avatars)); controller.set("selectableAvatars", avatars)
);
} }
}, },

View File

@ -106,4 +106,3 @@
color: $danger; color: $danger;
} }
} }

View File

@ -191,7 +191,9 @@ QUnit.test("selectable avatars", assert => {
click(".pref-avatar .btn"); click(".pref-avatar .btn");
andThen(() => { andThen(() => {
assert.ok(exists(".selectable-avatars", "opens the avatar selection modal")); assert.ok(
exists(".selectable-avatars", "opens the avatar selection modal")
);
}); });
}); });