Archived
1
0
Fork 0

Profile rework

This commit is contained in:
Ethanell 2020-09-27 21:38:04 +02:00
parent 0fa915dc91
commit 80187cf71f
2 changed files with 47 additions and 40 deletions

View file

@ -10,7 +10,7 @@ block content
select(name="department" required) select(name="department" required)
option(value="" disabled selected hidden)=__("chooseDepartment") option(value="" disabled selected hidden)=__("chooseDepartment")
each department in departments each department in departments
option(value=department.name)=department.name option(value=department.name selected=user && user.DepartmentName===department.name)=department.name
label=__("department")+":" label=__("department")+":"
div.row div.row

View file

@ -1,44 +1,51 @@
extends layout extends layout
block content block content
div.card div.container
h1=__("profile.title") div.row
h4=__("profile.title")
form(action="/profile" method="POST") form(action="/profile" method="POST")
h2=__("profile.infos") h2=__("profile.infos")
div.field div.row
label(for="username")=__("username")+":" div.input-field.col.s6
input#username(type="text" name="username" value=user.username disabled required) input#username(type="text" name="username" value=user.username disabled required)
div.field label(for="username")=__("username")+":"
label(for="email")=__("email")+":" div.input-field.col.s6
input#email(type="email" name="email" value=user.email required) input#email(type="email" name="email" value=user.email required)
div.field label(for="email")=__("email")+":"
label(for="firstName")=__("firstName")+":" div.row
div.input-field.col.s6
input#firstName(type="text" name="firstName" value=user.firstName required) input#firstName(type="text" name="firstName" value=user.firstName required)
div.field label(for="firstName")=__("firstName")+":"
label(for="lastName")=__("lastName")+":" div.input-field.col.s6
input#lastName(type="text" name="lastName" value=user.lastName required) input#lastName(type="text" name="lastName" value=user.lastName required)
div.field label(for="lastName")=__("lastName")+":"
label(for="department")=__("department")+":" div.row
+list("department", "department-list", "department", user.DepartmentName, "off", true) div.input-field.col.s12
div.field select(name="department" required)
each department in departments
option(value=department.name selected=department.name===user.DepartmentName)=department.name
label=__("department")+":"
div.row
div.input-field.col.s12
label(for="password")=__("password")+":" label(for="password")=__("password")+":"
input#password(type="password" name="password") input#password(type="password" name="password")
div.field div.row.center
input(type="submit" value=__("save")) div.input-field.col.s12
+submit(__("save"))
datalist#department-list
each department in departments
option(value=department.name)
if (!user.emailVerified) if (!user.emailVerified)
div.field div.row.center
a(href="/profile/resend") div.input-field.col.s12
input(type="button" value=__("profile.emailCheck")) a.btn.waves-effect.waves-light.yellow.darken-4(href="/profile/resend")=__("profile.emailCheck")
div.card#userOrderList div.container.valign-wrapper
h1=__("orders") div.row.center
h4=__("orders")
each order in orders each order in orders
div div.col
h2=order.id div.card.blue-grey
div.card-content.white-text
span.card-title=order.id
each sandwich in order.Sandwiches each sandwich in order.Sandwiches
p #{sandwich.name} - #{sandwich.SandwichOrder.date} p #{sandwich.name} - #{sandwich.SandwichOrder.date}