extends layout

mixin rangemaker(id, start)
  .mdl-grid(style="width:100px;text-align:center;padding:0;margin:0", id=id, data-value=(start || "4"), data-dosend=(start !== undefined))
    .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.
    addProgressBarFunctionality('#{id}')


block content
  //script(src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@0.13.3/dist/tf.min.js", defer)
  //script(src="/js/neuralnet.js", defer)
  .mdl-grid
    .mdl-cell--3-offset-desktop
    .mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
      .demo-card-square.mdl-card.mdl-shadow--2dp
        .mdl-card__title.mdl-card--expand
          h2.mdl-card__title-text Über diese Seite
        .mdl-card__supporting-text
          | Auf dieser Website kannst Du Deine Lieblingscocktails speichern und beim nächsten Mal wieder bestellen!
          h4 Freiwillige Informationen
          | Du kannst anonym Dein Alter und Geschlecht angeben, um die Cocktails weiter verbessern zu können.
          .form
            .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", pattern="[0-9]{0,2}", onchange="sendAge(this)", value=(user.age !== -1 ? user.age : ""))
              label.mdl-textfield__label(for="age_input") Alter
        //.mdl-card__actions.mdl-card--border
        //  a.mdl-button.mdl-button--colored.mdl-js-button.mdl-js-ripple-effect
        //    | View Updates
  .mdl-grid
    .mdl-cell--3-offset-desktop
    .mdl-cell.mdl-cell--6-col.mdl-cell--12-col-tablet
      .demo-card-square.mdl-card.mdl-shadow--2dp
        .mdl-card__title.mdl-card--expand
          h2.mdl-card__title-text Lieblingscocktails
        .mdl-card__supporting-text
          #cocktaillist.ul.demo-list-two.mdl-list
            each cocktail in user.cocktails
              - index = cocktailList.indexOf(cocktail.cocktail)
              - cdetails = cocktails[index]
              li.mdl-list__item.mdl-list__item--two-line
                span.mdl-list__item-primary-content
                  i.material-icons.mdl-list__item-avatar local_bar
                  span= cocktail.cocktail
                  span.mdl-list__item-sub-title= cdetails[7].replace(/;/g, ', ')
                span.mdl-list__item-secondary-content
                  +rangemaker(cocktail.cocktail, cocktail.level)
          br
          br
          br
          #newcocktail.form
            .mdl-grid
              .mdl-cell--6-col
                .mdl-selectfield.mdl-js-selectfield.mdl-selectfield--floating-label
                  select#cocktails.mdl-selectfield__select
                    option(value='')
                    each val in cocktails
                      option(value=val[3])= val[2] + " - " + val[3]
                  label.mdl-selectfield__label(for='cocktails') New cocktail
                  span.mdl-selectfield__error Select a value
              .mdl-cell--3-col
                +rangemaker("pnew")
              .mdl-cell--3-col
                button.mdl-button.mdl-js-button.mdl-button--fab.mdl-js-ripple-effect(onclick="sendNewCocktail()")
                  i.material-icons add
        //.mdl-card__actions.mdl-card--border
        //  a.mdl-button.mdl-button--colored.mdl-js-button.mdl-js-ripple-effect
        //    | View Updates