Bläddra i källkod

ux(): added style guide page

Torkel Ödegaard 9 år sedan
förälder
incheckning
252cd4901b

+ 5 - 0
public/app/core/routes/routes.ts

@@ -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'

+ 1 - 0
public/app/features/all.js

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

+ 22 - 0
public/app/features/styleguide/styleguide.html

@@ -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>

+ 14 - 0
public/app/features/styleguide/styleguide.ts

@@ -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);