mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:52:11 +08:00
parent
1f899bec21
commit
536f88b95b
|
@ -530,14 +530,11 @@ const AdminUser = Discourse.User.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("suspended_by")
|
@computed("suspended_by") suspendedBy: wrapAdmin,
|
||||||
suspendedBy: wrapAdmin,
|
|
||||||
|
|
||||||
@computed("silenced_by")
|
@computed("silenced_by") silencedBy: wrapAdmin,
|
||||||
silencedBy: wrapAdmin,
|
|
||||||
|
|
||||||
@computed("approved_by")
|
@computed("approved_by") approvedBy: wrapAdmin
|
||||||
approvedBy: wrapAdmin
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AdminUser.reopenClass({
|
AdminUser.reopenClass({
|
||||||
|
|
|
@ -31,8 +31,7 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("formattedBackupCodes")
|
@computed("formattedBackupCodes") base64BackupCode: b64EncodeUnicode,
|
||||||
base64BackupCode: b64EncodeUnicode,
|
|
||||||
|
|
||||||
@computed("backupCodes")
|
@computed("backupCodes")
|
||||||
formattedBackupCodes(backupCodes) {
|
formattedBackupCodes(backupCodes) {
|
||||||
|
|
|
@ -18,8 +18,7 @@ export default Ember.Component.extend({
|
||||||
return hasDraft ? "topic.open_draft" : "topic.create";
|
return hasDraft ? "topic.open_draft" : "topic.create";
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("category.can_edit")
|
@computed("category.can_edit") showCategoryEdit: canEdit => canEdit,
|
||||||
showCategoryEdit: canEdit => canEdit,
|
|
||||||
|
|
||||||
@computed("filterMode", "category", "noSubcategories")
|
@computed("filterMode", "category", "noSubcategories")
|
||||||
navItems(filterMode, category, noSubcategories) {
|
navItems(filterMode, category, noSubcategories) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
@computed("post.url")
|
@computed("post.url") postUrl: Discourse.getURL
|
||||||
postUrl: Discourse.getURL
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -32,11 +32,9 @@ export default Ember.Component.extend(CleansUp, {
|
||||||
topic: null,
|
topic: null,
|
||||||
visible: null,
|
visible: null,
|
||||||
|
|
||||||
@computed("topic.created_at")
|
@computed("topic.created_at") createdDate: createdAt => new Date(createdAt),
|
||||||
createdDate: createdAt => new Date(createdAt),
|
|
||||||
|
|
||||||
@computed("topic.bumped_at")
|
@computed("topic.bumped_at") bumpedDate: bumpedAt => new Date(bumpedAt),
|
||||||
bumpedDate: bumpedAt => new Date(bumpedAt),
|
|
||||||
|
|
||||||
@computed("createdDate", "bumpedDate")
|
@computed("createdDate", "bumpedDate")
|
||||||
showTime(createdDate, bumpedDate) {
|
showTime(createdDate, bumpedDate) {
|
||||||
|
|
|
@ -287,8 +287,7 @@ export default Ember.Controller.extend({
|
||||||
return authorizesOneOrMoreExtensions();
|
return authorizesOneOrMoreExtensions();
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed()
|
@computed() uploadIcon: () => uploadIcon(),
|
||||||
uploadIcon: () => uploadIcon(),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
cancelUpload() {
|
cancelUpload() {
|
||||||
|
|
|
@ -7,8 +7,7 @@ export default Ember.Controller.extend({
|
||||||
|
|
||||||
showLoginButton: Em.computed.equal("model.path", "login"),
|
showLoginButton: Em.computed.equal("model.path", "login"),
|
||||||
|
|
||||||
@computed("model.path")
|
@computed("model.path") bodyClass: path => `static-${path}`,
|
||||||
bodyClass: path => `static-${path}`,
|
|
||||||
|
|
||||||
@computed("model.path")
|
@computed("model.path")
|
||||||
showSignupButton() {
|
showSignupButton() {
|
||||||
|
|
|
@ -25,11 +25,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
remote: Ember.computed.equal("selection", "remote"),
|
remote: Ember.computed.equal("selection", "remote"),
|
||||||
selection: "local",
|
selection: "local",
|
||||||
|
|
||||||
@computed()
|
@computed() uploadIcon: () => uploadIcon(),
|
||||||
uploadIcon: () => uploadIcon(),
|
|
||||||
|
|
||||||
@computed()
|
@computed() title: () => uploadTranslate("title"),
|
||||||
title: () => uploadTranslate("title"),
|
|
||||||
|
|
||||||
@computed("selection")
|
@computed("selection")
|
||||||
tip(selection) {
|
tip(selection) {
|
||||||
|
|
|
@ -75,8 +75,7 @@ const Composer = RestModel.extend({
|
||||||
return this.site.get("archetypes");
|
return this.site.get("archetypes");
|
||||||
}.property(),
|
}.property(),
|
||||||
|
|
||||||
@computed("action")
|
@computed("action") sharedDraft: action => action === CREATE_SHARED_DRAFT,
|
||||||
sharedDraft: action => action === CREATE_SHARED_DRAFT,
|
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
categoryId: {
|
categoryId: {
|
||||||
|
@ -134,8 +133,7 @@ const Composer = RestModel.extend({
|
||||||
|
|
||||||
topicFirstPost: Em.computed.or("creatingTopic", "editingFirstPost"),
|
topicFirstPost: Em.computed.or("creatingTopic", "editingFirstPost"),
|
||||||
|
|
||||||
@computed("action")
|
@computed("action") editingPost: isEdit,
|
||||||
editingPost: isEdit,
|
|
||||||
|
|
||||||
replyingToTopic: Em.computed.equal("action", REPLY),
|
replyingToTopic: Em.computed.equal("action", REPLY),
|
||||||
|
|
||||||
|
|
|
@ -105,8 +105,7 @@ const NavItem = Discourse.Model.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
const ExtraNavItem = NavItem.extend({
|
const ExtraNavItem = NavItem.extend({
|
||||||
@computed("href")
|
@computed("href") href: href => href,
|
||||||
href: href => href,
|
|
||||||
customFilter: null
|
customFilter: null
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -198,17 +198,13 @@ const User = RestModel.extend({
|
||||||
return suspendedTill && moment(suspendedTill).isAfter();
|
return suspendedTill && moment(suspendedTill).isAfter();
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("suspended_till")
|
@computed("suspended_till") suspendedForever: isForever,
|
||||||
suspendedForever: isForever,
|
|
||||||
|
|
||||||
@computed("silenced_till")
|
@computed("silenced_till") silencedForever: isForever,
|
||||||
silencedForever: isForever,
|
|
||||||
|
|
||||||
@computed("suspended_till")
|
@computed("suspended_till") suspendedTillDate: longDate,
|
||||||
suspendedTillDate: longDate,
|
|
||||||
|
|
||||||
@computed("silenced_till")
|
@computed("silenced_till") silencedTillDate: longDate,
|
||||||
silencedTillDate: longDate,
|
|
||||||
|
|
||||||
changeUsername(new_username) {
|
changeUsername(new_username) {
|
||||||
return ajax(
|
return ajax(
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
@computed("field.value")
|
@computed("field.value") showStaffCount: staffCount => staffCount > 1
|
||||||
showStaffCount: staffCount => staffCount > 1
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,6 +3,5 @@ import computed from "ember-addons/ember-computed-decorators";
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
classNameBindings: [":wizard-step-form", "customStepClass"],
|
classNameBindings: [":wizard-step-form", "customStepClass"],
|
||||||
|
|
||||||
@computed("step.id")
|
@computed("step.id") customStepClass: stepId => `wizard-step-${stepId}`
|
||||||
customStepClass: stepId => `wizard-step-${stepId}`
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -31,8 +31,7 @@ export default Ember.Component.extend({
|
||||||
this.autoFocus();
|
this.autoFocus();
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("step.index")
|
@computed("step.index") showQuitButton: index => index === 0,
|
||||||
showQuitButton: index => index === 0,
|
|
||||||
|
|
||||||
@computed("step.displayIndex", "wizard.totalSteps")
|
@computed("step.displayIndex", "wizard.totalSteps")
|
||||||
showNextButton: (current, total) => current < total,
|
showNextButton: (current, total) => current < total,
|
||||||
|
@ -40,8 +39,7 @@ export default Ember.Component.extend({
|
||||||
@computed("step.displayIndex", "wizard.totalSteps")
|
@computed("step.displayIndex", "wizard.totalSteps")
|
||||||
showDoneButton: (current, total) => current === total,
|
showDoneButton: (current, total) => current === total,
|
||||||
|
|
||||||
@computed("step.index")
|
@computed("step.index") showBackButton: index => index > 0,
|
||||||
showBackButton: index => index > 0,
|
|
||||||
|
|
||||||
@computed("step.banner")
|
@computed("step.banner")
|
||||||
bannerImage(src) {
|
bannerImage(src) {
|
||||||
|
|
|
@ -15,14 +15,11 @@ export default {
|
||||||
this.set("_validState", States.UNCHECKED);
|
this.set("_validState", States.UNCHECKED);
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("_validState")
|
@computed("_validState") valid: state => state === States.VALID,
|
||||||
valid: state => state === States.VALID,
|
|
||||||
|
|
||||||
@computed("_validState")
|
@computed("_validState") invalid: state => state === States.INVALID,
|
||||||
invalid: state => state === States.INVALID,
|
|
||||||
|
|
||||||
@computed("_validState")
|
@computed("_validState") unchecked: state => state === States.UNCHECKED,
|
||||||
unchecked: state => state === States.UNCHECKED,
|
|
||||||
|
|
||||||
setValid(valid, description) {
|
setValid(valid, description) {
|
||||||
this.set("_validState", valid ? States.VALID : States.INVALID);
|
this.set("_validState", valid ? States.VALID : States.INVALID);
|
||||||
|
|
|
@ -5,8 +5,7 @@ import { ajax } from "wizard/lib/ajax";
|
||||||
export default Ember.Object.extend(ValidState, {
|
export default Ember.Object.extend(ValidState, {
|
||||||
id: null,
|
id: null,
|
||||||
|
|
||||||
@computed("index")
|
@computed("index") displayIndex: index => index + 1,
|
||||||
displayIndex: index => index + 1,
|
|
||||||
|
|
||||||
@computed("fields.[]")
|
@computed("fields.[]")
|
||||||
fieldsById(fields) {
|
fieldsById(fields) {
|
||||||
|
|
|
@ -4,8 +4,7 @@ import { ajax } from "wizard/lib/ajax";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
const Wizard = Ember.Object.extend({
|
const Wizard = Ember.Object.extend({
|
||||||
@computed("steps.length")
|
@computed("steps.length") totalSteps: length => length,
|
||||||
totalSteps: length => length,
|
|
||||||
|
|
||||||
getTitle() {
|
getTitle() {
|
||||||
const titleStep = this.get("steps").findBy("id", "forum-title");
|
const titleStep = this.get("steps").findBy("id", "forum-title");
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"chrome-launcher": "^0.10.2",
|
"chrome-launcher": "^0.10.2",
|
||||||
"chrome-remote-interface": "^0.25.6",
|
"chrome-remote-interface": "^0.25.6",
|
||||||
"eslint": "^4.19.1",
|
"eslint": "^4.19.1",
|
||||||
"prettier": "^1.14.0",
|
"prettier": "^1.13.0",
|
||||||
"puppeteer": "^1.4.0"
|
"puppeteer": "^1.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -813,9 +813,9 @@ prelude-ls@~1.1.2:
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
|
||||||
|
|
||||||
prettier@^1.14.0:
|
prettier@1.13.4:
|
||||||
version "1.14.0"
|
version "1.13.4"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.0.tgz#847c235522035fd988100f1f43cf20a7d24f9372"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.13.4.tgz#31bbae6990f13b1093187c731766a14036fa72e6"
|
||||||
|
|
||||||
process-nextick-args@~1.0.6:
|
process-nextick-args@~1.0.6:
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user