-
Notifications
You must be signed in to change notification settings - Fork 57
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 #12 from mike-goodwin/techjeffharris-master
Techjeffharris master
- Loading branch information
Showing
32 changed files
with
303 additions
and
39 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,37 +1,38 @@ | ||
//- panel | ||
mixin panel(type,title) | ||
.panel(class="panel-#{type}") | ||
.panel-heading | ||
h3.panel-title= title | ||
.panel-body | ||
block | ||
.panel(class="panel-" + type) | ||
if undefined !== title | ||
.panel-heading | ||
h3.panel-title= title | ||
.panel-body | ||
block | ||
|
||
//- panel-default | ||
mixin panel-default(title) | ||
+panel("default",title) | ||
block | ||
+panel("default",title) | ||
block | ||
|
||
//- panel-primary | ||
mixin panel-primary(title) | ||
+panel("primary",title) | ||
block | ||
+panel("primary",title) | ||
block | ||
|
||
//- panel-success | ||
mixin panel-success(title) | ||
+panel("success",title) | ||
block | ||
+panel("success",title) | ||
block | ||
|
||
//- panel-info | ||
mixin panel-info(title) | ||
+panel("info",title) | ||
block | ||
+panel("info",title) | ||
block | ||
|
||
//- panel-warning | ||
mixin panel-warning(title) | ||
+panel("warning",title) | ||
block | ||
+panel("warning",title) | ||
block | ||
|
||
//- panel-danger | ||
mixin panel-danger(title) | ||
+panel("danger",title) | ||
block | ||
+panel("danger",title) | ||
block |
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
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,3 @@ | ||
include ../../../components/icons | ||
include ../../../components/carousel | ||
+carousel(id,items) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-danger(title) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-default(title) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-info(title) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-primary(title) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-success(title) |
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,2 @@ | ||
include ../../../components/panels.pug | ||
+panel-warning(title) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-danger(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-default(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-info(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-primary(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-success(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+checkbox-toggle-warning(items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-danger(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-default(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-info(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-primary(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-success(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+radio-toggle-warning(name,items,active) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-danger(caption) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-default(caption) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-info(caption) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-primary(caption) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-success(caption) |
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,2 @@ | ||
include ../../../components/toggle.pug | ||
+toggle-warning(caption) |
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,82 @@ | ||
var assert = require('assert'); | ||
var pug = require('pug'); | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
|
||
// Write fixture data | ||
var mixins = ["panel-default", "panel-primary", "panel-success", "panel-info", "panel-warning", "panel-danger"]; | ||
mixins.forEach(function (m) { | ||
var fileTemplate = `include ../../../components/panels.pug | ||
+${m}(title)`; | ||
var fileName = `${m}.pug`; | ||
fs.writeFileSync(path.join(__dirname, "fixtures/panels", fileName), fileTemplate); | ||
}); | ||
|
||
var testData = [ | ||
{ | ||
suite: 'panel-default mixin', | ||
spec: 'should render a default panel', | ||
fixture: 'panel-default.pug', | ||
locals: { title: "Default Panel" }, | ||
actual: '<div class="panel panel-default">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
}, | ||
{ | ||
suite: 'panel-danger mixin', | ||
spec: 'should render a danger panel', | ||
fixture: 'panel-danger.pug', | ||
locals: { title: "Danger Panel" }, | ||
actual: '<div class="panel panel-danger">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
}, | ||
{ | ||
suite: 'panel-info mixin', | ||
spec: 'should render a info panel', | ||
fixture: 'panel-info.pug', | ||
locals: { title: "Info Panel" }, | ||
actual: '<div class="panel panel-info">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
}, | ||
{ | ||
suite: 'panel-primary mixin', | ||
spec: 'should render a primary panel', | ||
fixture: 'panel-primary.pug', | ||
locals: { title: "Primary Panel" }, | ||
actual: '<div class="panel panel-primary">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
}, | ||
{ | ||
suite: 'panel-success mixin', | ||
spec: 'should render a danger panel', | ||
fixture: 'panel-success.pug', | ||
locals: { title: "Success Panel" }, | ||
actual: '<div class="panel panel-success">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
}, | ||
{ | ||
suite: 'panel-warning mixin', | ||
spec: 'should render a warning panel', | ||
fixture: 'panel-warning.pug', | ||
locals: { title: "Warning Panel" }, | ||
actual: '<div class="panel panel-warning">[HEADING]<div class="panel-body"></div></div>', | ||
heading: '<div class="panel-heading"><h3 class="panel-title">[TITLE]</h3></div>' | ||
} | ||
]; | ||
|
||
describe('Panels', function () { | ||
testData.forEach(function (item) { | ||
describe(item.suite, function () { | ||
it(item.spec + ' (with supplied title)', function () { | ||
var fn = pug.compileFile(path.join(__dirname, "fixtures/panels", item.fixture)); | ||
var heading = item.heading.replace('[TITLE]', item.locals.title); | ||
var actual = item.actual.replace('[HEADING]', heading); | ||
assert.equal(actual, fn(item.locals)); | ||
}); | ||
it(item.spec + ' (with default title)', function () { | ||
var fn = pug.compileFile(path.join(__dirname, "fixtures/panels", item.fixture)); | ||
var actual = item.actual.replace('[HEADING]', ''); | ||
assert.equal(actual, fn()); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.