From 252cd4901b347ffb7aed3e450921e06a617ca368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 18 Feb 2016 16:05:15 +0100 Subject: [PATCH] ux(): added style guide page --- public/app/core/routes/routes.ts | 5 +++++ public/app/features/all.js | 1 + .../app/features/styleguide/styleguide.html | 22 +++++++++++++++++++ public/app/features/styleguide/styleguide.ts | 14 ++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 public/app/features/styleguide/styleguide.html create mode 100644 public/app/features/styleguide/styleguide.ts diff --git a/public/app/core/routes/routes.ts b/public/app/core/routes/routes.ts index 59aaac8bf0a..71e21f19ae0 100644 --- a/public/app/core/routes/routes.ts +++ b/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' diff --git a/public/app/features/all.js b/public/app/features/all.js index dcaf33c8331..c110bcff7cd 100644 --- a/public/app/features/all.js +++ b/public/app/features/all.js @@ -10,4 +10,5 @@ define([ './profile/profileCtrl', './profile/changePasswordCtrl', './profile/selectOrgCtrl', + './styleguide/styleguide', ], function () {}); diff --git a/public/app/features/styleguide/styleguide.html b/public/app/features/styleguide/styleguide.html new file mode 100644 index 00000000000..056ee08e6d6 --- /dev/null +++ b/public/app/features/styleguide/styleguide.html @@ -0,0 +1,22 @@ + + + +
+ + + +

Colors

+ + + +
diff --git a/public/app/features/styleguide/styleguide.ts b/public/app/features/styleguide/styleguide.ts new file mode 100644 index 00000000000..92d3bdb6f7f --- /dev/null +++ b/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);