X-Git-Url: https://git.auder.net/images/pieces/Cwda/bd.svg?a=blobdiff_plain;f=client%2Fsrc%2Fcomponents%2FUpsertUser.vue;h=eb8adffc2da8e21b2f086b284f8b2f451f35d96a;hb=866842c3c310524c034922870234120ed2a16cbf;hp=5ea93a05531f80bfb1cd493768f5bdd16a7a25b9;hpb=c66a829b3770122fe0ff2fb9db8def9635bbc334;p=vchess.git
diff --git a/client/src/components/UpsertUser.vue b/client/src/components/UpsertUser.vue
index 5ea93a05..eb8adffc 100644
--- a/client/src/components/UpsertUser.vue
+++ b/client/src/components/UpsertUser.vue
@@ -1,153 +1,190 @@
-// Logic to login, or create / update a user (and also logout)
div
- input#modalUser.modal(type="checkbox" @change="trySetEnterTime")
- div(role="dialog")
+ input#modalUser.modal(
+ type="checkbox"
+ @change="trySetEnterTime($event)"
+ )
+ div(
+ role="dialog"
+ data-checkbox="modalUser"
+ )
.card
label.modal-close(for="modalUser")
- h3 {{ stage }}
- form#userForm(@submit.prevent="onSubmit()")
+ h3.section {{ st.tr[stage] }}
+ form(@submit.prevent="onSubmit()" @keyup.enter="onSubmit()")
div(v-show="stage!='Login'")
fieldset
- label(for="username") Name
- input#username(type="text" v-model="user.name")
+ label(for="username") {{ st.tr["User name"] }}
+ input#username(
+ type="text"
+ v-model="st.user.name"
+ )
fieldset
-
-
+ label(for="useremail") {{ st.tr["Email"] }}
+ input#useremail(
+ type="email"
+ v-model="st.user.email"
+ )
fieldset
-
-
+ label(for="notifyNew") {{ st.tr["Notifications by email"] }}
+ input#notifyNew(
+ type="checkbox"
+ v-model="st.user.notify"
+ )
div(v-show="stage=='Login'")
fieldset
-
-
+ label(for="nameOrEmail") {{ st.tr["Name or Email"] }}
+ input#nameOrEmail(
+ type="text"
+ v-model="nameOrEmail"
+ )
.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 }}
+ button(@click="onSubmit()")
+ span {{ st.tr[submitMessage] }}
+ button(
+ v-if="stage!='Update'"
+ type="button"
+ @click="toggleStage()"
+ )
+ span {{ st.tr[stage=="Login" ? "Register" : "Login"] }}
+ button(
+ v-else type="button"
+ @click="doLogout()"
+ )
+ span {{ st.tr["Logout"] }}
+ #dialog.text-center {{ st.tr[infoMsg] }}
+
+