Archived
1
0
Fork 0

Departments management rework

This commit is contained in:
Ethanell 2020-09-29 14:44:59 +02:00
parent 1c0b810022
commit 3c5cb22975
4 changed files with 35 additions and 27 deletions

View file

@ -1,4 +1,4 @@
document.querySelectorAll("a.remove") document.querySelectorAll(".delete")
.forEach(e => e.addEventListener("click", ev => { .forEach(e => e.addEventListener("click", ev => {
if (!confirm("Do you really want to remove this department ?")) if (!confirm("Do you really want to remove this department ?"))
ev.preventDefault(); ev.preventDefault();

View file

@ -1,11 +1,14 @@
extends ../../layout extends ../../layout
block content block content
div.card#departmentsManagement div.container
h1=__("admin.new")+" "+__("department") h1=__("admin.new")+" "+__("department")
form(action="/admin/departments/add" method="POST") div.row
div.field form(action="/admin/departments/add" method="POST")
label(for="name")=__("admin.name")+":" div.row
input#name(type="text" name="name" required) div.input-field.col.s12
div.field label(for="name")=__("admin.name")+":"
input(type="submit" value=__("admin.add")) input#name(type="text" name="name" required)
div.row.center
div.input-field.col.s12
+submit(__("admin.add"))

View file

@ -1,12 +1,15 @@
extends ../../layout extends ../../layout
block content block content
div.card#departmentsManagement div.container
h1=__("admin.edit")+" "+department.name h1=__("admin.edit")+" "+department.name
form(action="/admin/departments/edit" method="POST") div.row
input.hide(type="text" name="name" value=department.name required) form(action="/admin/departments/edit" method="POST")
div.field input.hide(type="text" name="name" value=department.name required)
label(for="name")=__("admin.name")+":" div.row
input#name(type="text" name="newName" value=department.name required) div.input-field.col.s12
div.field label(for="name")=__("admin.name")+":"
input(type="submit" value=__("save")) input#name(type="text" name="newName" value=department.name required)
div.row.center
div.input-field.col.s12
+submit(__("save"))

View file

@ -1,18 +1,20 @@
extends ../../layout extends ../../layout
block content block content
div.card#departmentsManagement div.container
h1=__("admin.departmentsManagement") h1=__("admin.departmentsManagement")
a.add(href="/admin/departments/add") ul.collection
button=__("admin.add")
div
each department in departments each department in departments
div.department li.collection-item
h2=department.name div=department.name
div.buttons div.secondary-content
a.edit(href="/admin/departments/edit?name="+department.name) a(href="/admin/departments/edit?name="+department.name)
button=__("admin.edit") i.material-icons edit
a.remove(href="/admin/departments/delete?name="+department.name) a.delete(href="/admin/departments/delete?name="+department.name)
button=__("admin.remove") i.material-icons remove
div.fixed-action-btn
a.btn-floating.btn-large.blue(href="/admin/departments/add")
i.large.material-icons add
script(src="/javascripts/admin/departments.js") script(src="/javascripts/admin/departments.js")