// Logic to login, or create / update a user (and also logout)
div
input#modalUser.modal(type="checkbox" @change="trySetEnterTime")
div(role="dialog")
.card
label.modal-close(for="modalUser")
h3 {{ stage }}
form#userForm(@submit.prevent="onSubmit()")
div(v-show="stage!='Login'")
fieldset
label(for="username") Name
input#username(type="text" v-model="user.name")
fieldset
fieldset
div(v-show="stage=='Login'")
fieldset
.button-group
button#submit(@click="onSubmit()")
span {{ submitMessage }}
i.material-icons send
button(v-if="stage!='Update'" @click="toggleStage()")
span {{ stage=="Login" ? "Register" : "Login" }}
button(v-if="stage=='Update'" onClick="location.replace('/logout')")
span Logout
#dialog(:style="{display: displayInfo}") {{ infoMsg }}