Skip to content

Commit

Permalink
Only show priority dropdown options for priorities not currently in use
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-lord committed Nov 16, 2018
1 parent 1d79ade commit 037235a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
41 changes: 28 additions & 13 deletions Do/Components/TaskComponent.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,34 @@
</button>
<div class="dropdown-menu">
<h6 class="dropdown-header">Priority</h6>
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "A")); })">
<span class="badge badge-danger">A</span>
</button>
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "B")); })">
<span class="badge badge-warning">B</span>
</button>
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "C")); })">
<span class="badge badge-info">C</span>
</button>
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "D")); })">
<span class="badge badge-primary">D</span>
</button>
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, null)); })">None</button>
@if (Task.Priority != "A")
{
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "A")); })">
<span class="badge badge-danger">A</span>
</button>
}
@if (Task.Priority != "B")
{
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "B")); })">
<span class="badge badge-warning">B</span>
</button>
}
@if (Task.Priority != "C")
{
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "C")); })">
<span class="badge badge-info">C</span>
</button>
}
@if (Task.Priority != "D")
{
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, "D")); })">
<span class="badge badge-primary">D</span>
</button>
}
@if (Task.Priority != null)
{
<button class="dropdown-item" onclick="@(() => { Priority?.Invoke((Task, null)); })">None</button>
}
<div class="dropdown-divider"></div>
@if (Project == TaskService.CompletedTasks)
{
Expand Down
2 changes: 1 addition & 1 deletion Do/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</li>
</ul>

<p class="version-number"><small>v0.10.0</small></p>
<p class="version-number"><small>v0.10.1</small></p>
</nav>

<div id="content" class="@SidebarActive">
Expand Down

0 comments on commit 037235a

Please sign in to comment.