going back to angular routing

This commit is contained in:
Ben Ramey
2014-04-08 20:55:36 -05:00
parent ce935f6a1e
commit 11963bfb21
13 changed files with 52 additions and 41 deletions

View File

@@ -24,10 +24,6 @@ module.exports = {
* Overrides for the settings in `config/controllers.js`
* (specific to RunController)
*/
_config: {},
create: function(req,res) {
res.view();
}
_config: {}
};

View File

@@ -7,12 +7,20 @@ lunchApp = angular.module 'lunchApp', [
lunchApp.config ['$routeProvider',
($routeProvider) ->
$routeProvider
.when '/home',
templateUrl: 'templates/home.html',
controller: 'HomeCtrl'
.when '/run/create',
templateUrl: 'templates/run/create.html',
controller: 'CreateRunCtrl'
.when '/run/:id',
templateUrl: 'templates/run.html',
templateUrl: 'templates/run/show.html',
controller: 'RunCtrl'
.when '/run/:id/order/:inviteeName',
templateUrl: 'templates/create-order.html',
templateUrl: 'templates/run/create-order.html',
controller: 'CreateOrderCtrl'
.otherwise
redirectTo: '/home'
]
lunchApp.config ['$locationProvider',

View File

@@ -0,0 +1,7 @@
lunchControllers = angular.module 'lunchControllers'
lunchControllers.controller 'HomeCtrl', ['$scope', '$location',
HomeController = ($scope,$location) ->
$scope.createRun = () ->
$location.path '/run/create'
]

View File

@@ -0,0 +1,24 @@
#home-page(ng-controller='HomeCtrl')
.row
.col-xs-12.col-sm-6.offset-md-2
#logo.pod
h1
| lunch run
span.text-muted  me
.row
.col-xs-12.col-sm-6.offset-md-2
#welcome.pod
p
| Organize a lunch run in less than a minute. All you need to know is
strong  who 
| you want to invite and
strong  where 
| you want to go.
p Get started below. No login required.
.row
.col-xs-12.col-sm-6.offset-md-2
#cta.pod
a.btn.btn-block(ng-click='createRun()')
| start a run  
span.glyphicon.glyphicon-chevron-right

View File

@@ -0,0 +1,6 @@
.interior
include includes/nav
h1
block pagetitle
block interiorcontent

View File

@@ -1,27 +1,5 @@
extends ../layout
block content
#home-page
.row
.col-xs-12.col-sm-6.offset-md-2
#logo.pod
h1
| lunch run
span.text-muted  me
.row
.col-xs-12.col-sm-6.offset-md-2
#welcome.pod
p
| Organize a lunch run in less than a minute. All you need to know is
strong  who 
| you want to invite and
strong  where 
| you want to go.
p Get started below. No login required.
.row
.col-xs-12.col-sm-6.offset-md-2
#cta.pod
a.btn.btn-block(href='/run/create')
| start a run  
span.glyphicon.glyphicon-chevron-right
div(ng-view)

View File

@@ -1,9 +0,0 @@
extends layout
block content
.interior
include includes/nav
h1
block pagetitle
block interiorcontent

View File

@@ -24,6 +24,7 @@ html(lang="en",ng-app="lunchApp")
script(type="text/javascript", src="/linker/js/controllers/body-controller.js")
script(type="text/javascript", src="/linker/js/controllers/create-order-controller.js")
script(type="text/javascript", src="/linker/js/controllers/create-run-controller.js")
script(type="text/javascript", src="/linker/js/controllers/home-controller.js")
script(type="text/javascript", src="/linker/js/controllers/run-controller.js")
script(type="text/javascript", src="/linker/js/services/socket.js")
script(type="text/javascript", src="/linker/js/vendor/jquery.backstretch.min.js")

View File

@@ -1,4 +1,4 @@
extends ../interior-layout
extends ../layouts/interior-layout
block pagetitle
span.glyphicon.glyphicon-chevron-right