update
This commit is contained in:
@@ -76,11 +76,17 @@ impl InventoryCategoryList {
|
|||||||
}
|
}
|
||||||
tbody {
|
tbody {
|
||||||
@for category in categories {
|
@for category in categories {
|
||||||
tr class={@if state.active_category_id.map_or(false, |id| category.id == id) {
|
@let active = state.active_category_id.map_or(false, |id| category.id == id);
|
||||||
"h-10 hover:bg-purple-100 m-3 h-full outline outline-2 outline-indigo-300 pointer-events-none"
|
tr
|
||||||
} @else {
|
."h-10"
|
||||||
"h-10 hover:bg-purple-100 m-3 h-full"
|
."hover:bg-purple-100"
|
||||||
}} {
|
."m-3"
|
||||||
|
."h-full"
|
||||||
|
."outline"[active]
|
||||||
|
."outline-2"[active]
|
||||||
|
."outline-indigo-300"[active]
|
||||||
|
."pointer-events-none"[active]
|
||||||
|
{
|
||||||
|
|
||||||
td
|
td
|
||||||
class=@if state.active_category_id.map_or(false, |id| category.id == id) {
|
class=@if state.active_category_id.map_or(false, |id| category.id == id) {
|
||||||
@@ -198,25 +204,27 @@ impl InventoryItemList {
|
|||||||
@for item in items {
|
@for item in items {
|
||||||
@if state.edit_item.map_or(false, |edit_item| edit_item == item.id) {
|
@if state.edit_item.map_or(false, |edit_item| edit_item == item.id) {
|
||||||
tr ."h-10" {
|
tr ."h-10" {
|
||||||
td ."border" ."bg-blue-300" ."px-2" ."py-0" .flex {
|
td ."border" ."bg-blue-300" ."px-2" ."py-0" {
|
||||||
input ."block" ."w-full" ."bg-blue-100"
|
div ."h-full" ."w-full" {
|
||||||
type="text"
|
input ."px-1" ."block" ."w-full" ."bg-blue-100" ."hover:bg-white"
|
||||||
id="edit-item-name"
|
type="text"
|
||||||
name="edit-item-name"
|
id="edit-item-name"
|
||||||
form="edit-item"
|
name="edit-item-name"
|
||||||
value=(item.name)
|
form="edit-item"
|
||||||
{}
|
value=(item.name)
|
||||||
|
{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
td ."border" ."bg-blue-300" ."px-2" ."py-0" {
|
td ."border" ."bg-blue-300" ."px-2" ."py-0" {
|
||||||
// div ."h-full" ."w-full" {
|
div ."h-full" ."w-full" {
|
||||||
// input ."block" ."w-full" ."bg-blue-100"
|
input ."px-1"."block" ."w-full" ."bg-blue-100" ."hover:bg-white"
|
||||||
// type="number"
|
type="number"
|
||||||
// id="edit-item-weight"
|
id="edit-item-weight"
|
||||||
// name="edit-item-weight"
|
name="edit-item-weight"
|
||||||
// form="edit-item"
|
form="edit-item"
|
||||||
// value=(item.weight)
|
value=(item.weight)
|
||||||
// {}
|
{}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
td ."border-none" ."bg-green-100" ."hover:bg-green-200" .flex ."p-0" {
|
td ."border-none" ."bg-green-100" ."hover:bg-green-200" .flex ."p-0" {
|
||||||
div .aspect-square .w-full .h-full .flex {
|
div .aspect-square .w-full .h-full .flex {
|
||||||
@@ -255,7 +263,8 @@ impl InventoryItemList {
|
|||||||
right:0;", width=(f64::from(item.weight) / f64::from(biggest_item_weight) * 100.0))) {}
|
right:0;", width=(f64::from(item.weight) / f64::from(biggest_item_weight) * 100.0))) {}
|
||||||
}
|
}
|
||||||
td
|
td
|
||||||
."border"
|
."border-none"
|
||||||
|
."p-0"
|
||||||
."bg-blue-200"
|
."bg-blue-200"
|
||||||
."hover:bg-blue-400"
|
."hover:bg-blue-400"
|
||||||
."cursor-pointer"
|
."cursor-pointer"
|
||||||
@@ -272,7 +281,8 @@ impl InventoryItemList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
td
|
td
|
||||||
."border"
|
."border-none"
|
||||||
|
."p-0"
|
||||||
."bg-red-200"
|
."bg-red-200"
|
||||||
."hover:bg-red-400"
|
."hover:bg-red-400"
|
||||||
."cursor-pointer"
|
."cursor-pointer"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ pub mod home;
|
|||||||
pub mod inventory;
|
pub mod inventory;
|
||||||
pub mod triplist;
|
pub mod triplist;
|
||||||
|
|
||||||
|
mod theme;
|
||||||
|
|
||||||
pub use home::*;
|
pub use home::*;
|
||||||
pub use inventory::*;
|
pub use inventory::*;
|
||||||
pub use triplist::*;
|
pub use triplist::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user