Move source code to src directory
This commit is contained in:
parent
49782b0325
commit
c9649000ea
109 changed files with 5 additions and 4 deletions
8
src/Website/Views/Account/Index.cshtml
Normal file
8
src/Website/Views/Account/Index.cshtml
Normal file
|
@ -0,0 +1,8 @@
|
|||
@model object
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
Layout = "_Layout";
|
||||
}
|
||||
|
||||
<h2>title</h2>
|
40
src/Website/Views/Account/Login.cshtml
Normal file
40
src/Website/Views/Account/Login.cshtml
Normal file
|
@ -0,0 +1,40 @@
|
|||
@model LoginViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Login";
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrEmpty(Model.ReturnUrl)) {
|
||||
<div>Please log in to perform that action</div>
|
||||
}
|
||||
|
||||
@if (Model.FailedAttempt) {
|
||||
<div>Could not log in with those credentials</div>
|
||||
}
|
||||
|
||||
<form method="post" action="login">
|
||||
<input type="hidden" name="returnUrl" value="@Model.ReturnUrl" />
|
||||
<table>
|
||||
<tr class="form-row">
|
||||
<td>
|
||||
<label for="username">Username: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="username" id="username" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-row">
|
||||
<td>
|
||||
<label for="password">Password: </label>
|
||||
</td>
|
||||
<td>
|
||||
<input name="password" type="password" id="password" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-row">
|
||||
<td colspan="2">
|
||||
<button type="submit">Login</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
21
src/Website/Views/Blog/Edit.cshtml
Normal file
21
src/Website/Views/Blog/Edit.cshtml
Normal file
|
@ -0,0 +1,21 @@
|
|||
@model Website.Models.Blog.BlogPostSubmission
|
||||
|
||||
@{
|
||||
ViewBag.Title = Model != null ? "Edit Post" : "New Post";
|
||||
}
|
||||
|
||||
<form method="post" action="/blog/save" class="edit-form">
|
||||
<input type="hidden" name="id" value="@Model?.Id"/>
|
||||
<div class="edit-form__title form-row">
|
||||
<label for="postTitle" class="edit-form__title__label">Title: </label>
|
||||
<input name="title" id="postTitle" value="@Model?.Title" class="edit-form__title__input"/>
|
||||
</div>
|
||||
<textarea id="postContent" name="content">@Model?.Content</textarea>
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>
|
||||
<script>
|
||||
var simpleMde = new SimpleMDE({ element: document.getElementById("postContent"), tabSize: 4 });
|
||||
</script>
|
11
src/Website/Views/Blog/Entry.cshtml
Normal file
11
src/Website/Views/Blog/Entry.cshtml
Normal file
|
@ -0,0 +1,11 @@
|
|||
@model Website.ViewModels.Blog.BlogPostViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = Model.Title;
|
||||
}
|
||||
|
||||
<article class="blog-post">
|
||||
@Html.Raw(Model.ContentHtml)
|
||||
</article>
|
||||
|
||||
<small>Posted on @Model.Timestamp</small>
|
19
src/Website/Views/Blog/Manage.cshtml
Normal file
19
src/Website/Views/Blog/Manage.cshtml
Normal file
|
@ -0,0 +1,19 @@
|
|||
@model IEnumerable<Website.ViewModels.Blog.BlogPostViewModel>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Manage posts";
|
||||
}
|
||||
|
||||
<a href="/blog/edit">New Post</a>
|
||||
|
||||
<table class="post-list">
|
||||
@foreach (var post in Model) {
|
||||
<tr class="post-list__post">
|
||||
<td><a href="/blog/view/@post.Url">@post.Title</a></td>
|
||||
<td><a href="edit?id=@post.Id"><img src="/images/edit.svg" alt="Edit" title="Edit"/></a></td>
|
||||
<td><a href="/blog/view/@post.Url?preview=true"><img src="/images/blog.svg" alt="Preview" title="Preview"/></a></td>
|
||||
<td><a href="publish?id=@post.Id"><img src="/images/send.svg" alt="Publish" title="Publish" onclick="return confirm('Are you sure?')"/></a></td>
|
||||
<td><a href="delete?id=@post.Id"><img src="/images/delete.svg" alt="Delete" title="Delete" onclick="return confirm('Are you sure?')"/></a></td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
23
src/Website/Views/Blog/Page.cshtml
Normal file
23
src/Website/Views/Blog/Page.cshtml
Normal file
|
@ -0,0 +1,23 @@
|
|||
@model Website.ViewModels.Blog.BlogViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Blog";
|
||||
}
|
||||
|
||||
@foreach (var post in Model.Posts) {
|
||||
<article class="blog-post">
|
||||
<h2><a href="/blog/view/@post.Url">@post.Title</a></h2>
|
||||
@Html.Raw(post.ContentHtml)
|
||||
<small>Posted on @post.Timestamp</small>
|
||||
<p><a href="/blog/view/@post.Url">Read more...</a></p>
|
||||
</article>
|
||||
}
|
||||
|
||||
<div class="blog-navigation">
|
||||
@if (Model.Page > 1) {
|
||||
<a href="/blog/page/@(Model.Page - 1)" class="round-button blog-navigation__previous"><img src="/images/previous.svg" alt="Previous"/></a>
|
||||
}
|
||||
@if (Model.Page < Model.MaxPages) {
|
||||
<a href="/blog/page/@(Model.Page + 1)" class="round-button blog-navigation__next"><img src="/images/next.svg" alt="Next"/></a>
|
||||
}
|
||||
</div>
|
7
src/Website/Views/Error/PageNotFound.cshtml
Normal file
7
src/Website/Views/Error/PageNotFound.cshtml
Normal file
|
@ -0,0 +1,7 @@
|
|||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "404 Not Found";
|
||||
}
|
||||
|
||||
<h1>404 Not Found - page unavailable.</h1>
|
||||
This page cannot be found.
|
25
src/Website/Views/Error/ServerError.cshtml
Normal file
25
src/Website/Views/Error/ServerError.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>
|
23
src/Website/Views/Home/Index.cshtml
Normal file
23
src/Website/Views/Home/Index.cshtml
Normal file
|
@ -0,0 +1,23 @@
|
|||
@model HomeViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Welcome";
|
||||
}
|
||||
|
||||
<p>Hello, I'm Rob. I'm a senior software engineer at <a href="https://www.codecomputerlove.com/" target="_blank">Code Computerlove</a> where I focus on back end development primarily using C#. In my spare time I spend my time riding bikes or making stuff, typically involving an Arduino.</p>
|
||||
<p>This website is primarily an outlet for me to write about things which have been technically challenging, either in a professional or personal capacity, though not limited to that.</p>
|
||||
<p>If you wish to get in contact, then get in touch via my <a href="http://uk.linkedin.com/in/robertmarshall/" target="_blank"><img alt="LinkedIn profile" src="https://static.licdn.com/scds/common/u/img/webpromo/btn_liprofile_blue_80x15.png" title=""></a>.</p>
|
||||
|
||||
<h2>Latest code commit</h2>
|
||||
<table class="commit-table">
|
||||
<tr><td>Repository</td><td><a href="@Model.GitCommit.RepositoryUrl">@Model.GitCommit.RepositoryName</a></td></tr>
|
||||
<tr><td>Branch</td><td>@Model.GitCommit.BranchName</td></tr>
|
||||
<tr><td>SHA</td><td><a href="@Model.GitCommit.CommitUrl">@Model.GitCommit.Hash</a></td></tr>
|
||||
<tr><td>Message</td><td>@Model.GitCommit.CommitMessage</td></tr>
|
||||
<tr><td>Timestamp</td><td>@Model.GitCommit.Timestamp</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>Latest Blog Post</h2>
|
||||
<h3><a href="/blog/view/@Model.BlogPost.Url">@Model.BlogPost.Title</a></h3>
|
||||
<partial name="~/Views/Blog/Entry.cshtml" , model="Model.BlogPost" />
|
||||
<p><a href="/blog">View more</a></p>
|
|
@ -0,0 +1,13 @@
|
|||
@model System.Collections.Generic.IEnumerable<Website.Models.Blog.BlogPost>
|
||||
|
||||
<h5>Blog:</h5>
|
||||
<ul class="nav-list">
|
||||
@foreach (var post in Model) {
|
||||
<li class="nav-list__link"><a href="/blog/view/@post.Url">@post.Title</a></li>
|
||||
}
|
||||
<li class="nav-list__link"><a href="/blog">View All</a></li>
|
||||
|
||||
@if (User.Identity.IsAuthenticated) {
|
||||
<li class="nav-list__link"><a href="/blog/manage">Manage</a></li>
|
||||
}
|
||||
</ul>
|
|
@ -0,0 +1,9 @@
|
|||
@model IEnumerable<Website.Models.Git.Repository>
|
||||
|
||||
<h5>Projects:</h5>
|
||||
<ul class="nav-list">
|
||||
@foreach (var repository in Model) {
|
||||
<li class="nav-list__link"><a href="@repository.Url" target="_blank">@repository.Name</a></li>
|
||||
}
|
||||
<li class="nav-list__link"><a href="//git.robware.uk" target="_blank">View All</a></li>
|
||||
</ul>
|
40
src/Website/Views/Shared/_Layout.cshtml
Normal file
40
src/Website/Views/Shared/_Layout.cshtml
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] | Robware</title>
|
||||
<link href="/css/style.css" rel="stylesheet" defer/>
|
||||
<script type="text/javascript" src="/js/javascript.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<a class="header__blurb" href="/">
|
||||
<span class="header__blurb__title">Robware</span>
|
||||
<small class="header__blurb__tagline">Software by Rob</small>
|
||||
</a>
|
||||
<div class="header__headshot"></div>
|
||||
</header>
|
||||
<div id="content">
|
||||
<main>
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
@RenderBody()
|
||||
</main>
|
||||
<nav>
|
||||
<label for="menu-toggle"><img class="nav-open" src="/images/menu.svg" /></label>
|
||||
<input type="checkbox" id="menu-toggle" />
|
||||
<div class="nav-container">
|
||||
@await Component.InvokeAsync("BlogNavigation")
|
||||
@await Component.InvokeAsync("ProjectNavigation")
|
||||
</div>
|
||||
<div class="strava">
|
||||
<iframe height='160' width='250' frameborder='0' allowtransparency='true' scrolling='no' src='https://www.strava.com/athletes/8892667/activity-summary/df1a6e21a9947dbe7a9dd36f86b1c17185002d22'></iframe>
|
||||
<iframe height='454' width='250' frameborder='0' allowtransparency='true' scrolling='no' src='https://www.strava.com/athletes/8892667/latest-rides/df1a6e21a9947dbe7a9dd36f86b1c17185002d22'></iframe>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="logo" onclick="window.location='/account'"></div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
18
src/Website/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
18
src/Website/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<environment include="Development">
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
|
||||
</script>
|
||||
</environment>
|
3
src/Website/Views/_ViewImports.cshtml
Normal file
3
src/Website/Views/_ViewImports.cshtml
Normal file
|
@ -0,0 +1,3 @@
|
|||
@using Website
|
||||
@using Website.ViewModels
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
3
src/Website/Views/_ViewStart.cshtml
Normal file
3
src/Website/Views/_ViewStart.cshtml
Normal file
|
@ -0,0 +1,3 @@
|
|||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue