copied from a project that was version on mercurial
This commit is contained in:
commit
ec72b5b91a
24 files changed
+841
No files matched your search
@@ -0,0 +1,37 @@
|
||||
|
||||
root = this;
|
||||
|
||||
angular.module('bab', [
|
||||
'ngRoute'
|
||||
'bab.filters'
|
||||
'bab.services'
|
||||
'bab.directives'
|
||||
'bab.controllers'
|
||||
]).
|
||||
config(['$routeProvider', ($routeProvider) ->
|
||||
$routeProvider.when('/', {templateUrl: 'partials/home.html', controller: 'homeCtrl'})
|
||||
$routeProvider.when('/login', {templateUrl: 'partials/login.html', controller: 'loginCtrl'})
|
||||
$routeProvider.when('/about', {templateUrl: 'partials/about.html', controller: 'aboutCtrl'})
|
||||
$routeProvider.otherwise({redirectTo: '/'})
|
||||
])
|
||||
|
||||
root.filters = angular.module('bab.filters', [])
|
||||
root.services = angular.module('bab.services', [])
|
||||
root.directives = angular.module('bab.directives', [])
|
||||
root.controllers = angular.module('bab.controllers', [])
|
||||
|
||||
|
||||
root.filters.filter 'month', () ->
|
||||
(text) ->
|
||||
return ['janvier',
|
||||
'février',
|
||||
'mars',
|
||||
'avril',
|
||||
'may',
|
||||
'juin',
|
||||
'juillet',
|
||||
'aout',
|
||||
'september',
|
||||
'octobre',
|
||||
'novembre',
|
||||
'decembre'][Number(text) - 1]
|
||||
@@ -0,0 +1,4 @@
|
||||
root = this;
|
||||
|
||||
root.controllers.controller('aboutCtrl', ['$scope', ($scope) ->
|
||||
])
|
||||
@@ -0,0 +1,8 @@
|
||||
root = this;
|
||||
|
||||
|
||||
root.controllers.controller('homeCtrl', ['$scope', '$http', ($scope, $http) ->
|
||||
$scope.services = []
|
||||
$http.get('/webapps').then (resp) ->
|
||||
$scope.services = resp.data
|
||||
])
|
||||
@@ -0,0 +1,4 @@
|
||||
root = this;
|
||||
|
||||
root.controllers.controller('loginCtrl', ['$scope', ($scope) ->
|
||||
])
|
||||
@@ -0,0 +1,9 @@
|
||||
root = this;
|
||||
|
||||
root.controllers.controller('topBarCtrl', ['$scope', ($scope) ->
|
||||
$scope.$on('$routeChangeSuccess', (next, current) ->
|
||||
$scope.path = current.originalPath
|
||||
)
|
||||
|
||||
$scope.path = "home"
|
||||
])
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
template = """
|
||||
<div class="panel">
|
||||
<div class="row">
|
||||
<div class="large-12 columns" style="text-align:center;">
|
||||
<a href="{{ service.url }}"><img src="{{ service.image }}" style="height:100px;"></img></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns" style="text-align:center;">
|
||||
<h3 ><a href="{{ service.url }}"> {{ service.name }} </a></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
|
||||
directive = ($rootScope) ->
|
||||
directive =
|
||||
template: template
|
||||
replace: true,
|
||||
transclude: false,
|
||||
restrict: 'E',
|
||||
scope:
|
||||
service: "="
|
||||
controller:["$scope",
|
||||
($scope, $timeout) ->
|
||||
|
||||
]
|
||||
return directive
|
||||
|
||||
directives.directive("babService", ['$rootScope', directive])
|
||||
Reference in new issue
Block a user