mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
REFACTOR: Remove Ember.Controller
in favor of import
This commit is contained in:
parent
e18af18fec
commit
6287eccb35
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import { setting, i18n } from "discourse/lib/computed";
|
import { setting, i18n } from "discourse/lib/computed";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
adminBackups: Ember.inject.controller(),
|
adminBackups: Ember.inject.controller(),
|
||||||
status: Ember.computed.alias("adminBackups.model"),
|
status: Ember.computed.alias("adminBackups.model"),
|
||||||
uploadLabel: i18n("admin.backups.upload.label"),
|
uploadLabel: i18n("admin.backups.upload.label"),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export default Ember.Controller.extend({
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend({
|
||||||
adminBackups: Ember.inject.controller(),
|
adminBackups: Ember.inject.controller(),
|
||||||
status: Ember.computed.alias("adminBackups.model"),
|
status: Ember.computed.alias("adminBackups.model"),
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export default Ember.Controller.extend({
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend({
|
||||||
noOperationIsRunning: Ember.computed.not("model.isOperationRunning"),
|
noOperationIsRunning: Ember.computed.not("model.isOperationRunning"),
|
||||||
rollbackEnabled: Ember.computed.and(
|
rollbackEnabled: Ember.computed.and(
|
||||||
"model.canRollback",
|
"model.canRollback",
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||||
import { propertyNotEqual } from "discourse/lib/computed";
|
import { propertyNotEqual } from "discourse/lib/computed";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(bufferedProperty("model"), {
|
export default Controller.extend(bufferedProperty("model"), {
|
||||||
adminBadges: Ember.inject.controller(),
|
adminBadges: Ember.inject.controller(),
|
||||||
saving: false,
|
saving: false,
|
||||||
savingStatus: "",
|
savingStatus: "",
|
||||||
|
@ -1 +1,2 @@
|
|||||||
export default Ember.Controller.extend();
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
@computed("model.colors", "onlyOverridden")
|
@computed("model.colors", "onlyOverridden")
|
||||||
colors(allColors, onlyOverridden) {
|
colors(allColors, onlyOverridden) {
|
||||||
if (onlyOverridden) {
|
if (onlyOverridden) {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
@computed("model.@each.id")
|
@computed("model.@each.id")
|
||||||
baseColorScheme() {
|
baseColorScheme() {
|
||||||
return this.model.findBy("is_base", true);
|
return this.model.findBy("is_base", true);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
@computed("model.isSaving")
|
@computed("model.isSaving")
|
||||||
saveButtonText(isSaving) {
|
saveButtonText(isSaving) {
|
||||||
return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save");
|
return isSaving ? I18n.t("saving") : I18n.t("admin.customize.save");
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(bufferedProperty("emailTemplate"), {
|
export default Controller.extend(bufferedProperty("emailTemplate"), {
|
||||||
saved: false,
|
saved: false,
|
||||||
|
|
||||||
@computed("buffered.body", "buffered.subject")
|
@computed("buffered.body", "buffered.subject")
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export default Ember.Controller.extend({
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend({
|
||||||
emailTemplates: null,
|
emailTemplates: null,
|
||||||
sortedTemplates: Ember.computed.sort("emailTemplates", "titleSorting"),
|
sortedTemplates: Ember.computed.sort("emailTemplates", "titleSorting"),
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||||
import { propertyEqual } from "discourse/lib/computed";
|
import { propertyEqual } from "discourse/lib/computed";
|
||||||
|
|
||||||
export default Ember.Controller.extend(bufferedProperty("model"), {
|
export default Controller.extend(bufferedProperty("model"), {
|
||||||
saved: false,
|
saved: false,
|
||||||
isSaving: false,
|
isSaving: false,
|
||||||
saveDisabled: propertyEqual("model.robots_txt", "buffered.robots_txt"),
|
saveDisabled: propertyEqual("model.robots_txt", "buffered.robots_txt"),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { url } from "discourse/lib/computed";
|
import { url } from "discourse/lib/computed";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
section: null,
|
section: null,
|
||||||
currentTarget: 0,
|
currentTarget: 0,
|
||||||
maximized: false,
|
maximized: false,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import { url } from "discourse/lib/computed";
|
import { url } from "discourse/lib/computed";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
@ -7,7 +8,7 @@ import { THEMES, COMPONENTS } from "admin/models/theme";
|
|||||||
|
|
||||||
const THEME_UPLOAD_VAR = 2;
|
const THEME_UPLOAD_VAR = 2;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
downloadUrl: url("model.id", "/admin/customize/themes/%@/export"),
|
downloadUrl: url("model.id", "/admin/customize/themes/%@/export"),
|
||||||
previewUrl: url("model.id", "/admin/themes/%@/preview"),
|
previewUrl: url("model.id", "/admin/themes/%@/preview"),
|
||||||
addButtonDisabled: Ember.computed.empty("selectedChildThemeId"),
|
addButtonDisabled: Ember.computed.empty("selectedChildThemeId"),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import { THEMES } from "admin/models/theme";
|
import { THEMES } from "admin/models/theme";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
currentTab: THEMES,
|
currentTab: THEMES,
|
||||||
|
|
||||||
@computed("model", "model.@each.component")
|
@computed("model", "model.@each.component")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { setting } from "discourse/lib/computed";
|
import { setting } from "discourse/lib/computed";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import AdminDashboard from "admin/models/admin-dashboard";
|
import AdminDashboard from "admin/models/admin-dashboard";
|
||||||
@ -12,7 +13,7 @@ function staticReport(reportType) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Controller.extend(PeriodComputationMixin, {
|
export default Controller.extend(PeriodComputationMixin, {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
dashboardFetchedAt: null,
|
dashboardFetchedAt: null,
|
||||||
exceptionController: Ember.inject.controller("exception"),
|
exceptionController: Ember.inject.controller("exception"),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import PeriodComputationMixin from "admin/mixins/period-computation";
|
import PeriodComputationMixin from "admin/mixins/period-computation";
|
||||||
|
|
||||||
export default Ember.Controller.extend(PeriodComputationMixin, {
|
export default Controller.extend(PeriodComputationMixin, {
|
||||||
@computed
|
@computed
|
||||||
flagsStatusOptions() {
|
flagsStatusOptions() {
|
||||||
return {
|
return {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
const { get } = Ember;
|
const { get } = Ember;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
|
|
||||||
@computed("model.[]", "filter")
|
@computed("model.[]", "filter")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { setting } from "discourse/lib/computed";
|
import { setting } from "discourse/lib/computed";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import AdminDashboard from "admin/models/admin-dashboard";
|
import AdminDashboard from "admin/models/admin-dashboard";
|
||||||
@ -5,7 +6,7 @@ import VersionCheck from "admin/models/version-check";
|
|||||||
|
|
||||||
const PROBLEMS_CHECK_MINUTES = 1;
|
const PROBLEMS_CHECK_MINUTES = 1;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
dashboardFetchedAt: null,
|
dashboardFetchedAt: null,
|
||||||
exceptionController: Ember.inject.controller("exception"),
|
exceptionController: Ember.inject.controller("exception"),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
email: null,
|
email: null,
|
||||||
text: null,
|
text: null,
|
||||||
elided: null,
|
elided: null,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
/**
|
/**
|
||||||
Is the "send test email" button disabled?
|
Is the "send test email" button disabled?
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import EmailLog from "admin/models/email-log";
|
import EmailLog from "admin/models/email-log";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
loadLogs(sourceModel, loadMore) {
|
loadLogs(sourceModel, loadMore) {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import EmailPreview from "admin/models/email-preview";
|
import EmailPreview from "admin/models/email-preview";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
username: null,
|
username: null,
|
||||||
lastSeen: null,
|
lastSeen: null,
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
saved: false,
|
saved: false,
|
||||||
embedding: null,
|
embedding: null,
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
sortedEmojis: Ember.computed.sort("model", "emojiSorting"),
|
sortedEmojis: Ember.computed.sort("model", "emojiSorting"),
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { exportEntity } from "discourse/lib/export-csv";
|
import { exportEntity } from "discourse/lib/export-csv";
|
||||||
import { outputExportResult } from "discourse/lib/export-result";
|
import { outputExportResult } from "discourse/lib/export-result";
|
||||||
import ScreenedEmail from "admin/models/screened-email";
|
import ScreenedEmail from "admin/models/screened-email";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
import { outputExportResult } from "discourse/lib/export-result";
|
import { outputExportResult } from "discourse/lib/export-result";
|
||||||
import { exportEntity } from "discourse/lib/export-csv";
|
import { exportEntity } from "discourse/lib/export-csv";
|
||||||
import ScreenedIpAddress from "admin/models/screened-ip-address";
|
import ScreenedIpAddress from "admin/models/screened-ip-address";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
filter: null,
|
filter: null,
|
||||||
savedIpAddress: null,
|
savedIpAddress: null,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { exportEntity } from "discourse/lib/export-csv";
|
import { exportEntity } from "discourse/lib/export-csv";
|
||||||
import { outputExportResult } from "discourse/lib/export-result";
|
import { outputExportResult } from "discourse/lib/export-result";
|
||||||
import ScreenedUrl from "admin/models/screened-url";
|
import ScreenedUrl from "admin/models/screened-url";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
show() {
|
show() {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { exportEntity } from "discourse/lib/export-csv";
|
import { exportEntity } from "discourse/lib/export-csv";
|
||||||
import { outputExportResult } from "discourse/lib/export-result";
|
import { outputExportResult } from "discourse/lib/export-result";
|
||||||
import {
|
import {
|
||||||
@ -5,7 +6,7 @@ import {
|
|||||||
on
|
on
|
||||||
} from "ember-addons/ember-computed-decorators";
|
} from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
model: null,
|
model: null,
|
||||||
filters: null,
|
filters: null,
|
||||||
filtersExists: Ember.computed.gt("filterCount", 0),
|
filtersExists: Ember.computed.gt("filterCount", 0),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
import Permalink from "admin/models/permalink";
|
import Permalink from "admin/models/permalink";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
filter: null,
|
filter: null,
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
@computed
|
@computed
|
||||||
adminRoutes: function() {
|
adminRoutes: function() {
|
||||||
return this.model
|
return this.model
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
queryParams: ["start_date", "end_date", "filters"],
|
queryParams: ["start_date", "end_date", "filters"],
|
||||||
start_date: null,
|
start_date: null,
|
||||||
end_date: null,
|
end_date: null,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
export const DEFAULT_PERIOD = "yearly";
|
export const DEFAULT_PERIOD = "yearly";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
period: DEFAULT_PERIOD,
|
period: DEFAULT_PERIOD,
|
||||||
searchType: "all",
|
searchType: "all",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index";
|
import { DEFAULT_PERIOD } from "admin/controllers/admin-search-logs-index";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
loading: false,
|
loading: false,
|
||||||
term: null,
|
term: null,
|
||||||
period: DEFAULT_PERIOD,
|
period: DEFAULT_PERIOD,
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
categoryNameKey: null,
|
categoryNameKey: null,
|
||||||
adminSiteSettings: Ember.inject.controller(),
|
adminSiteSettings: Ember.inject.controller(),
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
allSiteSettings: Ember.computed.alias("model"),
|
allSiteSettings: Ember.computed.alias("model"),
|
||||||
visibleSiteSettings: null,
|
visibleSiteSettings: null,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
import { bufferedProperty } from "discourse/mixins/buffered-content";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(bufferedProperty("siteText"), {
|
export default Controller.extend(bufferedProperty("siteText"), {
|
||||||
saved: false,
|
saved: false,
|
||||||
|
|
||||||
@computed("buffered.value")
|
@computed("buffered.value")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
let lastSearch;
|
let lastSearch;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
searching: false,
|
searching: false,
|
||||||
siteTexts: null,
|
siteTexts: null,
|
||||||
preferred: false,
|
preferred: false,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import GrantBadgeController from "discourse/mixins/grant-badge-controller";
|
import GrantBadgeController from "discourse/mixins/grant-badge-controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(GrantBadgeController, {
|
export default Controller.extend(GrantBadgeController, {
|
||||||
adminUser: Ember.inject.controller(),
|
adminUser: Ember.inject.controller(),
|
||||||
user: Ember.computed.alias("adminUser.model"),
|
user: Ember.computed.alias("adminUser.model"),
|
||||||
userBadges: Ember.computed.alias("model"),
|
userBadges: Ember.computed.alias("model"),
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
const MAX_FIELDS = 20;
|
const MAX_FIELDS = 20;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
fieldTypes: null,
|
fieldTypes: null,
|
||||||
createDisabled: Ember.computed.gte("model.length", MAX_FIELDS),
|
createDisabled: Ember.computed.gte("model.length", MAX_FIELDS),
|
||||||
sortedFields: Ember.computed.sort("model", "fieldSortOrder"),
|
sortedFields: Ember.computed.sort("model", "fieldSortOrder"),
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import CanCheckEmails from "discourse/mixins/can-check-emails";
|
import CanCheckEmails from "discourse/mixins/can-check-emails";
|
||||||
import { propertyNotEqual, setting } from "discourse/lib/computed";
|
import { propertyNotEqual, setting } from "discourse/lib/computed";
|
||||||
@ -6,7 +7,7 @@ import { popupAjaxError } from "discourse/lib/ajax-error";
|
|||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
|
|
||||||
export default Ember.Controller.extend(CanCheckEmails, {
|
export default Controller.extend(CanCheckEmails, {
|
||||||
adminTools: Ember.inject.service(),
|
adminTools: Ember.inject.service(),
|
||||||
originalPrimaryGroupId: null,
|
originalPrimaryGroupId: null,
|
||||||
customGroupIdsBuffer: null,
|
customGroupIdsBuffer: null,
|
||||||
|
@ -1 +1,2 @@
|
|||||||
export default Ember.Controller.extend();
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend();
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
import { i18n } from "discourse/lib/computed";
|
import { i18n } from "discourse/lib/computed";
|
||||||
import AdminUser from "admin/models/admin-user";
|
import AdminUser from "admin/models/admin-user";
|
||||||
import CanCheckEmails from "discourse/mixins/can-check-emails";
|
import CanCheckEmails from "discourse/mixins/can-check-emails";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(CanCheckEmails, {
|
export default Controller.extend(CanCheckEmails, {
|
||||||
model: null,
|
model: null,
|
||||||
query: null,
|
query: null,
|
||||||
order: null,
|
order: null,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import WatchedWord from "admin/models/watched-word";
|
import WatchedWord from "admin/models/watched-word";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
import showModal from "discourse/lib/show-modal";
|
import showModal from "discourse/lib/show-modal";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
actionNameKey: null,
|
actionNameKey: null,
|
||||||
adminWatchedWords: Ember.inject.controller(),
|
adminWatchedWords: Ember.inject.controller(),
|
||||||
showWordsList: Ember.computed.or(
|
showWordsList: Ember.computed.or(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
filter: null,
|
filter: null,
|
||||||
filtered: false,
|
filtered: false,
|
||||||
showWords: false,
|
showWords: false,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
pingDisabled: false,
|
pingDisabled: false,
|
||||||
incomingCount: Ember.computed.alias("incomingEventIds.length"),
|
incomingCount: Ember.computed.alias("incomingEventIds.length"),
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { extractDomainFromUrl } from "discourse/lib/utilities";
|
import { extractDomainFromUrl } from "discourse/lib/utilities";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import InputValidation from "discourse/models/input-validation";
|
import InputValidation from "discourse/models/input-validation";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
adminWebHooks: Ember.inject.controller(),
|
adminWebHooks: Ember.inject.controller(),
|
||||||
eventTypes: Ember.computed.alias("adminWebHooks.eventTypes"),
|
eventTypes: Ember.computed.alias("adminWebHooks.eventTypes"),
|
||||||
defaultEventTypes: Ember.computed.alias("adminWebHooks.defaultEventTypes"),
|
defaultEventTypes: Ember.computed.alias("adminWebHooks.defaultEventTypes"),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
destroy(webhook) {
|
destroy(webhook) {
|
||||||
return bootbox.confirm(
|
return bootbox.confirm(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
router: Ember.inject.service(),
|
router: Ember.inject.service(),
|
||||||
|
|
||||||
@computed("siteSettings.enable_group_directory")
|
@computed("siteSettings.enable_group_directory")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import {
|
import {
|
||||||
@ -52,7 +53,7 @@ const SCSS_VARIABLE_NAMES = [
|
|||||||
"love-low"
|
"love-low"
|
||||||
];
|
];
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
adminCustomizeThemesShow: Ember.inject.controller(),
|
adminCustomizeThemesShow: Ember.inject.controller(),
|
||||||
|
|
||||||
uploadUrl: "/admin/themes/upload_asset",
|
uploadUrl: "/admin/themes/upload_asset",
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
sample: Ember.computed.alias("model.sample"),
|
sample: Ember.computed.alias("model.sample"),
|
||||||
errors: Ember.computed.alias("model.errors"),
|
errors: Ember.computed.alias("model.errors"),
|
||||||
count: Ember.computed.alias("model.grant_count"),
|
count: Ember.computed.alias("model.grant_count"),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
adminCustomizeColors: Ember.inject.controller(),
|
adminCustomizeColors: Ember.inject.controller(),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { observes } from "ember-addons/ember-computed-decorators";
|
import { observes } from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
@observes("model")
|
@observes("model")
|
||||||
modelChanged() {
|
modelChanged() {
|
||||||
const model = this.model;
|
const model = this.model;
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import IncomingEmail from "admin/models/incoming-email";
|
import IncomingEmail from "admin/models/incoming-email";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { longDate } from "discourse/lib/formatter";
|
import { longDate } from "discourse/lib/formatter";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
@computed("model.date")
|
@computed("model.date")
|
||||||
date(d) {
|
date(d) {
|
||||||
return longDate(d);
|
return longDate(d);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
@ -10,7 +11,7 @@ import { POPULAR_THEMES } from "discourse-common/helpers/popular-themes";
|
|||||||
|
|
||||||
const MIN_NAME_LENGTH = 4;
|
const MIN_NAME_LENGTH = 4;
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
popular: Ember.computed.equal("selection", "popular"),
|
popular: Ember.computed.equal("selection", "popular"),
|
||||||
local: Ember.computed.equal("selection", "local"),
|
local: Ember.computed.equal("selection", "local"),
|
||||||
remote: Ember.computed.equal("selection", "remote"),
|
remote: Ember.computed.equal("selection", "remote"),
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loading: true,
|
loading: true,
|
||||||
reseeding: false,
|
reseeding: false,
|
||||||
categories: null,
|
categories: null,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import PenaltyController from "admin/mixins/penalty-controller";
|
import PenaltyController from "admin/mixins/penalty-controller";
|
||||||
|
|
||||||
export default Ember.Controller.extend(PenaltyController, {
|
export default Controller.extend(PenaltyController, {
|
||||||
silenceUntil: null,
|
silenceUntil: null,
|
||||||
silencing: false,
|
silencing: false,
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality);
|
export default Controller.extend(ModalFunctionality);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
adminBackupsLogs: Ember.inject.controller(),
|
adminBackupsLogs: Ember.inject.controller(),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import PenaltyController from "admin/mixins/penalty-controller";
|
import PenaltyController from "admin/mixins/penalty-controller";
|
||||||
|
|
||||||
export default Ember.Controller.extend(PenaltyController, {
|
export default Controller.extend(PenaltyController, {
|
||||||
suspendUntil: null,
|
suspendUntil: null,
|
||||||
suspending: false,
|
suspending: false,
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loadDiff() {
|
loadDiff() {
|
||||||
this.set("loading", true);
|
this.set("loading", true);
|
||||||
ajax(
|
ajax(
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
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 Controller.extend(ModalFunctionality, {
|
||||||
@on("init")
|
@on("init")
|
||||||
@observes("model.value")
|
@observes("model.value")
|
||||||
_setup() {
|
_setup() {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } 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 Controller.extend(ModalFunctionality, {
|
||||||
@computed("value", "model.compiledRegularExpression")
|
@computed("value", "model.compiledRegularExpression")
|
||||||
matches(value, regexpString) {
|
matches(value, regexpString) {
|
||||||
if (!value || !regexpString) return;
|
if (!value || !regexpString) return;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
onShow() {
|
onShow() {
|
||||||
this.set("updateExistingUsers", null);
|
this.set("updateExistingUsers", null);
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
faqOverriden: Ember.computed.gt("siteSettings.faq_url.length", 0),
|
faqOverriden: Ember.computed.gt("siteSettings.faq_url.length", 0),
|
||||||
|
|
||||||
@computed
|
@computed
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { changeEmail } from "discourse/lib/user-activation";
|
import { changeEmail } from "discourse/lib/user-activation";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
accountCreated: null,
|
accountCreated: null,
|
||||||
newEmail: null,
|
newEmail: null,
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { resendActivationEmail } from "discourse/lib/user-activation";
|
import { resendActivationEmail } from "discourse/lib/user-activation";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
sendActivationEmail() {
|
sendActivationEmail() {
|
||||||
resendActivationEmail(this.get("accountCreated.username")).then(() => {
|
resendActivationEmail(this.get("accountCreated.username")).then(() => {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import { changeEmail } from "discourse/lib/user-activation";
|
import { changeEmail } from "discourse/lib/user-activation";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
login: Ember.inject.controller(),
|
login: Ember.inject.controller(),
|
||||||
|
|
||||||
currentEmail: null,
|
currentEmail: null,
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { cookAsync } from "discourse/lib/text";
|
import { cookAsync } from "discourse/lib/text";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
post: null,
|
post: null,
|
||||||
resolve: null,
|
resolve: null,
|
||||||
reject: null,
|
reject: null,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { isAppWebview, isiOSPWA } from "discourse/lib/utilities";
|
import { isAppWebview, isiOSPWA } from "discourse/lib/utilities";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
showTop: true,
|
showTop: true,
|
||||||
showFooter: false,
|
showFooter: false,
|
||||||
router: Ember.inject.service(),
|
router: Ember.inject.service(),
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
actions: {
|
actions: {
|
||||||
finishConnect() {
|
finishConnect() {
|
||||||
ajax({
|
ajax({
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
expanded: false,
|
expanded: false,
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { allowsImages } from "discourse/lib/utilities";
|
import { allowsImages } from "discourse/lib/utilities";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
@computed(
|
@computed(
|
||||||
"selected",
|
"selected",
|
||||||
"user.system_avatar_upload_id",
|
"user.system_avatar_upload_id",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
@computed("model")
|
@computed("model")
|
||||||
badgeGroups(model) {
|
badgeGroups(model) {
|
||||||
var sorted = _.sortBy(model, function(badge) {
|
var sorted = _.sortBy(model, function(badge) {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
import UserBadge from "discourse/models/user-badge";
|
import UserBadge from "discourse/models/user-badge";
|
||||||
import {
|
import {
|
||||||
@ -5,7 +6,7 @@ import {
|
|||||||
observes
|
observes
|
||||||
} from "ember-addons/ember-computed-decorators";
|
} from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
queryParams: ["username"],
|
queryParams: ["username"],
|
||||||
noMoreBadges: false,
|
noMoreBadges: false,
|
||||||
userBadges: null,
|
userBadges: null,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
modal: null
|
modal: null
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { topicLevels } from "discourse/lib/notification-levels";
|
import { topicLevels } from "discourse/lib/notification-levels";
|
||||||
|
|
||||||
// Support for changing the notification level of various topics
|
// Support for changing the notification level of various topics
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
topicBulkActions: Ember.inject.controller(),
|
topicBulkActions: Ember.inject.controller(),
|
||||||
notificationLevelId: null,
|
notificationLevelId: null,
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
topicController: Ember.inject.controller("topic"),
|
topicController: Ember.inject.controller("topic"),
|
||||||
|
|
||||||
saving: false,
|
saving: false,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
import Topic from "discourse/models/topic";
|
import Topic from "discourse/models/topic";
|
||||||
|
|
||||||
// Modal related to changing the timestamp of posts
|
// Modal related to changing the timestamp of posts
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
topicController: Ember.inject.controller("topic"),
|
topicController: Ember.inject.controller("topic"),
|
||||||
saving: false,
|
saving: false,
|
||||||
date: "",
|
date: "",
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
import Quote from "discourse/lib/quote";
|
import Quote from "discourse/lib/quote";
|
||||||
import Draft from "discourse/models/draft";
|
import Draft from "discourse/models/draft";
|
||||||
@ -74,7 +75,7 @@ export function addPopupMenuOptionsCallback(callback) {
|
|||||||
_popupMenuOptionsCallbacks.push(callback);
|
_popupMenuOptionsCallbacks.push(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
topicController: Ember.inject.controller("topic"),
|
topicController: Ember.inject.controller("topic"),
|
||||||
router: Ember.inject.service(),
|
router: Ember.inject.service(),
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
publicCategoryId: null,
|
publicCategoryId: null,
|
||||||
saving: true,
|
saving: true,
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { setting } from "discourse/lib/computed";
|
import { setting } from "discourse/lib/computed";
|
||||||
@ -14,7 +15,7 @@ import UserFieldsValidation from "discourse/mixins/user-fields-validation";
|
|||||||
import { userPath } from "discourse/lib/url";
|
import { userPath } from "discourse/lib/url";
|
||||||
import { findAll } from "discourse/models/login-method";
|
import { findAll } from "discourse/models/login-method";
|
||||||
|
|
||||||
export default Ember.Controller.extend(
|
export default Controller.extend(
|
||||||
ModalFunctionality,
|
ModalFunctionality,
|
||||||
PasswordValidation,
|
PasswordValidation,
|
||||||
UsernameValidation,
|
UsernameValidation,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import DiscourseNavigation from "discourse/components/d-navigation";
|
import DiscourseNavigation from "discourse/components/d-navigation";
|
||||||
|
|
||||||
// Just add query params here to have them automatically passed to topic list filters.
|
// Just add query params here to have them automatically passed to topic list filters.
|
||||||
@ -25,7 +26,7 @@ controllerOpts.queryParams.forEach(
|
|||||||
p => (controllerOpts[p] = Ember.computed.alias(`discoveryTopics.${p}`))
|
p => (controllerOpts[p] = Ember.computed.alias(`discoveryTopics.${p}`))
|
||||||
);
|
);
|
||||||
|
|
||||||
const Controller = Ember.Controller.extend(controllerOpts);
|
const Controller = Controller.extend(controllerOpts);
|
||||||
|
|
||||||
export const addDiscoveryQueryParam = function(p, opts) {
|
export const addDiscoveryQueryParam = function(p, opts) {
|
||||||
queryParams[p] = opts;
|
queryParams[p] = opts;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
discoveryTopics: Ember.inject.controller("discovery/topics"),
|
discoveryTopics: Ember.inject.controller("discovery/topics"),
|
||||||
navigationCategory: Ember.inject.controller("navigation/category"),
|
navigationCategory: Ember.inject.controller("navigation/category"),
|
||||||
application: Ember.inject.controller(),
|
application: Ember.inject.controller(),
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import DiscourseURL from "discourse/lib/url";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
@ -7,7 +8,7 @@ import {
|
|||||||
observes
|
observes
|
||||||
} from "ember-addons/ember-computed-decorators";
|
} from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
selectedTab: null,
|
selectedTab: null,
|
||||||
saving: false,
|
saving: false,
|
||||||
deleting: false,
|
deleting: false,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import TopicTimer from "discourse/models/topic-timer";
|
import TopicTimer from "discourse/models/topic-timer";
|
||||||
@ -10,7 +11,7 @@ export const DELETE_STATUS_TYPE = "delete";
|
|||||||
export const REMINDER_TYPE = "reminder";
|
export const REMINDER_TYPE = "reminder";
|
||||||
export const BUMP_TYPE = "bump";
|
export const BUMP_TYPE = "bump";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loading: false,
|
loading: false,
|
||||||
isPublic: "true",
|
isPublic: "true",
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { SECOND_FACTOR_METHODS } from "discourse/models/user";
|
import { SECOND_FACTOR_METHODS } from "discourse/models/user";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
@ -5,7 +6,7 @@ import DiscourseURL from "discourse/lib/url";
|
|||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import { getWebauthnCredential } from "discourse/lib/webauthn";
|
import { getWebauthnCredential } from "discourse/lib/webauthn";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
lockImageUrl: Discourse.getURL("/images/lock.svg"),
|
lockImageUrl: Discourse.getURL("/images/lock.svg"),
|
||||||
|
|
||||||
@computed("model")
|
@computed("model")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import {
|
import {
|
||||||
on,
|
on,
|
||||||
default as computed
|
default as computed
|
||||||
@ -26,7 +27,7 @@ const ButtonBackBright = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// The controller for the nice error page
|
// The controller for the nice error page
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
thrown: null,
|
thrown: null,
|
||||||
lastTransition: null,
|
lastTransition: null,
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loading: null,
|
loading: null,
|
||||||
reviewableExplanation: null,
|
reviewableExplanation: null,
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { categoryLinkHTML } from "discourse/helpers/category-link";
|
import { categoryLinkHTML } from "discourse/helpers/category-link";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import InputValidation from "discourse/models/input-validation";
|
import InputValidation from "discourse/models/input-validation";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
topicController: Ember.inject.controller("topic"),
|
topicController: Ember.inject.controller("topic"),
|
||||||
|
|
||||||
loading: true,
|
loading: true,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import ActionSummary from "discourse/models/action-summary";
|
import ActionSummary from "discourse/models/action-summary";
|
||||||
import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";
|
import { MAX_MESSAGE_LENGTH } from "discourse/models/post-action-type";
|
||||||
@ -5,7 +6,7 @@ import computed from "ember-addons/ember-computed-decorators";
|
|||||||
import optionalService from "discourse/lib/optional-service";
|
import optionalService from "discourse/lib/optional-service";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
adminTools: optionalService(),
|
adminTools: optionalService(),
|
||||||
userDetails: null,
|
userDetails: null,
|
||||||
selected: null,
|
selected: null,
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { escapeExpression } from "discourse/lib/utilities";
|
import { escapeExpression } from "discourse/lib/utilities";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
offerHelp: null,
|
offerHelp: null,
|
||||||
helpSeen: false,
|
helpSeen: false,
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import {
|
import {
|
||||||
translateResults,
|
translateResults,
|
||||||
@ -24,7 +25,7 @@ const SortOrders = [
|
|||||||
];
|
];
|
||||||
const PAGE_LIMIT = 10;
|
const PAGE_LIMIT = 10;
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
application: Ember.inject.controller(),
|
application: Ember.inject.controller(),
|
||||||
composer: Ember.inject.controller(),
|
composer: Ember.inject.controller(),
|
||||||
bulkSelectEnabled: null,
|
bulkSelectEnabled: null,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
@ -5,82 +6,78 @@ import GrantBadgeController from "discourse/mixins/grant-badge-controller";
|
|||||||
import Badge from "discourse/models/badge";
|
import Badge from "discourse/models/badge";
|
||||||
import UserBadge from "discourse/models/user-badge";
|
import UserBadge from "discourse/models/user-badge";
|
||||||
|
|
||||||
export default Ember.Controller.extend(
|
export default Controller.extend(ModalFunctionality, GrantBadgeController, {
|
||||||
ModalFunctionality,
|
topicController: Ember.inject.controller("topic"),
|
||||||
GrantBadgeController,
|
loading: true,
|
||||||
{
|
saving: false,
|
||||||
topicController: Ember.inject.controller("topic"),
|
selectedBadgeId: null,
|
||||||
loading: true,
|
|
||||||
saving: false,
|
|
||||||
selectedBadgeId: null,
|
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
this.allBadges = [];
|
this.allBadges = [];
|
||||||
this.userBadges = [];
|
this.userBadges = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("topicController.selectedPosts")
|
@computed("topicController.selectedPosts")
|
||||||
post() {
|
post() {
|
||||||
return this.get("topicController.selectedPosts")[0];
|
return this.get("topicController.selectedPosts")[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("post")
|
@computed("post")
|
||||||
badgeReason(post) {
|
badgeReason(post) {
|
||||||
const url = post.get("url");
|
const url = post.get("url");
|
||||||
const protocolAndHost =
|
const protocolAndHost =
|
||||||
window.location.protocol + "//" + window.location.host;
|
window.location.protocol + "//" + window.location.host;
|
||||||
|
|
||||||
return url.indexOf("/") === 0 ? protocolAndHost + url : url;
|
return url.indexOf("/") === 0 ? protocolAndHost + url : url;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed("saving", "selectedBadgeGrantable")
|
@computed("saving", "selectedBadgeGrantable")
|
||||||
buttonDisabled(saving, selectedBadgeGrantable) {
|
buttonDisabled(saving, selectedBadgeGrantable) {
|
||||||
return saving || !selectedBadgeGrantable;
|
return saving || !selectedBadgeGrantable;
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.set("loading", true);
|
this.set("loading", true);
|
||||||
|
|
||||||
Ember.RSVP.all([
|
Ember.RSVP.all([
|
||||||
Badge.findAll(),
|
Badge.findAll(),
|
||||||
UserBadge.findByUsername(this.get("post.username"))
|
UserBadge.findByUsername(this.get("post.username"))
|
||||||
]).then(([allBadges, userBadges]) => {
|
]).then(([allBadges, userBadges]) => {
|
||||||
this.setProperties({
|
this.setProperties({
|
||||||
allBadges: allBadges,
|
allBadges: allBadges,
|
||||||
userBadges: userBadges,
|
userBadges: userBadges,
|
||||||
loading: false
|
loading: false
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
grantBadge() {
|
grantBadge() {
|
||||||
this.set("saving", true);
|
this.set("saving", true);
|
||||||
|
|
||||||
this.grantBadge(
|
this.grantBadge(
|
||||||
this.selectedBadgeId,
|
this.selectedBadgeId,
|
||||||
this.get("post.username"),
|
this.get("post.username"),
|
||||||
this.badgeReason
|
this.badgeReason
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
newBadge => {
|
||||||
|
this.set("selectedBadgeId", null);
|
||||||
|
this.flash(
|
||||||
|
I18n.t("badges.successfully_granted", {
|
||||||
|
username: this.get("post.username"),
|
||||||
|
badge: newBadge.get("badge.name")
|
||||||
|
}),
|
||||||
|
"success"
|
||||||
|
);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.flash(extractError(error), "error");
|
||||||
|
}
|
||||||
)
|
)
|
||||||
.then(
|
.finally(() => this.set("saving", false));
|
||||||
newBadge => {
|
|
||||||
this.set("selectedBadgeId", null);
|
|
||||||
this.flash(
|
|
||||||
I18n.t("badges.successfully_granted", {
|
|
||||||
username: this.get("post.username"),
|
|
||||||
badge: newBadge.get("badge.name")
|
|
||||||
}),
|
|
||||||
"success"
|
|
||||||
);
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
this.flash(extractError(error), "error");
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.finally(() => this.set("saving", false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
});
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { observes } from "ember-addons/ember-computed-decorators";
|
import { observes } from "ember-addons/ember-computed-decorators";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
group: Ember.inject.controller(),
|
group: Ember.inject.controller(),
|
||||||
groupActivity: Ember.inject.controller(),
|
groupActivity: Ember.inject.controller(),
|
||||||
application: Ember.inject.controller(),
|
application: Ember.inject.controller(),
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export default Ember.Controller.extend({
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend({
|
||||||
actions: {
|
actions: {
|
||||||
loadMore() {
|
loadMore() {
|
||||||
this.model.loadMore();
|
this.model.loadMore();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export default Ember.Controller.extend({
|
import Controller from "@ember/controller";
|
||||||
|
export default Controller.extend({
|
||||||
router: Ember.inject.service(),
|
router: Ember.inject.service(),
|
||||||
queryParams: ["category_id"]
|
queryParams: ["category_id"]
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loading: false,
|
loading: false,
|
||||||
setAsOwner: false,
|
setAsOwner: false,
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import computed from "ember-addons/ember-computed-decorators";
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
import { extractError } from "discourse/lib/ajax-error";
|
import { extractError } from "discourse/lib/ajax-error";
|
||||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Controller.extend(ModalFunctionality, {
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|
||||||
@computed("input", "loading", "result")
|
@computed("input", "loading", "result")
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||||
import Group from "discourse/models/group";
|
import Group from "discourse/models/group";
|
||||||
import {
|
import {
|
||||||
@ -6,7 +7,7 @@ import {
|
|||||||
} from "ember-addons/ember-computed-decorators";
|
} from "ember-addons/ember-computed-decorators";
|
||||||
import debounce from "discourse/lib/debounce";
|
import debounce from "discourse/lib/debounce";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
queryParams: ["order", "desc", "filter"],
|
queryParams: ["order", "desc", "filter"],
|
||||||
order: "",
|
order: "",
|
||||||
desc: null,
|
desc: null,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
|
import Controller from "@ember/controller";
|
||||||
import {
|
import {
|
||||||
default as computed,
|
default as computed,
|
||||||
observes
|
observes
|
||||||
} from "ember-addons/ember-computed-decorators";
|
} from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
export default Ember.Controller.extend({
|
export default Controller.extend({
|
||||||
group: Ember.inject.controller(),
|
group: Ember.inject.controller(),
|
||||||
loading: false,
|
loading: false,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user