92 lines
2.9 KiB
Plaintext
92 lines
2.9 KiB
Plaintext
@page "/"
|
|
@using Blazorise.TreeView
|
|
|
|
<PageTitle>Accounts</PageTitle>
|
|
|
|
<body>
|
|
<div class="box-wrapper">
|
|
<div id="left-column">
|
|
<h3>Accounts</h3>
|
|
<TreeView
|
|
Nodes="Accounts"
|
|
GetChildNodes="@(accounts => accounts.Tasks)"
|
|
HasChildNodes="@(accounts => accounts.Children?.Any() == true)"
|
|
@bind-SelectedNode="selectedNode"
|
|
@bind-ExpandedNodes="ExpandedNodes" >
|
|
<NodeContent>@context.Text</NodeContent>
|
|
</TreeView>
|
|
<input placeholder = "Add Account" @bind="newAccount" />
|
|
<button>New Account</button>
|
|
<ul>
|
|
@foreach ( var account in accounts)
|
|
{
|
|
<li>@account.AccountName</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
<div class="middle-column">
|
|
<h3>Tasks</h3>
|
|
<h1> Complete: (@task.Count(task => !task.IsComplete)) </h1>
|
|
<input placeholder = "Add Task" @bind="newTask" />
|
|
<button>New Task</button>
|
|
<ul>
|
|
@foreach (var item in task)
|
|
{
|
|
<li>
|
|
<input type="checkbox" @bing="task.IsComplete" />
|
|
<input @bind="task.TaskName" />
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
<div id="right-column">
|
|
Task Notes
|
|
</div>
|
|
</div>
|
|
</body>
|
|
|
|
@code {
|
|
public partial class Accounts {
|
|
private List<Accounts> account = new List<Accounts>();
|
|
account.Add(new Accounts {AccountName = "Hubspot"});
|
|
private string? newAccount;
|
|
private string? AccountName { get; set;};
|
|
}
|
|
|
|
private List<Tasks> task = new List<Tasks>();
|
|
account.Add(new Tasks {TaskName = "Call By Today"});
|
|
private string? newTask { get; set;};
|
|
|
|
private void AddAccount()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(newAccount))
|
|
{
|
|
account.Add(new Accounts { AccountName = newAccount });
|
|
newAccount = string.Empty;
|
|
}
|
|
}
|
|
|
|
private void AddTask()
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(newTask))
|
|
{
|
|
task.Add(new Tasks { TaskName = newTask });
|
|
newTask = string.Empty;
|
|
}
|
|
}
|
|
|
|
IEnumerable<Accounts> Tasks = new[]
|
|
{
|
|
new Accounts {
|
|
AccountName = "Hubspot"
|
|
Tasks = new[]
|
|
{
|
|
new Tasks {
|
|
TaskName = "Call Today"
|
|
},
|
|
}
|
|
},
|
|
};
|
|
//IList<Accounts> ExpandedNodes = new List<Tasks>();
|
|
//Accounts selectedNode;
|
|
} |