going back to angular routing
This commit is contained in:
@@ -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',
|
||||
|
||||
7
assets/linker/js/controllers/home-controller.coffee
Normal file
7
assets/linker/js/controllers/home-controller.coffee
Normal file
@@ -0,0 +1,7 @@
|
||||
lunchControllers = angular.module 'lunchControllers'
|
||||
|
||||
lunchControllers.controller 'HomeCtrl', ['$scope', '$location',
|
||||
HomeController = ($scope,$location) ->
|
||||
$scope.createRun = () ->
|
||||
$location.path '/run/create'
|
||||
]
|
||||
24
assets/linker/templates/home.jade
Normal file
24
assets/linker/templates/home.jade
Normal 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
|
||||
|
||||
16
assets/linker/templates/includes/nav.jade
Normal file
16
assets/linker/templates/includes/nav.jade
Normal 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
|
||||
6
assets/linker/templates/layouts/interior-page.jade
Normal file
6
assets/linker/templates/layouts/interior-page.jade
Normal file
@@ -0,0 +1,6 @@
|
||||
.interior
|
||||
include includes/nav
|
||||
h1
|
||||
block pagetitle
|
||||
|
||||
block interiorcontent
|
||||
Reference in New Issue
Block a user