Style search bar

This commit is contained in:
Lars Westermann 2019-04-04 21:17:22 +02:00
parent aa91345523
commit c9ce59d04f
Signed by: lars.westermann
GPG key ID: 9D417FA5BB9D5E1D
8 changed files with 68 additions and 34 deletions

View file

@ -43,10 +43,14 @@ body, html {
a { a {
text-decoration: none; text-decoration: none;
outline: none; outline: none;
color: $primary-color;
&:hover { &:hover {
text-decoration: none; text-decoration: none;
} }
&:active {
color: $primary-color;
}
} }
.container { .container {
@ -149,10 +153,33 @@ a {
.table-layout-search { .table-layout-search {
float: left; float: left;
padding-bottom: 0.5rem !important;
.btn-search {
position: absolute;
top: 0;
height: calc(2.5rem + 2px);
line-height: 2.5rem;
right: -3rem;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
margin-top: 1px;
margin-right: 2px;
}
input:focus ~ .btn-search {
border-color: $primary-color;
border-width: 2px;
margin-top: 0;
height: calc(2.5rem + 4px);
margin-right: 1px;
}
} }
.table-layout-action { .table-layout-action {
float: right; float: right;
line-height: 2.5rem;
} }
.table-layout-table { .table-layout-table {
@ -160,7 +187,6 @@ a {
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
clear: both; clear: both;
margin-top: 4rem;
th { th {
text-align: start; text-align: start;

View file

@ -34,7 +34,7 @@ fun Route.account() {
+"You have the following rights: ${user.permissions}" +"You have the following rights: ${user.permissions}"
br {} br {}
a("/logout") { a("/logout") {
button { button(classes="form-btn") {
+"Logout" +"Logout"
} }
} }

View file

@ -72,8 +72,8 @@ fun Route.login() {
) { ) {
value = call.parameters[LocationLogin::next.name] ?: "/" value = call.parameters[LocationLogin::next.name] ?: "/"
} }
button(type = ButtonType.submit, classes = "btn btn-primary") { button(type = ButtonType.submit, classes = "form-btn btn-primary") {
+"LocationLogin" +"Login"
} }
} }

View file

@ -42,7 +42,9 @@ fun Route.person() {
action { action {
a("/person/new") { a("/person/new") {
+"Add person" button(classes="form-btn btn-primary") {
+"Add person"
}
} }
} }

View file

@ -42,7 +42,9 @@ fun Route.room() {
action { action {
a("/room/new") { a("/room/new") {
+"Add room" button(classes="form-btn btn-primary") {
+"Add room"
}
} }
} }
@ -137,10 +139,6 @@ fun Route.room() {
div("form-switch-group") { div("form-switch-group") {
div("form-group form-switch") { div("form-group form-switch") {
label {
htmlFor = "projector"
+"Projector"
}
input( input(
name = "projector", name = "projector",
classes = "form-control", classes = "form-control",
@ -149,6 +147,10 @@ fun Route.room() {
id = "projector" id = "projector"
checked = editRoom.projector checked = editRoom.projector
} }
label {
htmlFor = "projector"
+"Projector"
}
} }
} }
@ -241,10 +243,6 @@ fun Route.room() {
div("form-switch-group") { div("form-switch-group") {
div("form-group form-switch") { div("form-group form-switch") {
label {
htmlFor = "projector"
+"Projector"
}
input( input(
name = "projector", name = "projector",
classes = "form-control", classes = "form-control",
@ -253,6 +251,10 @@ fun Route.room() {
id = "projector" id = "projector"
checked = false checked = false
} }
label {
htmlFor = "projector"
+"Projector"
}
} }
} }

View file

@ -42,7 +42,9 @@ fun Route.user() {
action { action {
a("/user/new") { a("/user/new") {
+"Add user" button(classes="form-btn btn-primary") {
+"Add user"
}
} }
} }
@ -115,10 +117,6 @@ fun Route.user() {
for (permission in Permission.values()) { for (permission in Permission.values()) {
val name = permission.toString().toLowerCase() val name = permission.toString().toLowerCase()
div("form-group form-switch") { div("form-group form-switch") {
label {
htmlFor = "permission-$name"
+name.capitalize()
}
input( input(
name = "permission-$name", name = "permission-$name",
classes = "form-control", classes = "form-control",
@ -131,6 +129,10 @@ fun Route.user() {
readonly = true readonly = true
} }
} }
label {
htmlFor = "permission-$name"
+name.capitalize()
}
} }
} }
} }
@ -231,10 +233,6 @@ fun Route.user() {
for (permission in Permission.values()) { for (permission in Permission.values()) {
val name = permission.toString().toLowerCase() val name = permission.toString().toLowerCase()
div("form-group form-switch") { div("form-group form-switch") {
label {
htmlFor = "permission-$name"
+name.capitalize()
}
input( input(
name = "permission-$name", name = "permission-$name",
classes = "form-control", classes = "form-control",
@ -247,6 +245,10 @@ fun Route.user() {
readonly = true readonly = true
} }
} }
label {
htmlFor = "permission-$name"
+name.capitalize()
}
} }
} }
} }

View file

@ -42,7 +42,9 @@ fun Route.workGroup() {
action { action {
a("/workgroup/new") { a("/workgroup/new") {
+"Add work group" button(classes = "form-btn btn-primary") {
+"Add work group"
}
} }
} }
@ -94,7 +96,7 @@ fun Route.workGroup() {
} }
td(classes = "action") { td(classes = "action") {
a("/workgroup/${u.id}") { a("/workgroup/${u.id}") {
i("material-icons") { +"edit" } i("material-icons") { +"edit" }
} }
} }
} }
@ -248,12 +250,12 @@ fun Route.workGroup() {
} }
val editWorkGroup = WorkGroup.get(workGroupId.id) ?: return@post val editWorkGroup = WorkGroup.get(workGroupId.id) ?: return@post
params["name"]?.let { editWorkGroup.name = it} params["name"]?.let { editWorkGroup.name = it }
params["interested"]?.toIntOrNull()?.let { editWorkGroup.interested = it} params["interested"]?.toIntOrNull()?.let { editWorkGroup.interested = it }
params["track"]?.toIntOrNull()?.let { editWorkGroup.trackId = it} params["track"]?.toIntOrNull()?.let { editWorkGroup.trackId = it }
params["projector"]?.toBoolean()?.let { editWorkGroup.projector = it} params["projector"]?.let { editWorkGroup.projector = it == "on" }
params["resolution"]?.toBoolean()?.let { editWorkGroup.resolution = it} params["resolution"]?.let { editWorkGroup.resolution = it == "on" }
params["length"]?.toIntOrNull()?.let { editWorkGroup.length = it} params["length"]?.toIntOrNull()?.let { editWorkGroup.length = it }
editWorkGroup.save() editWorkGroup.save()

View file

@ -14,12 +14,12 @@ class TableTemplate() : Template<FlowContent> {
override fun FlowContent.apply() { override fun FlowContent.apply() {
div("table-layout") { div("table-layout") {
form(classes = "table-layout-search") { form(classes = "form-group table-layout-search") {
input(InputType.search, name = "search") { input(InputType.search, name = "search", classes = "form-control") {
placeholder = "Search" placeholder = "Search"
value = searchValue value = searchValue
} }
button(type = ButtonType.submit) { button(type = ButtonType.submit, classes = "form-btn btn-search") {
i("material-icons") { +"search" } i("material-icons") { +"search" }
} }
} }