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:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user