Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
57e6e009
Commit
57e6e009
authored
Feb 20, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(): more work on style guide
parent
a685e46f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
14 deletions
+34
-14
public/app/core/routes/routes.ts
+1
-1
public/app/features/styleguide/styleguide.html
+14
-9
public/app/features/styleguide/styleguide.ts
+18
-3
public/sass/components/_gf-form.scss
+1
-1
No files found.
public/app/core/routes/routes.ts
View file @
57e6e009
...
...
@@ -186,7 +186,7 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
.
when
(
'/global-alerts'
,
{
templateUrl
:
'public/app/features/dashboard/partials/globalAlerts.html'
,
})
.
when
(
'/styleguide'
,
{
.
when
(
'/styleguide
/:page?
'
,
{
controller
:
'StyleGuideCtrl'
,
controllerAs
:
'ctrl'
,
templateUrl
:
'public/app/features/styleguide/styleguide.html'
,
...
...
public/app/features/styleguide/styleguide.html
View file @
57e6e009
...
...
@@ -15,29 +15,34 @@
</a>
</div>
<tabset>
<tab
heading=
"Colors"
>
<ul
class=
"nav nav-tabs"
>
<li
ng-repeat=
"page in ctrl.pages"
ng-class=
"{active: ctrl.page[page]}"
class=
"tab"
>
<a
href=
"styleguide/{{page}}"
>
{{page}}
</a>
</li>
</ul>
<div
class=
"tab-pane"
ng-if=
"ctrl.page.colors"
>
<ul>
<li
class=
"style-guide-color-card"
ng-repeat=
"color in ctrl.colors"
style=
"background-color: {{color.value}}"
>
<strong>
${{color.name}}
</strong>
<em>
{{color.value}}
</em>
</li>
</ul>
</tab>
<tab
heading=
"Buttons"
>
</div>
<div
class=
"tab-pane"
ng-if=
"ctrl.page.buttons"
>
<div
ng-repeat=
"variant in ctrl.buttonVariants"
class=
"row"
>
<div
ng-repeat=
"btnSize in ctrl.buttonSizes"
class=
"style-guide-button-list p-a-2 col-md-4"
>
<button
ng-repeat=
"buttonName in ctrl.buttonNames"
class=
"btn btn{{variant}}{{buttonName}} {{btnSize}}"
>
btn{{variant}}{{buttonName}} {{btnSiz
e}}
btn{{variant}}{{buttonNam
e}}
</button>
</div>
</div>
</div>
</tab>
<tab
heading=
"Forms"
>
</tab>
</tabset>
<div
class=
"tab-pane"
ng-if=
"ctrl.page.forms"
>
forms
</div>
</div>
public/app/features/styleguide/styleguide.ts
View file @
57e6e009
...
...
@@ -9,12 +9,27 @@ class StyleGuideCtrl {
buttonNames
=
[
'primary'
,
'secondary'
,
'inverse'
,
'success'
,
'warning'
,
'danger'
];
buttonSizes
=
[
'btn-small'
,
''
,
'btn-large'
];
buttonVariants
=
[
'-'
,
'-outline-'
];
page
:
any
;
pages
=
[
'colors'
,
'buttons'
,
'forms'
,
'dashboard'
,
'query-editors'
];
/** @ngInject **/
constructor
(
$http
)
{
constructor
(
private
$http
,
$routeParams
)
{
this
.
theme
=
config
.
bootData
.
user
.
lightTheme
?
'light'
:
'dark'
;
this
.
page
=
{};
$http
.
get
(
'public/sass/styleguide.json'
).
then
(
res
=>
{
if
(
$routeParams
.
page
)
{
this
.
page
[
$routeParams
.
page
]
=
1
;
}
else
{
this
.
page
.
colors
=
true
;
}
if
(
this
.
page
.
colors
)
{
this
.
loadColors
();
}
}
loadColors
()
{
this
.
$http
.
get
(
'public/sass/styleguide.json'
).
then
(
res
=>
{
this
.
colors
=
_
.
map
(
res
.
data
[
this
.
theme
],
(
value
,
key
)
=>
{
return
{
name
:
key
,
value
:
value
};
});
...
...
@@ -23,7 +38,7 @@ class StyleGuideCtrl {
switchTheme
()
{
var
other
=
this
.
theme
===
'dark'
?
'light'
:
'dark'
;
window
.
location
.
href
=
config
.
appSubUrl
+
'/styleguide
?theme='
+
other
;
window
.
location
.
href
=
window
.
location
.
href
+
'
?theme='
+
other
;
}
}
...
...
public/sass/components/_gf-form.scss
View file @
57e6e009
$gf-form-margin
:
0
.
4
rem
;
$gf-form-margin
:
0
.
2
rem
;
.gf-form
{
margin-bottom
:
$gf-form-margin
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment