diff --git a/app.js b/app.js index becb30e..83612e6 100644 --- a/app.js +++ b/app.js @@ -9,6 +9,8 @@ angular.module('adminApp', [ 'ngRoute', 'ngMessages', 'angularBootstrapMaterial', + 'app.navbar', + 'app.login', 'app.main', 'app.user', 'app.travel' @@ -16,5 +18,56 @@ angular.module('adminApp', [ config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); - $routeProvider.otherwise({redirectTo: '/main'}); -}]); + //$routeProvider.otherwise({redirectTo: '/main'}); + if((localStorage.getItem('cic_admin_token'))) + { + console.log(window.location.hash); + if(window.location.hash==='#!/login') + { + window.location='#!/main'; + } + + $routeProvider.otherwise({redirectTo: '/main'}); + }else{ + if(window.location!=='#!/login') + { + console.log('app, user no logged'); + + localStorage.removeItem('cic_admin_token'); + localStorage.removeItem('cic_admin_userdata'); + window.location='#!/login'; + $routeProvider.otherwise({redirectTo: '/login'}); + } + } +}]) + +.factory('httpInterceptor', function httpInterceptor () { + return { + request: function(config) { + return config; + }, + + requestError: function(config) { + return config; + }, + + response: function(res) { + return res; + }, + + responseError: function(res) { + return res; + } + }; +}) +.factory('api', function ($http) { + return { + init: function () { + $http.defaults.headers.common['X-Access-Token'] = localStorage.getItem('cic_admin_token'); + $http.defaults.headers.post['X-Access-Token'] = localStorage.getItem('cic_admin_token'); + } + }; +}) +.run(function (api) { + api.init(); +}); diff --git a/bower.json b/bower.json index efeda97..bb49372 100644 --- a/bower.json +++ b/bower.json @@ -1,18 +1,20 @@ { - "name": "carsincommonAdminWeb", - "description": "carsincommonAdminWeb", - "version": "0.0.0", - "homepage": "https://github.com/arnaucode/carsincommonAdmin", - "license": "MIT", - "private": true, - "dependencies": { - "angular": "^1.6.2", - "angular-route": "^1.6.1", - "angular-chart.js": "^1.1.1", - "vis": "^4.18.1", - "mui": "^0.9.20", - "angular-bootstrap-material": "abm#^0.1.4", - "angular-bootstrap": "^2.5.0", - "angular-messages": "^1.6.5" - } + "name": "carsincommonAdminWeb", + "description": "carsincommonAdminWeb", + "version": "0.0.0", + "homepage": "https://github.com/arnaucode/carsincommonAdmin", + "license": "MIT", + "private": true, + "dependencies": { + "angular": "^1.6.2", + "angular-route": "^1.6.1", + "angular-chart.js": "^1.1.1", + "vis": "^4.18.1", + "mui": "^0.9.20", + "angular-bootstrap-material": "abm#^0.1.4", + "angular-bootstrap": "^2.5.0", + "angular-messages": "^1.6.5", + "components-font-awesome": "^4.7.0", + "ui-leaflet": "^2.0.0" + } } diff --git a/img/avatars/chameleon.png b/img/avatars/chameleon.png new file mode 100644 index 0000000..91f30f6 Binary files /dev/null and b/img/avatars/chameleon.png differ diff --git a/img/avatars/clown-fish.png b/img/avatars/clown-fish.png new file mode 100644 index 0000000..2473fcc Binary files /dev/null and b/img/avatars/clown-fish.png differ diff --git a/img/avatars/duck.png b/img/avatars/duck.png new file mode 100644 index 0000000..2c48212 Binary files /dev/null and b/img/avatars/duck.png differ diff --git a/img/avatars/owl.png b/img/avatars/owl.png new file mode 100644 index 0000000..732dc88 Binary files /dev/null and b/img/avatars/owl.png differ diff --git a/img/avatars/penguin.png b/img/avatars/penguin.png new file mode 100644 index 0000000..295e7f1 Binary files /dev/null and b/img/avatars/penguin.png differ diff --git a/img/avatars/racoon.png b/img/avatars/racoon.png new file mode 100644 index 0000000..c4d3418 Binary files /dev/null and b/img/avatars/racoon.png differ diff --git a/img/avatars/siberian-husky.png b/img/avatars/siberian-husky.png new file mode 100644 index 0000000..9de786f Binary files /dev/null and b/img/avatars/siberian-husky.png differ diff --git a/img/avatars/sloth.png b/img/avatars/sloth.png new file mode 100644 index 0000000..2f7322a Binary files /dev/null and b/img/avatars/sloth.png differ diff --git a/img/avatars/tiger.png b/img/avatars/tiger.png new file mode 100644 index 0000000..b85ee3d Binary files /dev/null and b/img/avatars/tiger.png differ diff --git a/img/avatars/toucan.png b/img/avatars/toucan.png new file mode 100644 index 0000000..d16afd8 Binary files /dev/null and b/img/avatars/toucan.png differ diff --git a/img/faircoinpublickey_sample.png b/img/faircoinpublickey_sample.png new file mode 100644 index 0000000..6932043 Binary files /dev/null and b/img/faircoinpublickey_sample.png differ diff --git a/img/userProfileBackground.png b/img/userProfileBackground.png new file mode 100644 index 0000000..2ae41b5 Binary files /dev/null and b/img/userProfileBackground.png differ diff --git a/index.html b/index.html index d76e1ca..b5a9bb8 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,9 @@ + + + @@ -21,6 +24,8 @@
+ + @@ -45,10 +50,10 @@ - + + + + @@ -57,6 +62,8 @@ + + diff --git a/views/login/login.html b/views/login/login.html new file mode 100644 index 0000000..9adf663 --- /dev/null +++ b/views/login/login.html @@ -0,0 +1,29 @@ +{{user.description}}
+{{user.travels.length}} published travels
+{{user.likes.length}} likes
- From: {{travel.from.name}} + From: {{travel.from.name}}
- To: {{travel.from.name}} + To: {{travel.from.name}}
Can transport package @@ -25,11 +36,12 @@