Permalink
Browse files

enhancement: splits admin/sessions into proper pages (#217)

  • Loading branch information...
harshitagupta30 authored and CosmicCoder96 committed Jun 15, 2017
1 parent 64c9980 commit 0a6f07b5ab7c54889e2ca32083935d330d214a7f
@@ -84,7 +84,9 @@ router.map(function() {
this.route('status');
this.route('discounted-events');
});
this.route('sessions');
this.route('sessions', function() {
this.route('list', { path: '/:sessions_state' });
});
this.route('users');
this.route('permissions', function() {
this.route('event-roles');
@@ -5,92 +5,5 @@ const { Route } = Ember;
export default Route.extend({
titleToken() {
return this.i18n.t('Sessions');
},
model() {
return [{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
}];
}
});
@@ -0,0 +1,94 @@
import Ember from 'ember';
const { Route } = Ember;
export default Route.extend({
templateName: 'admin/sessions/list',
model() {
return [{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
}];
}
});
@@ -0,0 +1,108 @@
import Ember from 'ember';
const { Route } = Ember;
export default Route.extend({
titleToken() {
switch (this.get('params.sessions_state')) {
case 'pending':
return this.i18n.t('Pending');
case 'accepted':
return this.i18n.t('Accepted');
case 'rejected':
return this.i18n.t('Rejected');
case 'deleted':
return this.i18n.t('Deleted');
default:
return this.i18n.t('Session');
}
},
model(params) {
this.set('params', params);
return [{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
},
{
event: {
name: 'Event1'
},
title : 'Title1',
speakers : [
{
name: 'Speaker1'
},
{
name: 'Speaker2'
}
],
submittedAt : new Date(),
startsAt : new Date(),
endsAt : new Date()
}];
}
});
@@ -10,7 +10,7 @@
{{#link-to 'admin.sales' class='item'}}
{{t 'Sales'}}
{{/link-to}}
{{#link-to 'admin.sessions' class='item'}}
{{#link-to 'admin.sessions.index' class='item'}}
{{t 'Sessions'}}
{{/link-to}}
{{#link-to 'admin.users' class='item'}}
Oops, something went wrong.

0 comments on commit 0a6f07b

Please sign in to comment.