Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from spira/master
feature/api-transformers...master
- Loading branch information
Showing
26 changed files
with
333 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,22 @@ | ||
<div id="header-container" ui-view="navigation"></div> | ||
<div id="main-container" class="row"> | ||
<div ui-view="main"></div> | ||
<md-sidenav | ||
class="site-sidenav md-sidenav-left md-whiteframe-z2" | ||
md-component-id="left" | ||
md-is-locked-open="$mdMedia('gt-sm')" | ||
ui-view="navigation"> | ||
</md-sidenav> | ||
|
||
<div flex layout="column" | ||
tabIndex="-1" | ||
role="main" | ||
class="md-whiteframe-z2" | ||
> | ||
|
||
<md-toolbar layout="row" class="md-whiteframe-z1"> | ||
<md-button class="menu" hide-gt-sm ng-click="toggleLeftNav()" aria-label="Show Menu"> | ||
<md-icon>menu</md-icon> | ||
</md-button> | ||
<h1>Spira</h1> | ||
</md-toolbar> | ||
|
||
<md-content flex id="content" ui-view="main"></md-content> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,8 @@ | ||
|
||
<nav> | ||
<top-bar> | ||
<ul class="title-area"> | ||
<li class="name"> | ||
<a href="#">spira</a> | ||
</li> | ||
<li toggle-top-bar class="menu-icon"><a href="#">Menu</a></li> | ||
</ul> | ||
|
||
<top-bar-section> | ||
|
||
<ul class="left"> | ||
<li ng-repeat-start="state in childStates" ui-sref-active="active" ng-if="true"> <!--@todo set if to check if has children --> | ||
<a ui-sref="{{state.name}}"> | ||
<i ng-if="!!state.data.icon" class="fa fa-{{state.data.icon}}"> </i>{{state.data.title}} | ||
</a> | ||
</li> | ||
|
||
<li ng-repeat-end="state in childStates" ui-sref-active="active" ng-if="false"><!--@todo set if to check if has children --> | ||
<a ui-sref="{{state.name}}"> | ||
<i ng-if="!!state.data.icon" class="fa fa-{{state.data.icon}}"> </i>{{state.data.title}} | ||
</a> | ||
<ul top-bar-dropdown> | ||
<li ng-repeat="childState in state.children" ui-sref-active="active"> | ||
<a ui-sref="{{childState.name}}"><i ng-if="!!childState.data.icon" class="fa fa-{{childState.data.icon}}"> </i>{{childState.data.title}}</a> | ||
</li> | ||
</ul> | ||
</li> | ||
|
||
</ul> | ||
|
||
</top-bar-section> | ||
</top-bar> | ||
</nav> | ||
<md-list> | ||
<md-list-item ng-repeat="state in navigationStates | orderBy:orderMenuItems" > | ||
<md-button ng-click="toggleLeftNav()" ui-sref="{{state.name}}" ui-sref-active="selected"> | ||
<md-icon>{{state.data.icon}}</md-icon> | ||
{{state.data.title}} | ||
</md-button> | ||
</md-list-item> | ||
</md-list> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
angular.module('app.public.blog', [ | ||
'app.public.blog.post' | ||
]) | ||
|
||
.config(function(stateHelperServiceProvider) { | ||
stateHelperServiceProvider.addState('app.public.blog', { | ||
url: '/blog', | ||
views: { | ||
"main@app.public": { | ||
controller: 'app.public.blog.controller', | ||
templateUrl: 'templates/app/public/blog/blog.tpl.html' | ||
} | ||
}, | ||
resolve: /*@ngInject*/{ | ||
}, | ||
data: { | ||
title: "Blog", | ||
role: 'public', | ||
icon: 'content_paste', | ||
sortAfter: 'app.public.home', | ||
navigation: true | ||
} | ||
}); | ||
}) | ||
|
||
.controller('app.public.blog.controller', function($scope) { | ||
|
||
|
||
}) | ||
|
||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h2 class="md-flex">Blog</h2> | ||
<h3><md-icon>warning</md-icon> @todo</h3> | ||
|
||
|
||
<md-button class="md-raised md-primary">(md-primary)</md-button> | ||
<md-button class="md-raised md-primary md-hue-1">md-primary md-hue-1</md-button> | ||
<md-button class="md-raised md-primary md-hue-2">md-primary md-hue-2</md-button> | ||
<md-button class="md-raised md-primary md-hue-3">md-primary md-hue-3</md-button> | ||
|
||
<hr/> | ||
|
||
<md-button class="md-raised md-accent">(md-accent)</md-button> | ||
<md-button class="md-raised md-accent md-hue-1">md-accent md-hue-1</md-button> | ||
<md-button class="md-raised md-accent md-hue-2">md-accent md-hue-2</md-button> | ||
<md-button class="md-raised md-accent md-hue-3">md-accent md-hue-3</md-button> | ||
|
||
<hr/> | ||
|
||
<md-button class="md-raised md-warn">(md-warn)</md-button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h2 class="md-flex">Post Stub</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
angular.module('app.public.blog.post', []) | ||
|
||
.config(function(stateHelperServiceProvider) { | ||
stateHelperServiceProvider.addState('app.public.blog.post', { | ||
url: '/{permalink}', | ||
views: { | ||
'main@app.public': { | ||
controller: 'app.public.blog.post.controller', | ||
templateUrl: 'templates/app/public/blog/post/post.tpl.html' | ||
}, | ||
'content@app.public.blog.post': { | ||
templateUrl: 'templates/app/public/blog/post/post-stub.tpl.html' | ||
} | ||
}, | ||
resolve: /*@ngInject*/{ | ||
|
||
}, | ||
data: { | ||
title: "Blog Post", | ||
role: 'public' | ||
} | ||
}); | ||
}) | ||
|
||
.controller('app.public.blog.post.controller', function($scope) { | ||
|
||
|
||
}) | ||
|
||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<h2 class="md-flex">Post</h2> | ||
<div ui-view="content"> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
|
||
angular.module('app.public.error', []) | ||
|
||
.config(function(stateHelperServiceProvider, $httpProvider) { | ||
|
||
stateHelperServiceProvider.addState('app.public.error', { | ||
views: { | ||
"main@app.public": { | ||
controller: 'app.public.error.controller', | ||
templateUrl: 'public/error/error_template.tpl.html' | ||
} | ||
}, | ||
params: { | ||
title: null, | ||
message: null, | ||
details: null, | ||
errorType: null, | ||
url: null, | ||
method: null | ||
} | ||
}); | ||
|
||
$httpProvider.interceptors.push('errorInterceptor'); | ||
|
||
}) | ||
|
||
.factory('errorInterceptor',function($q, $rootScope, $injector) { | ||
return { | ||
'responseError': function(response) { | ||
|
||
var $state = $injector.get('$state'), | ||
$filter = $injector.get('$filter'), | ||
errors = { | ||
400: { | ||
title: '400 - Bad Request', | ||
url: 'bad-request' | ||
}, | ||
403: { | ||
title: '403 - Access Forbidden', | ||
url: 'forbidden' | ||
}, | ||
404: { | ||
title: '404 - Not Found', | ||
url: 'not-found' | ||
}, | ||
412: { | ||
title: '412 - Precondition failed', | ||
url: 'precondition-failed' | ||
}, | ||
500: { | ||
title: '500 - Internal Server Error', | ||
url: 'internal-server-error' | ||
}, | ||
502: { | ||
title: '502 - Proxy Error', | ||
url: 'proxy-server-error' | ||
}, | ||
0: { | ||
title: 'CORS Error - API Not Accepting Request', | ||
url: 'cors-error' | ||
} | ||
}; | ||
|
||
if (response.status in errors && !response.config.skipInterceptor) { | ||
|
||
var params = { | ||
errorType: errors[response.status].url, | ||
title: errors[response.status].title, | ||
details: $filter('json')(response), | ||
url: response.config.url, | ||
method: response.config.method | ||
}; | ||
|
||
if (response.data && response.data.message){ | ||
params.message = response.data.message; | ||
} | ||
|
||
$state.transitionTo('app.public.error', params); | ||
} | ||
|
||
return $q.reject(response); | ||
} | ||
}; | ||
}) | ||
|
||
.controller('app.public.error.controller', function($rootScope, $scope, titleService, $stateParams, $state, $window, $filter) { | ||
|
||
titleService.setTitle($stateParams.title); | ||
|
||
$scope.title = $stateParams.title; | ||
$scope.message = $stateParams.message; | ||
$scope.url = $stateParams.url; | ||
$scope.method = $stateParams.method; | ||
|
||
if (!!$scope.details){ | ||
$scope.details = _.isString($stateParams.details) ? $stateParams.details : $filter('json')($stateParams.details); | ||
} | ||
|
||
$scope.goBack = function() { | ||
$window.history.back(); | ||
}; | ||
|
||
$scope.reload = function() { | ||
$window.location.reload(); | ||
}; | ||
|
||
}) | ||
|
||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#sf-error { | ||
a { | ||
word-break: break-all; | ||
} | ||
} |
Oops, something went wrong.