Add page titles to all pages

This commit is contained in:
jvyden 2021-11-30 12:06:30 -05:00
commit abd3f071aa
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
12 changed files with 28 additions and 13 deletions

View file

@ -5,10 +5,9 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Admin Panel";
}
<h1>Admin Panel</h1>
<h2>Commands</h2>
<div class="ui grid">
@foreach (ICommand command in MaintenanceHelper.Commands)

View file

@ -4,6 +4,7 @@
@{
Layout = "Layouts/BaseLayout";
Model.ShowTitleInPage = false;
}
<h1>Welcome to <b>Project Lighthouse</b>!</h1>

View file

@ -32,7 +32,14 @@
<html lang="en">
<head>
<title>Project Lighthouse</title>
@if (Model.Title == string.Empty)
{
<title>Project Lighthouse</title>
}
else
{
<title>Project Lighthouse - @Model.Title</title>
}
<link rel="stylesheet" type="text/css" href="~/css/styles.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.8/dist/semantic.min.css">
@ -93,6 +100,10 @@
<div class="main">
<div class="ui container">
<br>
@if (Model.ShowTitleInPage)
{
<h1>@Model.Title</h1>
}
@RenderBody()
<div style="height: 50px;"></div> @* makes it look nicer *@
</div>

View file

@ -11,6 +11,10 @@ namespace LBPUnion.ProjectLighthouse.Pages.Layouts
private User? user;
public string Title = string.Empty;
public bool ShowTitleInPage = true;
public new User? User {
get {
if (this.user != null) return this.user;

View file

@ -3,6 +3,7 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Log in";
}
<script src="https://geraintluff.github.io/sha256/sha256.min.js"></script>
@ -16,8 +17,6 @@
return true;
}
</script>
<h1>Log in</h1>
<form onsubmit="return onSubmit(this)">
<div class="ui left labeled input">
<label for="text" class="ui blue label">Username: </label>

View file

@ -3,6 +3,7 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Logged out";
}
<p>You have been successfully logged out. You will be redirected in 5 seconds, or you may click <a href="/">here</a> to do so manually.</p>

View file

@ -3,6 +3,7 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Password Reset";
}
<script src="https://geraintluff.github.io/sha256/sha256.min.js"></script>
@ -19,8 +20,6 @@
}
</script>
<h1>Password Reset</h1>
<form onsubmit="return onSubmit(this)">
<div class="ui left labeled input">
<label for="password" class="ui blue label">Password: </label>

View file

@ -3,9 +3,9 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Password Reset Required";
}
<h1>Password Reset Required</h1>
<p>An admin has deemed it necessary that you reset your password. Please do so.</p>
<a href="/passwordReset">

View file

@ -4,9 +4,9 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Photos";
}
<h1>Photos</h1>
<p>There are @Model.PhotoCount total photos!</p>
@foreach (Photo photo in Model.Photos)

View file

@ -3,6 +3,7 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Register";
}
<script src="https://geraintluff.github.io/sha256/sha256.min.js"></script>
@ -19,8 +20,6 @@
}
</script>
<h1>Register</h1>
<form onsubmit="return onSubmit(this)">
<div class="ui left labeled input">
<label for="text" class="ui blue label">Username: </label>

View file

@ -6,9 +6,9 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Levels";
}
<h1>Levels</h1>
<p>There are @Model.SlotCount total levels!</p>
@foreach (Slot slot in Model.Slots)

View file

@ -6,11 +6,13 @@
@{
Layout = "Layouts/BaseLayout";
Model.Title = "Model.ProfileUser!.Username's user page";
Model.ShowTitleInPage = false;
}
<div class="ui grid">
<div class="eight wide column">
<h1>@Model.ProfileUser!.Username's user page</h1>
<h1>@Model.Title</h1>
<p>
<i>@Model.ProfileUser.Status</i>
</p>