Files
ersatztv/ErsatzTV/ViewModels/BlockTreeItemViewModel.cs
T
Jason DoveandGitHub dcbe4837bf first pass at block scheduling (#1548)
* add blocks, block groups

* basic block and block item editing

* add template groups and basic template editing (name)

* add blocks to template calendar

* edit playout templates

* add calendar preview to playout templates

* add basic block playout building

* add mysql migration

* update changelog
2024-01-13 22:01:21 -06:00

42 lines
988 B
C#

using ErsatzTV.Application.Scheduling;
using MudBlazor;
using S = System.Collections.Generic;
namespace ErsatzTV.ViewModels;
public class BlockTreeItemViewModel
{
public BlockTreeItemViewModel(BlockGroupViewModel blockGroup)
{
Text = blockGroup.Name;
EndText = string.Empty;
TreeItems = [];
CanExpand = blockGroup.BlockCount > 0;
BlockGroupId = blockGroup.Id;
Icon = Icons.Material.Filled.Folder;
}
public BlockTreeItemViewModel(BlockViewModel block)
{
Text = block.Name;
EndText = $"{block.Minutes} minutes";
TreeItems = [];
CanExpand = false;
BlockId = block.Id;
}
public string Text { get; }
public string EndText { get; }
public string Icon { get; }
public bool CanExpand { get; }
public int? BlockId { get; }
public int? BlockGroupId { get; }
public S.HashSet<BlockTreeItemViewModel> TreeItems { get; }
}