add ready state
This commit is contained in:
@@ -1032,6 +1032,7 @@ impl TripItemList {
|
||||
{
|
||||
thead ."bg-gray-200" {
|
||||
tr ."h-10" {
|
||||
th ."border" ."p-2" {}
|
||||
th ."border" ."p-2" {}
|
||||
th ."border" ."p-2" {}
|
||||
th ."border" ."p-2" ."w-1/2" { "Name" }
|
||||
@@ -1099,6 +1100,61 @@ impl TripItemListRow {
|
||||
}
|
||||
}
|
||||
}
|
||||
td
|
||||
."border"
|
||||
."p-0"
|
||||
{
|
||||
@if item.picked {
|
||||
a
|
||||
href={
|
||||
"/trips/" (trip_id)
|
||||
"/items/" (item.item.id)
|
||||
"/" (if item.ready { "unready" } else { "ready" }) }
|
||||
hx-post={
|
||||
"/trips/" (trip_id)
|
||||
"/items/" (item.item.id)
|
||||
"/" (if item.ready { "unready" } else { "ready" }) }
|
||||
hx-target="closest tr"
|
||||
hx-swap="outerHTML"
|
||||
."inline-block"
|
||||
."p-2"
|
||||
."m-0"
|
||||
."w-full"
|
||||
."justify-center"
|
||||
."content-center"
|
||||
."flex"
|
||||
."bg-green-200"[item.ready]
|
||||
."hover:bg-green-100"[!item.ready]
|
||||
{
|
||||
@if item.ready {
|
||||
span
|
||||
."mdi"
|
||||
."mdi-wardrobe-outline"
|
||||
."text-2xl"
|
||||
{}
|
||||
} @else {
|
||||
span
|
||||
."mdi"
|
||||
."mdi-map-marker-question-outline"
|
||||
."text-2xl"
|
||||
{}
|
||||
}
|
||||
}
|
||||
} @else {
|
||||
div
|
||||
."flex"
|
||||
."justify-center"
|
||||
."items-center"
|
||||
{
|
||||
span
|
||||
."mdi"
|
||||
."mdi-wardrobe-outline"
|
||||
."text-2xl"
|
||||
."text-gray-300"
|
||||
{}
|
||||
}
|
||||
}
|
||||
}
|
||||
td
|
||||
."border"
|
||||
."p-0"
|
||||
|
||||
Reference in New Issue
Block a user