some fixes (forgot to commit)

This commit is contained in:
Simon Bruder 2018-05-13 21:47:44 +00:00
parent c7a1762e83
commit e47659b0a9
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
4 changed files with 42 additions and 8 deletions

12
package-lock.json generated
View file

@ -3564,6 +3564,12 @@
"integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=",
"dev": true "dev": true
}, },
"lodash": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz",
"integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=",
"dev": true
},
"minimatch": { "minimatch": {
"version": "0.2.14", "version": "0.2.14",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz",
@ -5362,12 +5368,6 @@
} }
} }
}, },
"lodash": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz",
"integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=",
"dev": true
},
"lodash._basecopy": { "lodash._basecopy": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz",

View file

@ -52,7 +52,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col col-12 col-md-4"> <div class="col col-12 col-md-4">
<input type="number" min="10000" max="99999" name="zip" placeholder="Postleitzahl" required> <input type="text" maxlength="5" name="zip" placeholder="Postleitzahl" required>
</div> </div>
<div class="col col-12 col-md-8"> <div class="col col-12 col-md-8">
<input type="text" name="place" placeholder="Ort" required> <input type="text" name="place" placeholder="Ort" required>
@ -98,7 +98,7 @@ FabLab Bad Windsheim
Spitalwall 16 Spitalwall 16
91435 Bad Windsheim</pre> 91435 Bad Windsheim</pre>
<div class="download-wrapper"> <div class="download-wrapper">
<button type="button" id="generate" class="btn btn-success">Mitgliedsantrag herunterladen</button> <button disabled type="button" id="generate" class="btn btn-danger">Mitgliedsantrag herunterladen</button>
</div> </div>
</div> </div>

View file

@ -1,14 +1,35 @@
'use strict' 'use strict'
const numSteps = 1 const numSteps = 1
_.forEach(_.range(numSteps), function (value) { _.forEach(_.range(numSteps), function (value) {
$('#step-' + (value + 1) + ' form').submit(function (event) { $('#step-' + (value + 1) + ' form').submit(function (event) {
$('#step-' + (value + 2)).collapse('show') $('#step-' + (value + 2)).collapse('show')
$('#step-' + (value + 1) + '-heading .step-number').addClass('done') $('#step-' + (value + 1) + '-heading .step-number').addClass('done')
if (isDone) {
$('.download-wrapper button').prop('disabled', false)
$('.download-wrapper button').remove('btn-danger')
$('.download-wrapper button').addClass('btn-success')
} else {
$('.download-wrapper button').prop('disabled', true)
$('.download-wrapper button').remove('btn-success')
$('.download-wrapper button').addClass('btn-danger')
}
event.preventDefault() event.preventDefault()
}) })
}) })
function isDone () {
var done = true
_.forEach(_.range(numSteps), (value) => {
console.log(value)
if (!$('#step-' + (value + 1) + '-heading .step-number').hasClass('done')) {
done = false
}
})
return done
}
$('#generate').click(function () { $('#generate').click(function () {
var model = {} var model = {}
_.forEach(_.range(numSteps), function (value) { _.forEach(_.range(numSteps), function (value) {

View file

@ -1,6 +1,7 @@
@color-1: #047e7c; @color-1: #047e7c;
@color-2: #0c6d74; @color-2: #0c6d74;
@color-3: #145c6c; @color-3: #145c6c;
@color-final: @color-2;
@color-white: #f1f2e3; @color-white: #f1f2e3;
@color-grey: #787970; @color-grey: #787970;
@ -97,6 +98,12 @@ header {
&:not(.final) { // prevents animation to be shown at final step &:not(.final) { // prevents animation to be shown at final step
animation: rotate-step-number 0.5s; animation: rotate-step-number 0.5s;
} }
&.final {
background-color: @color-white;
color: @color-final;
}
background-color: #8eca63; // green background-color: #8eca63; // green
color: @color-white; color: @color-white;
@ -221,6 +228,12 @@ footer {
.download-wrapper { .download-wrapper {
text-align: center; text-align: center;
button {
&:disabled {
opacity: 1;
}
}
} }
a { a {