Initial Commit
This commit is contained in:
25
src/SportsDivision.Web/Views/Shared/Error.cshtml
Normal file
25
src/SportsDivision.Web/Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
92
src/SportsDivision.Web/Views/Shared/_Layout.cshtml
Normal file
92
src/SportsDivision.Web/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - Dominica Sports Division</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Sidebar Overlay (mobile) -->
|
||||
<div class="sidebar-overlay" id="sidebarOverlay"></div>
|
||||
|
||||
<!-- Sidebar -->
|
||||
<nav id="sidebar">
|
||||
<div class="sidebar-brand">
|
||||
<i class="bi bi-trophy-fill"></i> Sports Division
|
||||
</div>
|
||||
<ul class="sidebar-nav">
|
||||
<li>
|
||||
<a asp-controller="Dashboard" asp-action="Index"><i class="bi bi-speedometer2"></i> Dashboard</a>
|
||||
</li>
|
||||
|
||||
<li class="sidebar-heading">Management</li>
|
||||
<li>
|
||||
<a asp-controller="Tournament" asp-action="Index"><i class="bi bi-trophy"></i> Tournaments</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="School" asp-action="Index"><i class="bi bi-building"></i> Schools</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="Student" asp-action="Index"><i class="bi bi-people"></i> Students</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="Event" asp-action="Index"><i class="bi bi-calendar-event"></i> Events</a>
|
||||
</li>
|
||||
|
||||
<li class="sidebar-heading">Scoring</li>
|
||||
<li>
|
||||
<a asp-controller="TrackEvent" asp-action="Index"><i class="bi bi-stopwatch"></i> Track Events</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="FieldEvent" asp-action="Index"><i class="bi bi-rulers"></i> Field Events</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="HighJump" asp-action="Index"><i class="bi bi-arrow-up-circle"></i> High Jump</a>
|
||||
</li>
|
||||
|
||||
<li class="sidebar-heading">Reports</li>
|
||||
<li>
|
||||
<a asp-controller="Report" asp-action="Index"><i class="bi bi-file-earmark-bar-graph"></i> Reports</a>
|
||||
</li>
|
||||
|
||||
@if (User.IsInRole("Admin"))
|
||||
{
|
||||
<li class="sidebar-heading">Administration</li>
|
||||
<li>
|
||||
<a asp-controller="UserManagement" asp-action="Index"><i class="bi bi-person-gear"></i> Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a asp-controller="ScoringConfig" asp-action="Index"><i class="bi bi-sliders"></i> Scoring Config</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- Topbar -->
|
||||
<nav id="topbar">
|
||||
<button id="sidebarToggle" aria-label="Toggle sidebar"><i class="bi bi-list"></i></button>
|
||||
<div class="topbar-right">
|
||||
<partial name="_LoginPartial" />
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Content -->
|
||||
<div id="content-wrapper">
|
||||
<partial name="_Notification" />
|
||||
<main role="main">
|
||||
@RenderBody()
|
||||
</main>
|
||||
<footer>
|
||||
© @DateTime.Now.Year Dominica Sports Division. All rights reserved.
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
48
src/SportsDivision.Web/Views/Shared/_Layout.cshtml.css
Normal file
48
src/SportsDivision.Web/Views/Shared/_Layout.cshtml.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
for details on configuring this project to bundle and minify static web assets. */
|
||||
|
||||
a.navbar-brand {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0077cc;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
button.accept-policy {
|
||||
font-size: 1rem;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
line-height: 60px;
|
||||
}
|
||||
46
src/SportsDivision.Web/Views/Shared/_LoginPartial.cshtml
Normal file
46
src/SportsDivision.Web/Views/Shared/_LoginPartial.cshtml
Normal file
@@ -0,0 +1,46 @@
|
||||
@using Microsoft.AspNetCore.Identity
|
||||
@using SportsDivision.Infrastructure.Identity
|
||||
@inject SignInManager<ApplicationUser> SignInManager
|
||||
@inject UserManager<ApplicationUser> UserManager
|
||||
|
||||
@if (SignInManager.IsSignedIn(User))
|
||||
{
|
||||
var currentUser = await UserManager.GetUserAsync(User);
|
||||
var initials = "";
|
||||
var displayName = UserManager.GetUserName(User) ?? "User";
|
||||
if (currentUser != null)
|
||||
{
|
||||
var first = !string.IsNullOrEmpty(currentUser.FirstName) ? currentUser.FirstName[0].ToString() : "";
|
||||
var last = !string.IsNullOrEmpty(currentUser.LastName) ? currentUser.LastName[0].ToString() : "";
|
||||
initials = (first + last).ToUpper();
|
||||
if (!string.IsNullOrEmpty(currentUser.FirstName))
|
||||
{
|
||||
displayName = currentUser.FirstName;
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrEmpty(initials))
|
||||
{
|
||||
initials = displayName.Length > 0 ? displayName[0].ToString().ToUpper() : "U";
|
||||
}
|
||||
|
||||
<div class="dropdown user-dropdown">
|
||||
<button class="dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="user-avatar">@initials</span>
|
||||
<span class="d-none d-sm-inline">@displayName</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
<form asp-controller="Account" asp-action="Logout" method="post">
|
||||
@Html.AntiForgeryToken()
|
||||
<button type="submit" class="dropdown-item"><i class="bi bi-box-arrow-right me-2"></i>Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a asp-controller="Account" asp-action="Login" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-box-arrow-in-right me-1"></i>Login
|
||||
</a>
|
||||
}
|
||||
27
src/SportsDivision.Web/Views/Shared/_Notification.cshtml
Normal file
27
src/SportsDivision.Web/Views/Shared/_Notification.cshtml
Normal file
@@ -0,0 +1,27 @@
|
||||
@if (TempData["SuccessMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
@TempData["SuccessMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (TempData["ErrorMessage"] != null)
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
@TempData["ErrorMessage"]
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
setTimeout(function () {
|
||||
var alerts = document.querySelectorAll('.alert');
|
||||
alerts.forEach(function (alert) {
|
||||
var bsAlert = new bootstrap.Alert(alert);
|
||||
bsAlert.close();
|
||||
});
|
||||
}, 5000);
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,2 @@
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>
|
||||
Reference in New Issue
Block a user