adding pages and css and .gitignore, scripts, resources, to-do.md
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
@page
|
||||
@model StatiKosev.Pages.Gallery
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
@StringValues["Gallery"]
|
||||
</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace StatiKosev.Pages;
|
||||
|
||||
public class Gallery : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
@page "/"
|
||||
@model IndexModel
|
||||
@{
|
||||
ViewData["Title"] = StringValues["Title"];
|
||||
}
|
||||
|
||||
<div>
|
||||
<h1 id="welcome">@StringValues["Welcome"]</h1>
|
||||
<div>@StringValues["Hello", string.IsNullOrEmpty(Model.VisitorName) ? StringValues["Guest"].Value : Model.VisitorName]</div>
|
||||
<div>
|
||||
<img src="~/images/profile.jpg" alt="@StringValues["PhotoAlt"]" width="600" asp-append-version="true" />
|
||||
</div>
|
||||
<div id="description"></div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace StatiKosev.Pages;
|
||||
|
||||
public class IndexModel : PageModel
|
||||
{
|
||||
public string VisitorName { get; private set; } = "";
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
VisitorName = User.Identity?.IsAuthenticated == true ? User.Identity.Name! : "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
@{
|
||||
var path = Context.Request.Path.Value ?? "/";
|
||||
string Active(string p) => path.Equals(p, StringComparison.OrdinalIgnoreCase) ? "active" : "";
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html lang="@System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName">
|
||||
|
||||
<head>
|
||||
<nav class="main-nav" aria-label="@StringValues["Navigation"]">
|
||||
<a asp-page="/Index" class="@Active("/")">@StringValues["Home"]</a>
|
||||
<a asp-page="/Gallery" class="@Active("/Gallery")">@StringValues["Gallery"]</a>
|
||||
<a asp-page="/Contact" class="@Active("/Contact")">@StringValues["Contact"]</a>
|
||||
</nav>
|
||||
<meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>@StringValues["Title"]</title>
|
||||
<link rel="stylesheet" href="~/styles/site.css" asp-append-version="true"/>
|
||||
|
||||
<a href="/set-language?culture=bg&returnUrl=@Context.Request.Path">Български</a>
|
||||
<a href="/set-language?culture=en&returnUrl=@Context.Request.Path">English</a>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<main>@RenderBody()</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,4 @@
|
||||
@namespace StatiKosev.Pages
|
||||
@using Microsoft.Extensions.Localization
|
||||
@inject IStringLocalizer<StatiKosev.StringValues> StringValues
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@@ -0,0 +1 @@
|
||||
@{ Layout = "_Layout"; }
|
||||
@@ -0,0 +1,10 @@
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
namespace StatiKosev;
|
||||
|
||||
public class _ViewStart : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
Console.WriteLine("_ViewStart accessed!");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user