@page "/tasks"
@page "/tasks/all"
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@rendermode @(new InteractiveServerRenderMode(prerender: false))
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
@inject ApiClientService ApiClient
@inject IJSRuntime JS
@inject AuthenticationStateProvider AuthStateProvider
@inject MenuAuthorizationService MenuAuthorization
@inject NavigationManager Navigation
@(isAdmin ? "View and manage all tasks across projects." : "Your assigned tasks.")
| Task Code | Task | Status | Priority | Due Date | Project | Assignee | Actions |
|---|---|---|---|---|---|---|---|
| @GetTaskCode(task.Id) |
@task.Title
@if (!string.IsNullOrEmpty(task.Description))
{
@task.Description } |
@GetStatusLabel(task.StatusId) | @GetPriorityLabel(task.PriorityId) | @DisplayFormats.Date(task.DueDate) | @{ var proj = projects.FirstOrDefault(p => p.Id == task.ProjectId); } @(proj?.Name ?? $"#{task.ProjectId}") |
@{ var user = allUsers.FirstOrDefault(u => u.Id == task.AssignedTo); }
@if (user != null)
{
@(user.FirstName.Length > 0 ? user.FirstName[0].ToString().ToUpper() : "")@(user.LastName.Length > 0 ? user.LastName[0].ToString().ToUpper() : "")
@user.FirstName @user.LastName
}
else
{
Unassigned
}
|
@if (canEditTask)
{
}
@if (canDeleteTask)
{
}
|
@titleErrorMessage
}@projectErrorMessage
}@errorMessage