DEV: Import DiscourseRoute rather than Discourse.Route (#8225)
* DEV: Discourse.Route -> DiscourseRoute with import * ran prettier on all routes * prettiered one more file
This commit is contained in:
parent
12409f63a0
commit
e5311ab645
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import BackupStatus from "admin/models/backup-status";
|
||||
|
@ -6,7 +7,7 @@ import PreloadStore from "preload-store";
|
|||
|
||||
const LOG_CHANNEL = "/admin/backups/logs";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
activate() {
|
||||
this.messageBus.subscribe(LOG_CHANNEL, log => {
|
||||
if (log.message === "[STARTED]") {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import Badge from "discourse/models/badge";
|
||||
import BadgeGrouping from "discourse/models/badge-grouping";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
_json: null,
|
||||
|
||||
model() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
activate() {
|
||||
this.controllerFor("admin-dashboard-general").fetchDashboard();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return ajax("/admin/reports").then(json => json);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
activate() {
|
||||
this.controllerFor("admin-dashboard").fetchProblems();
|
||||
this.controllerFor("admin-dashboard").fetchDashboard();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import IncomingEmail from "admin/models/incoming-email";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return IncomingEmail.findAll({ status: this.status });
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import EmailSettings from "admin/models/email-settings";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return EmailSettings.find();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
setupController(controller) {
|
||||
controller.setProperties({
|
||||
loading: true,
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import {
|
||||
default as EmailPreview,
|
||||
oneWeekAgo
|
||||
} from "admin/models/email-preview";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return EmailPreview.findDigest(this.currentUser.get("username"));
|
||||
},
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
export default Discourse.Route.extend({
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model: function() {
|
||||
return ajax("/admin/customize/emojis.json").then(function(emojis) {
|
||||
return emojis.map(function(emoji) {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("flagged-post", { filter: "active" });
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("flagged-post", { filter: "old" });
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("flagged-topic");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
redirect: function() {
|
||||
this.transitionTo("adminLogs.staffActionLogs");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
renderTemplate: function() {
|
||||
this.render("admin/templates/logs/screened-emails", { into: "adminLogs" });
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
renderTemplate() {
|
||||
this.render("admin/templates/logs/screened-ip-addresses", {
|
||||
into: "adminLogs"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
renderTemplate: function() {
|
||||
this.render("admin/templates/logs/screened-urls", { into: "adminLogs" });
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
// TODO: make this automatic using an `{{outlet}}`
|
||||
renderTemplate: function() {
|
||||
this.render("admin/templates/logs/staff-action-logs", {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Permalink from "admin/models/permalink";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return Permalink.findAll();
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel() {
|
||||
this.transitionTo("admin.dashboardReports");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
start_date: { refreshModel: true },
|
||||
end_date: { refreshModel: true },
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
period: { refreshModel: true },
|
||||
searchType: { refreshModel: true }
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { fillMissingDates } from "discourse/lib/utilities";
|
||||
import { translateResults } from "discourse/lib/search";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
term: { refreshModel: true },
|
||||
period: { refreshModel: true },
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
// The model depends on user input, so let the controller do the work:
|
||||
this.controllerFor("adminSiteSettingsCategory").set(
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
Handles when you click the Site Settings tab in admin, but haven't
|
||||
chosen a category. It will redirect to the first category.
|
||||
**/
|
||||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel() {
|
||||
this.replaceWith(
|
||||
"adminSiteSettingsCategory",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import SiteSetting from "admin/models/site-setting";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
filter: { replace: true }
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import UserBadge from "discourse/models/user-badge";
|
||||
import Badge from "discourse/models/badge";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
const username = this.modelFor("adminUser").get("username");
|
||||
return UserBadge.findByUsername(username);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import UserField from "admin/models/user-field";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model: function() {
|
||||
return this.store.findAll("user-field");
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Group from "discourse/models/group";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.modelFor("adminUser");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.modelFor("adminUser");
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import AdminUser from "admin/models/admin-user";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
serialize(model) {
|
||||
return {
|
||||
user_id: model.get("id"),
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
redirect: function() {
|
||||
this.transitionTo("adminUsersList");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel: function() {
|
||||
this.transitionTo("adminUsersList.show", "active");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
order: { refreshModel: true },
|
||||
ascending: { refreshModel: true }
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { exportEntity } from "discourse/lib/export-csv";
|
||||
import { outputExportResult } from "discourse/lib/export-result";
|
||||
import AdminUser from "admin/models/admin-user";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
actions: {
|
||||
exportUsers() {
|
||||
exportEntity("user_list", {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
this.controllerFor("adminWatchedWordsAction").set(
|
||||
"actionNameKey",
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel() {
|
||||
this.replaceWith(
|
||||
"adminWatchedWords.action",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import WatchedWord from "admin/models/watched-word";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
filter: { replace: true }
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
return this.store.findAll(
|
||||
"web-hook-event",
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
serialize(model) {
|
||||
return { web_hook_id: model.get("id") || "new" };
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("admin_title");
|
||||
},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import StaticPage from "discourse/models/static-page";
|
||||
import { default as DiscourseURL, jumpToElement } from "discourse/lib/url";
|
||||
|
||||
|
@ -8,7 +9,7 @@ const configs = {
|
|||
};
|
||||
|
||||
export default function(page) {
|
||||
return Discourse.Route.extend({
|
||||
return DiscourseRoute.extend({
|
||||
renderTemplate() {
|
||||
this.render("static");
|
||||
},
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return ajax("/about.json").then(result => {
|
||||
let activeAdmins = [];
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { setting } from "discourse/lib/computed";
|
||||
import logout from "discourse/lib/logout";
|
||||
|
@ -20,7 +21,7 @@ function unlessReadOnly(method, message) {
|
|||
};
|
||||
}
|
||||
|
||||
const ApplicationRoute = Discourse.Route.extend(OpenComposer, {
|
||||
const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
||||
siteTitle: setting("title"),
|
||||
shortSiteDescription: setting("short_site_description"),
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel() {
|
||||
const params = this.paramsFor("associate-account");
|
||||
this.replaceWith(`preferences.account`, this.currentUser).then(() =>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Badge from "discourse/models/badge";
|
||||
import PreloadStore from "preload-store";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
if (PreloadStore.get("badges")) {
|
||||
return PreloadStore.getAndRemove("badges").then(json =>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import UserBadge from "discourse/models/user-badge";
|
||||
import Badge from "discourse/models/badge";
|
||||
import PreloadStore from "preload-store";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
username: {
|
||||
refreshModel: true
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { emojiUnescape } from "discourse/lib/text";
|
||||
|
||||
export default function(filter) {
|
||||
return Discourse.Route.extend({
|
||||
return DiscourseRoute.extend({
|
||||
actions: {
|
||||
didTransition() {
|
||||
this.controllerFor("user").set("indexStream", true);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import {
|
||||
filterQueryParams,
|
||||
findTopicList
|
||||
|
@ -10,7 +11,7 @@ import Category from "discourse/models/category";
|
|||
|
||||
// A helper function to create a category route with parameters
|
||||
export default (filterArg, params) => {
|
||||
return Discourse.Route.extend({
|
||||
return DiscourseRoute.extend({
|
||||
queryParams,
|
||||
|
||||
model(modelParams) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { queryParams } from "discourse/controllers/discovery-sortable";
|
||||
import { defaultHomepage } from "discourse/lib/utilities";
|
||||
|
||||
|
@ -70,7 +71,7 @@ function findTopicList(store, tracking, filter, filterParams, extras) {
|
|||
|
||||
export default function(filter, extras) {
|
||||
extras = extras || {};
|
||||
return Discourse.Route.extend(
|
||||
return DiscourseRoute.extend(
|
||||
{
|
||||
queryParams,
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import OpenComposer from "discourse/mixins/open-composer";
|
||||
import CategoryList from "discourse/models/category-list";
|
||||
|
@ -7,7 +8,7 @@ import { ajax } from "discourse/lib/ajax";
|
|||
import PreloadStore from "preload-store";
|
||||
import { searchPriorities } from "discourse/components/concerns/category-search-priorities";
|
||||
|
||||
const DiscoveryCategoriesRoute = Discourse.Route.extend(OpenComposer, {
|
||||
const DiscoveryCategoriesRoute = DiscourseRoute.extend(OpenComposer, {
|
||||
renderTemplate() {
|
||||
this.render("navigation/categories", { outlet: "navigation-bar" });
|
||||
this.render("discovery/categories", { outlet: "list-container" });
|
||||
|
|
|
@ -2,10 +2,11 @@
|
|||
The parent route for all discovery routes.
|
||||
Handles the logic for showing the loading spinners.
|
||||
**/
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import OpenComposer from "discourse/mixins/open-composer";
|
||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||
|
||||
export default Discourse.Route.extend(OpenComposer, {
|
||||
export default DiscourseRoute.extend(OpenComposer, {
|
||||
redirect() {
|
||||
return this.redirectIfLoginRequired();
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("login.title");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
serialize() {
|
||||
return "";
|
||||
},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import {
|
||||
translateResults,
|
||||
|
@ -8,7 +9,7 @@ import PreloadStore from "preload-store";
|
|||
import { getTransient, setTransient } from "discourse/lib/page-tracker";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
queryParams: {
|
||||
q: {},
|
||||
expanded: false,
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export function buildGroupPage(type) {
|
||||
return Discourse.Route.extend({
|
||||
return DiscourseRoute.extend({
|
||||
type,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t(`groups.topics`);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("groups.members.title");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
beforeModel() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("groups.manage.logs.title");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel: function() {
|
||||
this.transitionTo("group.index");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("groups.messages");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("groups.requests.title");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return [this.modelFor("group").get("name")];
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("groups.index.title");
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Group from "discourse/models/group";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
titleToken() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import PreloadStore from "preload-store";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("invites.accept_title");
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import User from "discourse/models/user";
|
||||
import Group from "discourse/models/group";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel(transition) {
|
||||
const params = transition.to.queryParams;
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Category from "discourse/models/category";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel(transition) {
|
||||
if (this.currentUser) {
|
||||
let category, categoryId;
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import PreloadStore from "preload-store";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { userPath } from "discourse/lib/url";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("login.reset_password");
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel({ params }) {
|
||||
return ajax(`/p/${params.post.id}`).then(t => {
|
||||
this.transitionTo(
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
return this.store.findAll("reviewable", params);
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.find("reviewable-settings");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
setupController(controller, model) {
|
||||
controller.set("reviewable", model);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("reviewable-topic");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
return I18n.t("review.title");
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
model(params) {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
model() {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Tag from "discourse/models/tag";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return this.store.findAll("tag").then(result => {
|
||||
if (result.extras) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Composer from "discourse/models/composer";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import {
|
||||
|
@ -7,7 +8,7 @@ import {
|
|||
import { queryParams } from "discourse/controllers/discovery-sortable";
|
||||
import PermissionType from "discourse/models/permission-type";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
navMode: "latest",
|
||||
|
||||
queryParams,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { default as Topic, ID_CONSTRAINT } from "discourse/models/topic";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
if (params.slugOrId.match(ID_CONSTRAINT)) {
|
||||
return { url: `/t/topic/${params.slugOrId}` };
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import Draft from "discourse/models/draft";
|
||||
|
||||
// This route is used for retrieving a topic based on params
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
// Avoid default model hook
|
||||
model(params) {
|
||||
return params;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { ID_CONSTRAINT } from "discourse/models/topic";
|
||||
|
||||
|
@ -9,7 +10,7 @@ const SCROLL_DELAY = 500;
|
|||
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
const TopicRoute = Discourse.Route.extend({
|
||||
const TopicRoute = DiscourseRoute.extend({
|
||||
redirect() {
|
||||
return this.redirectIfLoginRequired();
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
return ajax("/404-body", { dataType: "html" });
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
let userDraftsStream = this.modelFor("user").get("userDraftsStream");
|
||||
return userDraftsStream.load(this.site).then(() => userDraftsStream);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import ViewingActionType from "discourse/mixins/viewing-action-type";
|
||||
|
||||
export default Discourse.Route.extend(ViewingActionType, {
|
||||
export default DiscourseRoute.extend(ViewingActionType, {
|
||||
queryParams: {
|
||||
acting_username: { refreshModel: true }
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
let user = this.modelFor("user");
|
||||
if (user.get("profile_hidden")) {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import ViewingActionType from "discourse/mixins/viewing-action-type";
|
||||
import UserBadge from "discourse/models/user-badge";
|
||||
|
||||
export default Discourse.Route.extend(ViewingActionType, {
|
||||
export default DiscourseRoute.extend(ViewingActionType, {
|
||||
model() {
|
||||
return UserBadge.findByUsername(
|
||||
this.modelFor("user").get("username_lower"),
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel() {
|
||||
const { currentUser } = this;
|
||||
const viewingMe =
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
beforeModel: function() {
|
||||
this.replaceWith("userInvited.show", "pending");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Invite from "discourse/models/invite";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model(params) {
|
||||
Invite.findInvitedCount(this.modelFor("user")).then(result =>
|
||||
this.set("invitesCount", result)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
controllerName: "user-notifications",
|
||||
renderTemplate() {
|
||||
this.render("user/notifications-index");
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import ViewingActionType from "discourse/mixins/viewing-action-type";
|
||||
|
||||
export default Discourse.Route.extend(ViewingActionType, {
|
||||
export default DiscourseRoute.extend(ViewingActionType, {
|
||||
renderTemplate() {
|
||||
this.render("user/notifications");
|
||||
},
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
model() {
|
||||
const username = this.modelFor("user").get("username_lower");
|
||||
return ajax(`/tags/personal_messages/${username}`)
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import Draft from "discourse/models/draft";
|
||||
import Composer from "discourse/models/composer";
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
export default DiscourseRoute.extend({
|
||||
renderTemplate() {
|
||||
this.render("user/messages");
|
||||
},
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
export default Discourse.Route.extend({
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
showFooter: true,
|
||||
|
||||
model() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue