Uplemented more logic

This commit is contained in:
Caesar2011
2019-01-11 02:19:55 +01:00
parent 096f2f1c4b
commit 62985d2e2a
13 changed files with 339 additions and 704 deletions

View File

@@ -1,5 +1,29 @@
extends layout
mixin rangemaker(id)
.mdl-grid(style="width:100px;text-align:center;padding:0;margin:0", id=id)
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.minus-arrow.mdl-list__item-secondary-action(href='#')
i.material-icons remove
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
.mdl-progress.mdl-js-progress(style="text-align:center")
span.mdl-list__item-secondary-info
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.plus-arrow.mdl-list__item-secondary-action(href='#')
i.material-icons add
script.
let m = null;
let rangediv = document.getElementById('#{id}');
rangediv.getElementsByClassName('mdl-progress')[0].addEventListener('mdl-componentupgraded', function () {
m = this.MaterialProgress;
this.MaterialProgress.setProgress(100 * 3 / 7);
});
rangediv.getElementsByClassName('mdl-list__item-secondary-info')[0].innerHTML = "3/7";
rangediv.getElementsByClassName('minus-arrow')[0].addEventListener('click', function () {
m.setProgress(100);
});
block content
style.
.demo-card-square.mdl-card {
@@ -29,28 +53,19 @@ block content
h3 Freiwillige Informationen
| Du kannst anonym Dein Alter und Geschlecht angeben, um die Cocktails weiter verbessern zu können.
.form
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label.getmdl-select
input#sex-input.mdl-textfield__input(type='text', value='', readonly='')
input(type='hidden', value='', name='sex-input')
label.mdl-textfield__label(for='sex-input') Geschlecht
i.mdl-icon-toggle__label.material-icons keyboard_arrow_down
ul.mdl-menu.mdl-menu--bottom-left.mdl-js-menu(for='sex-input')
li.mdl-menu__item(data-val='na') Nicht angegeben
li.mdl-menu__item(data-val='m') Männlich
li.mdl-menu__item(data-val='w') Weiblich
li.mdl-menu__item(data-val='o') Divers
br
.mdl-selectfield.mdl-js-selectfield.mdl-selectfield--floating-label
select#sex-input.mdl-selectfield__select(onchange="sendSex(this)")
each val, index in {'na':'Nicht angegeben','m':'Männlich','w':'Weiblich', 'o': 'Divers'}
if (user.sex === index)
option(value=index, selected="selected")= val
else
option(value=index)= val
label.mdl-selectfield__label(for='sex-input') Geschlecht
span.mdl-selectfield__error Select a value
br
.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label
input.mdl-textfield__input(type="number", id="age_input")
input.mdl-textfield__input(type="number", id="age_input", onchange="sendAge(this)", value=(user.age !== -1 ? user.age : ""))
label.mdl-textfield__label(for="age_input") Alter
br
br
br
br
br
br
br
//.mdl-card__actions.mdl-card--border
// a.mdl-button.mdl-button--colored.mdl-js-button.mdl-js-ripple-effect
// | View Updates
@@ -68,12 +83,12 @@ block content
span Bryan Cranston
span.mdl-list__item-sub-title 62 Episodes, 62 Episodes, 62 Episodes, 62 Episodes, 62 Episodes, 62 Episodes, 62 Episodes
span.mdl-list__item-secondary-content
.mdl-grid(style="text-align:center;padding:0;margin:0")
.mdl-grid(style="width:100px;text-align:center;padding:0;margin:0")
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.mdl-list__item-secondary-action(href='#')
i.material-icons remove
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
#p1.mdl-progress.mdl-js-progress(style="width:100px;text-align:center")
#p1.mdl-progress.mdl-js-progress(style="text-align:center")
span.mdl-list__item-secondary-info 6/7
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.mdl-list__item-secondary-action(href='#')
@@ -129,28 +144,12 @@ block content
.mdl-selectfield.mdl-js-selectfield.mdl-selectfield--floating-label
select#gender.mdl-selectfield__select
option(value='')
option(value='1') Cocktail 1
option(value='2') Cocktail 2
option(value='3') Cocktail 3
option(value='4') Cocktail 4
option(value='5') Cocktail 5
each val in cocktails
option(value=val[3])= val[2] + " - " + val[3]
label.mdl-selectfield__label(for='gender') New cocktail
span.mdl-selectfield__error Select a value
.mdl-cell--3-col
.mdl-grid(style="width:100px;text-align:center;padding:0;margin:0")
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.mdl-list__item-secondary-action(href='#')
i.material-icons remove
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
#pnew.mdl-progress.mdl-js-progress(style="text-align:center")
span.mdl-list__item-secondary-info 5/7
.mdl-cell(style="width:33.33333333%;margin-right:0px;margin-left:0px")
a.mdl-list__item-secondary-action(href='#')
i.material-icons add
script.
document.querySelector('#pnew').addEventListener('mdl-componentupgraded', function () {
this.MaterialProgress.setProgress(100 * 5 / 7);
});
+rangemaker("pnew")
.mdl-cell--3-col
button.mdl-button.mdl-js-button.mdl-button--fab.mdl-js-ripple-effect
i.material-icons add