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

@@ -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,16 @@
nav.navbar(role='navigation')
.container-fluid
.navbar-header
button.navbar-toggle(type='button',data-toggle='collapse',data-target='main-nav')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href='/')
| lunch run
span.text-muted  me
.collapse.navbar-collapse#main-nav
ul.nav.navbar-nav
li
a(href='/') home

View File

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