添加项目文件。

This commit is contained in:
Zel
2025-01-22 23:31:03 +08:00
parent 1b8ba6771f
commit 2ae76476fb
894 changed files with 774558 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.ConfirmViewModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
}
<div class="card">
<div class="card-header">
<h3>Account Email Verification</h3>
</div>
<div class="card-body">
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}
<p>
Already a member? <a href="@GlobalConfiguration.BasePath/Account/Login">Login</a>.<br />
Forgot your password? @Html.ActionLink("Reset it.", "Forgot", "Account").<br />
</p>
</div>
</div>

View File

@@ -0,0 +1,39 @@
@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.DeleteAccountViewModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
}
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}
@if (string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="card border-danger mb-3">
<div class="card-header bg-danger text-white">
<strong>Delete account "@Model.AccountName"?</strong>
</div>
<div class="card-body">
Deleting "@Model.AccountName" will permanently remove the account. All pages created or modified by this user will be attributed to a stand-in account.
<strong>You will not be able to revert this action. </strong>
<br /><br />
Are you sure you want to continue with this deletion?<br /><br />
@using (Html.BeginForm(null, null, FormMethod.Post, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}" }))
{
<div class="form-group"><button type="submit" class="btn btn-danger rounded-0" name="IsActionConfirmed" value="true">Yes</button>&nbsp;&nbsp;<button type="submit" class="btn btn-success rounded-0" name="IsActionConfirmed" value="false">No</button></div>
}
</div>
</div>
}

View File

@@ -0,0 +1,23 @@
@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.DeletedAccountViewModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
var sessionState = ViewData["SessionState"] as TightWiki.SessionState ?? throw new Exception("Wiki State Context cannot be null.");
}
<div class="card border-danger mb-3">
<div class="card-header bg-danger text-white">
<strong>Account Deleted!</strong>
</div>
<div class="card-body">
The account has been deleted and all content that was created or modified by this account has been attributed to an anonymized profile..<br /><br />
<br /><br />
@if (TightWiki.Models.GlobalConfiguration.AllowSignup == true)
{
@:Not a member? <a href="@GlobalConfiguration.BasePath/Identity/Account/Register">Register as a new user</a>.<br />
}
Already a member? <a href="@GlobalConfiguration.BasePath/Identity/Account/Login">Login</a>.<br />
</div>
</div>

View File

@@ -0,0 +1,206 @@
@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.AccountProfileViewModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
}
<h3>
Profile
</h3>
<p>
This is your profile, do with it what you may.<br /><br />
</p>
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}
@using (Html.BeginForm(null, null, null, FormMethod.Post, true, new { action = $"{GlobalConfiguration.BasePath}{Context.Request.Path}", enctype = "multipart/form-data" }))
{
@Html.AntiForgeryToken()
<div class="container">
<form>
@Html.HiddenFor(m => m.AccountProfile.UserId)
@Html.HiddenFor(m => m.AccountProfile.Navigation)
<div class="form-group row mb-1">
<label for="Avatar" class="col-sm-2 col-form-label"><strong>Avatar</strong></label>
<div class="col-sm-10">
@if (@Model.AccountProfile.Navigation != "")
{
<img src="@GlobalConfiguration.BasePath/Profile/@Model.AccountProfile.Navigation/Avatar?max=150" class="mb-1" />
}
<input type="file" id="Avatar" name="Avatar" class="form-control-file" onchange="fileCheck(this);" />
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.EmailAddress)</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="EmailAddress" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.EmailAddress)</strong></label>
<div class="col-sm-10">
@Html.DisplayFor(m => m.AccountProfile.EmailAddress, new { @class = "form-control-plaintext" })
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.AccountName)</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="AccountName" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.AccountName)</strong></label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.AccountProfile.AccountName, new { @class = "form-control" })
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.FirstName)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="FirstName" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.FirstName)</strong></label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.AccountProfile.FirstName, new { @class = "form-control" })
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.LastName)</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="LastName" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.LastName)</strong></label>
<div class="col-sm-10">
@Html.TextBoxFor(m => m.AccountProfile.LastName, new { @class = "form-control" })
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.Role)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="Role" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.Role)</strong></label>
<div class="col-sm-10">
@Html.DisplayFor(m => m.AccountProfile.Role, new { @class = "form-control-plaintext" })
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.Theme)</div>
</div>
</div>
<div class="form-group row mb-3">
<label for="Theme" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.Theme)</strong></label>
<div class="col-sm-10">
<select name="AccountProfile.Theme" id="AccountProfile.Theme" class="form-control">
<option value="">System Default</option>
@foreach (var item in Model.Themes)
{
<option value="@item.Name" selected=@(Model.AccountProfile.Theme == item.Name ? "selected" : null)>
@item.Name
</option>
}
</select>
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.Country)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="Country" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.Country)</strong></label>
<div class="col-sm-10">
<select name="AccountProfile.Country" id="AccountProfile.Country" class="form-control">
<option value="" style="color:#ccc !important;">Select a country</option>
@foreach (var item in Model.Countries)
{
<option value="@item.Value" selected=@(Model.AccountProfile.Country == item.Value ? "selected" : null)>
@item.Text
</option>
}
</select>
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.Language)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="Language" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.Language)</strong></label>
<div class="col-sm-10">
<select name="AccountProfile.Language" id="AccountProfile.Language" class="form-control">
<option value="" style="color:#ccc !important;">Select a language</option>
@foreach (var item in Model.Languages)
{
<option value="@item.Value" selected=@(Model.AccountProfile.Language == item.Value ? "selected" : null)>
@item.Text
</option>
}
</select>
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.TimeZone)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="TimeZone" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.TimeZone)</strong></label>
<div class="col-sm-10">
<select name="AccountProfile.TimeZone" id="AccountProfile.TimeZone" class="form-control">
<option value="" style="color:#ccc !important;">Select a time-zone</option>
@foreach (var item in Model.TimeZones)
{
<option value="@item.Value" selected=@(Model.AccountProfile.TimeZone == item.Value ? "selected" : null)>
@item.Text
</option>
}
</select>
</div>
</div>
<div class="form-group row">
<div class="col-sm-12">
<div class="text-danger">@Html.ValidationMessageFor(m => m.AccountProfile.Biography)</div>
</div>
</div>
<div class="form-group row mb-1">
<label for="Biography" class="col-sm-2 col-form-label"><strong>@Html.LabelFor(m => m.AccountProfile.Biography)</strong></label>
<div class="col-sm-10">
@Html.TextAreaFor(m => m.AccountProfile.Biography, new { @class = "form-control", style = "height:200px", Name = "Biography" })
</div>
</div>
<div class="form-group row mb-1">
<div class="col-sm-10 offset-sm-2">
<button type="submit" class="btn btn-primary rounded-0">Save!</button>
</div>
</div>
</form>
</div>
}
<br />
<form action="@GlobalConfiguration.BasePath/Profile/Delete"><button type="submit" class="btn btn-danger rounded-0">Delete Account</button></form>

View File

@@ -0,0 +1,82 @@
@using TightWiki.Models
@model TightWiki.Models.ViewModels.Profile.PublicViewModel
@{
Layout = "/Views/Shared/_Layout.cshtml";
}
<table class="fixedTable100" border="0" cellpadding="5">
<tbody>
<tr>
<td height="52" valign="middle" align="left">
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
{
<div class="alert alert-danger">@Html.Raw(Model.ErrorMessage)</div>
}
@if (!string.IsNullOrEmpty(Model.SuccessMessage))
{
<div class="alert alert-success">@Html.Raw(Model.SuccessMessage)</div>
}
@if (string.IsNullOrWhiteSpace(Model.Navigation) == false)
{
<table border="0">
<tr class="padded">
<td><img src="/Profile/@Model.Navigation/Avatar?max=150" /></td>
<td>&nbsp;</td>
</tr>
<tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.AccountName)</div></td></tr>
<tr class="padded">
<td><strong>@Html.LabelFor(m => m.AccountName)</strong></td>
<td>@Html.DisplayFor(m => m.AccountName)</td>
</tr>
<tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Country)</div></td></tr>
<tr class="padded">
<td><strong>@Html.LabelFor(m => m.Country)</strong></td>
<td>@Html.DisplayFor(m => m.Country)</td>
</tr>
<tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Language)</div></td></tr>
<tr class="padded">
<td><strong>@Html.LabelFor(m => m.Language)</strong></td>
<td>@Html.DisplayFor(m => m.Language)</td>
</tr>
<tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.TimeZone)</div></td></tr>
<tr class="padded">
<td><strong>@Html.LabelFor(m => m.TimeZone)</strong></td>
<td>@Html.DisplayFor(m => m.TimeZone)</td>
</tr>
<tr><td colspan="2"><div class="text-danger">@Html.ValidationMessageFor(m => m.Biography)</div></td></tr>
<tr class="padded">
<td><strong>@Html.LabelFor(m => m.Biography)</strong></td>
<td><div style="word-wrap: break-word;">@Html.Raw(Model.Biography)</div></td>
</tr>
</table>
}
@if (Model.RecentlyModified.Count > 0)
{
<hr class="mt-5 mb-5">
<h2>Recently Modified</h2>
<table class="table fixedTable100 table-striped" border="0" cellspacing="0" cellpadding="0">
<thead>
<tr>
<td><strong>Page</strong></td>
<td><strong>Modified</strong></td>
<td><strong>Summary</strong></td>
</tr>
</thead>
<tbody>
@foreach (var h in Model.RecentlyModified)
{
<tr>
<td><a href="@GlobalConfiguration.BasePath/@h.Navigation">@Html.DisplayTextFor(x => h.Name)</a></td>
<td>@Html.DisplayTextFor(x => h.ModifiedDate)</td>
<td>@Html.DisplayTextFor(x => h.ChangeSummary)</td>
</tr>
}
</tbody>
</table>
}
</td>
</tr>
</tbody>
</table>