Commit ab996e7b authored by Nathan Bean's avatar Nathan Bean
Browse files

Added TAs to user settings

parent 691584ab
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Threading.Tasks;
using KSU.CS.Pendant.Server.Models;
......@@ -31,6 +32,22 @@ namespace KSU.CS.Pendant.Server.Controllers
return View(users);
}
/// <summary>
/// Displays the user details
/// </summary>
/// <param name="id">The id of the user</param>
/// <returns>A HTML page with the details</returns>
public async Task<IActionResult> Details(int id)
{
var user = await _context.Users
.Where(user => user.ID == id)
.Include(user => user.GitHubAccount)
.Include(user => user.ValidationAttempts.OrderByDescending(va => va.DateTime))
.FirstOrDefaultAsync();
return View("Details", user);
}
/// <summary>
/// Provides a form for editing users
/// </summary>
......
......@@ -98,5 +98,10 @@ namespace KSU.CS.Pendant.Server.Models
}
}
/// <summary>
/// A unique identifier for the validation attempt
/// </summary>
public string Identity => $"{RepoFullName} - {CommitIdentifier} - {DateTime}";
}
}
......@@ -2,7 +2,7 @@
@{ ViewData["Title"] = "Update User"; }
<h1>Update User {@Model.FullName}</h1>
<h1>Update User @Model.FullName</h1>
<hr />
<div class="row">
<div class="col-md-6">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment