ux(): added style guide page

This commit is contained in:
Torkel Ödegaard
2016-02-18 16:05:15 +01:00
parent a2b69e96b9
commit 252cd4901b
4 changed files with 42 additions and 0 deletions

View File

@@ -186,6 +186,11 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
.when('/global-alerts', {
templateUrl: 'public/app/features/dashboard/partials/globalAlerts.html',
})
.when('/styleguide', {
controller: 'StyleGuideCtrl',
controllerAs: 'ctrl',
templateUrl: 'public/app/features/styleguide/styleguide.html',
})
.otherwise({
templateUrl: 'public/app/partials/error.html',
controller: 'ErrorCtrl'

View File

@@ -10,4 +10,5 @@ define([
'./profile/profileCtrl',
'./profile/changePasswordCtrl',
'./profile/selectOrgCtrl',
'./styleguide/styleguide',
], function () {});

View File

@@ -0,0 +1,22 @@
<navbar icon="fa fa-fw fa-adjust" title="Style Guide">
</navbar>
<div class="page-container">
<div class="page-header">
<h1>Style Guide</h1>
<a class="btn btn-success" ng-click="ctrl.switchTheme()">
<i class="fa fa-random"></i>
Switch theme
</a>
</div>
<h3 class="page-heading">Colors</h3>
<ul>
<li class="style-guide-color-card">
</li>
</ul>
</div>

View File

@@ -0,0 +1,14 @@
import coreModule from 'app/core/core_module';
import config from 'app/core/config';
class StyleGuideCtrl {
switchTheme() {
var other = config.bootData.user.lightTheme ? 'dark' : 'light';
window.location.href = config.appSubUrl + '/styleguide?theme=' + other;
}
}
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);