update layout for group editors (#2140)

* update block group editor

* update playlist group editor

* update template group editor

* update deco group editor

* update deco template group editor

* update deco editor

* update logs layout

* update changelog
This commit is contained in:
Jason Dove
2025-07-12 13:45:50 +00:00
committed by GitHub
parent 451c534062
commit 2a9f23cce6
39 changed files with 1010 additions and 675 deletions
+32 -1
View File
@@ -10,7 +10,16 @@ public class BlockTreeItemViewModel
Text = blockGroup.Name;
EndText = string.Empty;
TreeItems = [];
CanExpand = blockGroup.BlockCount > 0;
BlockGroupId = blockGroup.Id;
Icon = Icons.Material.Filled.Folder;
}
public BlockTreeItemViewModel(BlockTreeBlockGroupViewModel blockGroup)
{
Text = blockGroup.Name;
EndText = string.Empty;
TreeItems = blockGroup.Blocks.Map(b => new TreeItemData<BlockTreeItemViewModel>
{ Value = new BlockTreeItemViewModel(b) }).ToList();
BlockGroupId = blockGroup.Id;
Icon = Icons.Material.Filled.Folder;
}
@@ -37,6 +46,28 @@ public class BlockTreeItemViewModel
BlockId = block.Id;
}
public BlockTreeItemViewModel(BlockTreeBlockViewModel block)
{
Text = block.Name;
if (block.Minutes / 60 >= 1)
{
string plural = block.Minutes / 60 >= 2 ? "s" : string.Empty;
EndText = $"{block.Minutes / 60} hour{plural}";
if (block.Minutes % 60 != 0)
{
EndText += $", {block.Minutes % 60} minutes";
}
}
else
{
EndText = $"{block.Minutes} minutes";
}
TreeItems = [];
CanExpand = false;
BlockId = block.Id;
}
public string Text { get; }
public string EndText { get; }