mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 12:13:58 -06:00
ES6: Convert more routes over
This commit is contained in:
parent
bddffa7f9a
commit
5cd7e1b387
@ -1,12 +1,5 @@
|
||||
/**
|
||||
Shows a list of all badges.
|
||||
export default Discourse.Route.extend({
|
||||
|
||||
@class BadgesIndexRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.BadgesIndexRoute = Discourse.Route.extend({
|
||||
model: function() {
|
||||
if (PreloadStore.get('badges')) {
|
||||
return PreloadStore.getAndRemove('badges').then(function(json) {
|
@ -1,12 +1,4 @@
|
||||
/**
|
||||
Shows a particular badge.
|
||||
|
||||
@class BadgesShowRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.BadgesShowRoute = Ember.Route.extend({
|
||||
export default Ember.Route.extend({
|
||||
serialize: function(model) {
|
||||
return {id: model.get('id'), slug: model.get('name').replace(/[^A-Za-z0-9_]+/g, '-').toLowerCase()};
|
||||
},
|
5
app/assets/javascripts/discourse/routes/exception.js.es6
Normal file
5
app/assets/javascripts/discourse/routes/exception.js.es6
Normal file
@ -0,0 +1,5 @@
|
||||
export default Discourse.Route.extend({
|
||||
serialize: function() {
|
||||
return "";
|
||||
}
|
||||
});
|
@ -1,13 +0,0 @@
|
||||
/**
|
||||
Client-side pseudo-route for showing an error page.
|
||||
|
||||
@class ExceptionRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.ExceptionRoute = Discourse.Route.extend({
|
||||
serialize: function() {
|
||||
return "";
|
||||
}
|
||||
});
|
@ -1,12 +1,4 @@
|
||||
/**
|
||||
The route for the index of a Group
|
||||
|
||||
@class GroupIndexRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.GroupIndexRoute = Discourse.Route.extend({
|
||||
export default Discourse.Route.extend({
|
||||
model: function() {
|
||||
return this.modelFor('group').findPosts();
|
||||
},
|
@ -1,12 +1,4 @@
|
||||
/**
|
||||
Set things up to display the members of a group
|
||||
|
||||
@class GroupMembersRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.GroupMembersRoute = Discourse.Route.extend({
|
||||
export default Discourse.Route.extend({
|
||||
model: function() {
|
||||
return this.modelFor('group');
|
||||
},
|
@ -1,12 +1,4 @@
|
||||
/**
|
||||
The base route for a group
|
||||
|
||||
@class GroupRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.GroupRoute = Discourse.Route.extend({
|
||||
export default Discourse.Route.extend({
|
||||
|
||||
model: function(params) {
|
||||
return Discourse.Group.find(params.name);
|
@ -1,7 +1,7 @@
|
||||
Discourse.LoginRoute = Discourse.Route.extend({
|
||||
export default Discourse.Route.extend({
|
||||
beforeModel: function() {
|
||||
if (!Discourse.SiteSetting.login_required) {
|
||||
this.transitionTo('discovery.latest').then(function(e) {
|
||||
this.replaceWith('discovery.latest').then(function(e) {
|
||||
Ember.run.next(function() {
|
||||
e.send('showLogin');
|
||||
});
|
@ -1,9 +1,9 @@
|
||||
Discourse.SignupRoute = Discourse.Route.extend({
|
||||
export default Discourse.Route.extend({
|
||||
beforeModel: function() {
|
||||
this.transitionTo('discovery.latest').then(function(e) {
|
||||
this.replaceWith('discovery.latest').then(function(e) {
|
||||
Ember.run.next(function() {
|
||||
e.send('showCreateAccount');
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
@ -1,11 +1,3 @@
|
||||
/**
|
||||
View for showing a particular badge.
|
||||
|
||||
@class BadgesShowView
|
||||
@extends Discourse.View
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
export default Discourse.View.extend(Discourse.LoadMore, {
|
||||
eyelineSelector: '.badge-user',
|
||||
tickOrX: function(field){
|
||||
|
Loading…
Reference in New Issue
Block a user