Cleanup 2
This commit is contained in:
@@ -10,7 +10,7 @@ namespace MyWebsite.Controllers
|
|||||||
Startup.Database = context;
|
Startup.Database = context;
|
||||||
|
|
||||||
public IActionResult Index() =>
|
public IActionResult Index() =>
|
||||||
View();
|
View(Startup.Database.Gallery);
|
||||||
|
|
||||||
public IActionResult Details(string id) =>
|
public IActionResult Details(string id) =>
|
||||||
View(Startup.Database.Gallery.FirstOrDefault(i => i.FileName == id));
|
View(Startup.Database.Gallery.FirstOrDefault(i => i.FileName == id));
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using MyWebsite.Models;
|
using MyWebsite.Models;
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ namespace MyWebsite.Controllers
|
|||||||
|
|
||||||
[Route("Contacts")]
|
[Route("Contacts")]
|
||||||
public IActionResult Contacts() =>
|
public IActionResult Contacts() =>
|
||||||
View();
|
View(Startup.Database.Links.OrderBy(i => i.Order));
|
||||||
|
|
||||||
[Route("Projects")]
|
[Route("Projects")]
|
||||||
public IActionResult Projects() =>
|
public IActionResult Projects() =>
|
||||||
|
|||||||
@@ -11,10 +11,10 @@ namespace MyWebsite.Controllers
|
|||||||
Startup.Database = context;
|
Startup.Database = context;
|
||||||
|
|
||||||
public IActionResult Index() =>
|
public IActionResult Index() =>
|
||||||
View(Startup.Database.Resume.Find(CultureInfo.CurrentUICulture.Name));
|
View(Startup.Database.Resume.Find(CultureInfo.CurrentUICulture.Name) ?? Startup.Database.Resume.Find("en-US"));
|
||||||
|
|
||||||
public IActionResult Print() =>
|
public IActionResult Print() =>
|
||||||
View(Startup.Database.Resume.Find(CultureInfo.CurrentUICulture.Name));
|
View(Startup.Database.Resume.Find(CultureInfo.CurrentUICulture.Name) ?? Startup.Database.Resume.Find("en-US"));
|
||||||
|
|
||||||
public IActionResult Download()
|
public IActionResult Download()
|
||||||
{
|
{
|
||||||
@@ -25,7 +25,7 @@ namespace MyWebsite.Controllers
|
|||||||
converter.Options.MarginRight = 25;
|
converter.Options.MarginRight = 25;
|
||||||
PdfDocument doc = converter.ConvertHtmlString(
|
PdfDocument doc = converter.ConvertHtmlString(
|
||||||
$@"<html style=""margin-top: -50px"">
|
$@"<html style=""margin-top: -50px"">
|
||||||
{Startup.Database.Resume.Find("en-US").Content}
|
{(Startup.Database.Resume.Find(CultureInfo.CurrentUICulture.Name) ?? Startup.Database.Resume.Find("en-US")).Content}
|
||||||
|
|
||||||
<link rel=""stylesheet"" type=""text/css"" href=""{Request.Scheme}://{Request.Host}/css/Style.css"" />
|
<link rel=""stylesheet"" type=""text/css"" href=""{Request.Scheme}://{Request.Host}/css/Style.css"" />
|
||||||
</html>");
|
</html>");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
|
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
|
||||||
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
|
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
|
||||||
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
|
<WebStackScaffolding_IsLayoutPageSelected>True</WebStackScaffolding_IsLayoutPageSelected>
|
||||||
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
|
<WebStackScaffolding_IsPartialViewSelected>True</WebStackScaffolding_IsPartialViewSelected>
|
||||||
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
|
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
|
||||||
<WebStackScaffolding_LayoutPageFile>
|
<WebStackScaffolding_LayoutPageFile>
|
||||||
</WebStackScaffolding_LayoutPageFile>
|
</WebStackScaffolding_LayoutPageFile>
|
||||||
|
|||||||
@@ -20,3 +20,22 @@
|
|||||||
</article>
|
</article>
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="~/css/Gallery.css" />
|
<link rel="stylesheet" type="text/css" href="~/css/Gallery.css" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
function ToggleImageSize()
|
||||||
|
{
|
||||||
|
var image = document.getElementById("image");
|
||||||
|
|
||||||
|
if (image.style.maxHeight == "none")
|
||||||
|
{
|
||||||
|
image.style.maxHeight = "50vh";
|
||||||
|
image.style.maxWidth = "100%";
|
||||||
|
image.style.cursor = "zoom-in";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
image.style.maxHeight = "none";
|
||||||
|
image.style.maxWidth = "none";
|
||||||
|
image.style.cursor = "zoom-out";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
@{
|
@model IEnumerable<Image>
|
||||||
|
@{
|
||||||
ViewData["Title"] = "My artworks";
|
ViewData["Title"] = "My artworks";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7,8 +8,8 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<article class="gallery">
|
<article class="gallery">
|
||||||
@if (Startup.Database.Gallery.Count() > 0)
|
@if (Model.Count() > 0)
|
||||||
foreach (Image image in Startup.Database.Gallery.OrderByDescending(i => i.CreationDate))
|
foreach (Image image in Model.OrderByDescending(i => i.CreationDate))
|
||||||
{
|
{
|
||||||
<a asp-action="Details" asp-route-id="@image.FileName"><img title="@image.Title" src="~/images/Gallery/@image.FileName" /></a>
|
<a asp-action="Details" asp-route-id="@image.FileName"><img title="@image.Title" src="~/images/Gallery/@image.FileName" /></a>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1>My resume</h1>
|
<h1>My resume</h1>
|
||||||
<p>Last update: @Model.LastUpdate</p>
|
<p>Last update: @Model?.LastUpdate</p>
|
||||||
|
|
||||||
<a class="comment" asp-action="Download">// Download CV (.pdf) </a><br />
|
<a class="comment" asp-action="Download">// Download CV (.pdf) </a><br />
|
||||||
<a class="comment" asp-action="Print">// Print CV </a>
|
<a class="comment" asp-action="Print">// Print CV </a>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@{
|
@model IEnumerable<Link>
|
||||||
|
@{
|
||||||
ViewData["Title"] = "Contact info";
|
ViewData["Title"] = "Contact info";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,13 +9,13 @@
|
|||||||
|
|
||||||
<article>
|
<article>
|
||||||
<p>
|
<p>
|
||||||
@foreach (Link link in Startup.Database.Links.Where(i => i.CanContactMe).OrderBy(i => i.Order))
|
@foreach (Link link in Model.Where(i => i.CanContactMe))
|
||||||
{
|
{
|
||||||
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
@foreach (Link link in Startup.Database.Links.Where(i => !i.CanContactMe).OrderBy(i => i.Order))
|
@foreach (Link link in Model.Where(i => !i.CanContactMe))
|
||||||
{
|
{
|
||||||
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
<a class="socicon-@(link.Name)"></a> @(link.Title) <a href="@(link.Url)" target="_blank">@(link.Username)</a><br />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,20 +4,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="contact-me">
|
<div class="contact-me">
|
||||||
<code>
|
|
||||||
<var>if</var> (<var class="class">You</var>.InsterestedInMe)<br />
|
<var>if</var> (<var class="class">You</var>.InsterestedInMe)<br />
|
||||||
<span class="t1"></span><var class="method">ContactMe</var>();<br />
|
<span class="t1"></span><var class="method">ContactMe</var>();<br />
|
||||||
<br />
|
<br />
|
||||||
<a class="comment">// All links are clickable</a><br />
|
<a class="comment">// All links are clickable</a><br />
|
||||||
<var>public void</var> <var class="method">ConatactMe</var>()<br />
|
<var>public void</var> <var class="method">ConatactMe</var>()<br />
|
||||||
{<br />
|
{<br />
|
||||||
@if(email != null)
|
@if (email != null)
|
||||||
{
|
{
|
||||||
<span><span class="t1"></span><var>string</var> email = <a class="string" href="@email.Url">"@email.Username"</a>;</span><br />
|
<span><span class="t1"></span><var>string</var> email = <a class="string" href="@email.Url">"@email.Username"</a>;</span><br />
|
||||||
}
|
}
|
||||||
<span class="t1"></span><var class="class">Link</var>[] socialNetworks = <var>new</var> <var class="class">Link</var>[]<br />
|
<span class="t1"></span><var class="class">Link</var>[] socialNetworks = <var>new</var> <var class="class">Link</var>[]<br />
|
||||||
<span class="t1"></span>{<br />
|
<span class="t1"></span>{<br />
|
||||||
@foreach(Link link in links)
|
@foreach (Link link in links)
|
||||||
{
|
{
|
||||||
<span><span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"@(link.Title)"</a>, <a class="string" target="_blank" href="@(link.Url)">"https:@(link.Url)"</a>),</span><br />
|
<span><span class="t2"></span><var>new</var> <var class="class">Link</var>(<a class="string">"@(link.Title)"</a>, <a class="string" target="_blank" href="@(link.Url)">"https:@(link.Url)"</a>),</span><br />
|
||||||
}
|
}
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
}<br />
|
}<br />
|
||||||
<br />
|
<br />
|
||||||
<a class="comment">// Copyright ©@(DateTime.Today.Year) Michael "XFox" Gordeev</a>
|
<a class="comment">// Copyright ©@(DateTime.Today.Year) Michael "XFox" Gordeev</a>
|
||||||
</code>
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="~/css/ContactsBlock.css" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="~/css/ContactsBlock.css" />
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<title>@ViewData["Title"] - XFox111.NET</title>
|
<title>@ViewData["Title"] - XFox111.NET</title>
|
||||||
<link rel="shortcut icon" href="~/images/favicon.png" type="image/png" />
|
<link rel="shortcut icon" href="~/images/favicon.png" type="image/png" />
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="~/css/style.css" />
|
<link rel="stylesheet" type="text/css" href="~/css/Style.css" />
|
||||||
<link rel="stylesheet" href="https://d1azc1qln24ryf.cloudfront.net/114779/Socicon/style-cf.css?9ukd8d">
|
<link rel="stylesheet" href="https://d1azc1qln24ryf.cloudfront.net/114779/Socicon/style-cf.css?9ukd8d">
|
||||||
|
|
||||||
<script src="~/js/site.js" type="text/javascript"></script>
|
<script src="~/js/site.js" type="text/javascript"></script>
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- TODO: Make OpenGraph tags more specific for each page -->
|
||||||
<meta name="author" content="Michael 'XFox' Gordeev" />
|
<meta name="author" content="Michael 'XFox' Gordeev" />
|
||||||
<meta name="description" content="Hi, my name is Michael. I'm C# Developer and this is my personal website. Here you can find info about me, my projects and more. Check it out!" />
|
<meta name="description" content="Hi, my name is Michael. I'm C# Developer and this is my personal website. Here you can find info about me, my projects and more. Check it out!" />
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar">
|
<nav>
|
||||||
<a asp-controller="Home" asp-action="Index" asp-area="">XFox111.NET</a>
|
<a asp-controller="Home" asp-action="Index" asp-area="">XFox111.NET</a>
|
||||||
|
|
||||||
<menu type="toolbar" id="main-menu" style="display:none">
|
<menu type="toolbar" id="main-menu" style="display:none">
|
||||||
@@ -46,8 +47,10 @@
|
|||||||
<li><a asp-area="" asp-controller="Contacts" asp-action="Index">Contacts();</a></li>
|
<li><a asp-area="" asp-controller="Contacts" asp-action="Index">Contacts();</a></li>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<a class="language-switch" asp-controller="Home" asp-action="SwitchLanguage" lang="ru">РУС </a>
|
<div>
|
||||||
<a class="menu-toggle" onclick="ToggleMenu();"></a>
|
<a asp-controller="Home" asp-action="SwitchLanguage" lang="ru">РУС </a>
|
||||||
|
<a id="menu-toggle" onclick="ToggleMenu();"></a>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -85,6 +85,24 @@ table {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-color: #343434;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-danger {
|
||||||
|
background-color: red;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkbox {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.readonly {
|
||||||
|
background-color: lightgray;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 700px) {
|
@media only screen and (max-width: 700px) {
|
||||||
form {
|
form {
|
||||||
max-width: initial;
|
max-width: initial;
|
||||||
|
|||||||
@@ -8,10 +8,6 @@
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
|
||||||
font: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
var {
|
var {
|
||||||
color: #569cd6;
|
color: #569cd6;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
@font-face {
|
/*
|
||||||
|
This file contains main layout styles which applies to every View. In some views this rules are overrided in separate CSS files
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*Declaring fonts*/
|
||||||
|
@font-face {
|
||||||
font-family: 'Consolas';
|
font-family: 'Consolas';
|
||||||
src: url("/fonts/consolas.eot");
|
src: url("/fonts/consolas.eot");
|
||||||
src: url("/fonts/consolas.eot?#iefix") format("embedded-opentype"), url("/fonts/consolas.otf") format("opentype"), url("/fonts/consolas.svg") format("svg"), url("/fonts/consolas.ttf") format("truetype"), url("/fonts/consolas.woff") format("woff"), url("/fonts/consolas.woff2") format("woff2");
|
src: url("/fonts/consolas.eot?#iefix") format("embedded-opentype"), url("/fonts/consolas.otf") format("opentype"), url("/fonts/consolas.svg") format("svg"), url("/fonts/consolas.ttf") format("truetype"), url("/fonts/consolas.woff") format("woff"), url("/fonts/consolas.woff2") format("woff2");
|
||||||
@@ -11,9 +16,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*Header styles*/
|
/*Header styles*/
|
||||||
.navbar {
|
nav {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: auto 1fr auto auto;
|
grid-template-columns: auto 1fr auto;
|
||||||
grid-column-gap: 10px;
|
grid-column-gap: 10px;
|
||||||
grid-template-rows: auto auto;
|
grid-template-rows: auto auto;
|
||||||
background-color: #343434;
|
background-color: #343434;
|
||||||
@@ -27,32 +32,46 @@
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar a {
|
nav a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
.navbar a:hover {
|
nav a:hover {
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
|
nav div {
|
||||||
#main-menu {
|
grid-column: 3;
|
||||||
|
user-select: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
menu {
|
||||||
margin: 26px auto 26px auto;
|
margin: 26px auto 26px auto;
|
||||||
grid-row: 2;
|
grid-row: 2;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
#main-menu li {
|
menu li {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language-switch {
|
/*Adaptive code*/
|
||||||
grid-column: 3;
|
@media only screen and (min-width: 1000px) {
|
||||||
user-select: none
|
menu {
|
||||||
}
|
display: initial !important;
|
||||||
.menu-toggle {
|
grid-row: 1;
|
||||||
grid-column: 4;
|
grid-column: 2;
|
||||||
cursor: pointer;
|
margin: 0px;
|
||||||
user-select: none;
|
}
|
||||||
|
|
||||||
|
menu li {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-toggle {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Footer styles*/
|
/*Footer styles*/
|
||||||
@@ -78,8 +97,10 @@ html {
|
|||||||
|
|
||||||
body {
|
body {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
margin-top: 53px;
|
margin-top: 53px;
|
||||||
|
|
||||||
font-family: 'Consolas', 'Segoe MDL2 Assets';
|
font-family: 'Consolas', 'Segoe MDL2 Assets';
|
||||||
|
|
||||||
/*This stuff is necessary for sticky footer*/
|
/*This stuff is necessary for sticky footer*/
|
||||||
@@ -104,42 +125,6 @@ article a:visited, article a:link {
|
|||||||
color: blue;
|
color: blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
|
||||||
background-color: #343434;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-danger {
|
|
||||||
background-color: red;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox {
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.readonly {
|
|
||||||
background-color: lightgray;
|
|
||||||
}
|
|
||||||
|
|
||||||
.comment, .comment:visited {
|
.comment, .comment:visited {
|
||||||
color: #57a64a !important;
|
color: #57a64a !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Adaptive code*/
|
|
||||||
@media only screen and (min-width: 1000px) {
|
|
||||||
#main-menu {
|
|
||||||
display: initial !important;
|
|
||||||
grid-row: 1;
|
|
||||||
grid-column: 2;
|
|
||||||
margin: 0px;
|
|
||||||
}
|
|
||||||
#main-menu li {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 10px;
|
|
||||||
margin-top: 0px;
|
|
||||||
}
|
|
||||||
.menu-toggle {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +1 @@
|
|||||||
const delay = ms => new Promise(res => setTimeout(res, ms));
|
const delay = ms => new Promise(res => setTimeout(res, ms));
|
||||||
function ToggleMenu()
|
|
||||||
{
|
|
||||||
var menu = document.getElementsByClassName("main-menu")[0];
|
|
||||||
|
|
||||||
if (menu.style.display == "none")
|
|
||||||
menu.style.display = "initial";
|
|
||||||
else
|
|
||||||
menu.style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
function ToggleImageSize()
|
|
||||||
{
|
|
||||||
var image = document.getElementById("image");
|
|
||||||
|
|
||||||
if (image.style.maxHeight == "none")
|
|
||||||
{
|
|
||||||
image.style.maxHeight = "50vh";
|
|
||||||
image.style.maxWidth = "100%";
|
|
||||||
image.style.cursor = "zoom-in";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
image.style.maxHeight = "none";
|
|
||||||
image.style.maxWidth = "none";
|
|
||||||
image.style.cursor = "zoom-out";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user