diff --git a/components/forms.pug b/components/forms.pug index 0768775..adf0f29 100644 --- a/components/forms.pug +++ b/components/forms.pug @@ -1,7 +1,7 @@ include icons //- Input control with form-group wrapper mixin input(type,id,placeholder,label,name) - .form-group + fieldset.form-group label(for=id) #{label} input.form-control(type=type,id=id,placeholder=placeholder,name=name) @@ -12,7 +12,7 @@ mixin input-simple(type,id,placeholder) //- Input control with form-group wrapper mixin textarea(id,placeholder,label,name,rows) - rows = rows || 3 //- Default of 3 rows - .form-group + fieldset.form-group label(for=id) #{label} textarea.form-control(id=id,placeholder=placeholder,name=name,rows=rows) @@ -49,12 +49,12 @@ mixin radio-inline(text,name,id) //- Submit button mixin submit(text,name,id) - .form-group + fieldset.form-group button.btn.btn-default(type="submit",name=name,id=id)= text //- Input group - both prepend and append options available, and block is passed mixin input-group(prepend,append) - .form-group + fieldset.form-group .input-group unless !prepend .input-group-addon diff --git a/layouts/jumbotron.pug b/layouts/jumbotron.pug index c250429..328d3f8 100644 --- a/layouts/jumbotron.pug +++ b/layouts/jumbotron.pug @@ -14,9 +14,9 @@ block body a.navbar-brand(href='#') Project name #navbar.navbar-collapse.collapse form.navbar-form.navbar-right - .form-group + fieldset.form-group input.form-control(type='text', placeholder='Email') - .form-group + fieldset.form-group input.form-control(type='password', placeholder='Password') button.btn.btn-success(type='submit') Sign in diff --git a/layouts/non-responsive.pug b/layouts/non-responsive.pug index e7ae729..b22c4e7 100644 --- a/layouts/non-responsive.pug +++ b/layouts/non-responsive.pug @@ -36,7 +36,7 @@ block body li a(href='#') One more separated link form.navbar-form.navbar-left(role='search') - .form-group + fieldset.form-group input.form-control(type='text', placeholder='Search') button.btn.btn-default(type='submit') Submit ul.nav.navbar-nav.navbar-right diff --git a/test/forms.js b/test/forms.js index 371ebd6..d1b52c5 100644 --- a/test/forms.js +++ b/test/forms.js @@ -5,7 +5,7 @@ var path = require("path"); describe("Forms", function() { it("should generate input control", function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms","input.pug")); - assert.equal('
',fn({ type:"text",id: "txtInput",placeholder:"Placeholder",label:"Label",name:"txtInput"})); + assert.equal('
',fn({ type:"text",id: "txtInput",placeholder:"Placeholder",label:"Label",name:"txtInput"})); }); it("should generate simple input control", function() { @@ -15,7 +15,7 @@ describe("Forms", function() { it("should generate text area control", function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms","textarea.pug")); - assert.equal('
',fn({ id: "txtInput",placeholder:"Placeholder",label:"Label",name:"txtInput"})); + assert.equal('
',fn({ id: "txtInput",placeholder:"Placeholder",label:"Label",name:"txtInput"})); }); it("should generate simple text area control", function() { @@ -46,12 +46,12 @@ describe("Forms", function() { it("should generate a submit button",function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms", "submit.pug")); - assert.equal('
',fn({ text: "Submit", name:"btnSubmit", id:"btnSubmit"})); + assert.equal('
',fn({ text: "Submit", name:"btnSubmit", id:"btnSubmit"})); }); it("should generate a input group", function() { var fn = pug.compileFile(path.join(__dirname, "fixtures/forms", "input-group.pug")); - assert.equal('
Prepend
Append
',fn({prepend: "Prepend", append: "Append"})); + assert.equal('
Prepend
Append
',fn({prepend: "Prepend", append: "Append"})); }); it("should generate a icon button", function() {