adding pages and css and .gitignore, scripts, resources, to-do.md

This commit is contained in:
2026-10-27 10:15:05 +02:00
parent d7aaf05123
commit 35aed79337
23 changed files with 360 additions and 0 deletions
+21
View File
@@ -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>
+11
View File
@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace StatiKosev.Pages;
public class Gallery : PageModel
{
public void OnGet()
{
}
}
+14
View File
@@ -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>
+13
View File
@@ -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! : "";
}
}
+27
View File
@@ -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>
+4
View File
@@ -0,0 +1,4 @@
@namespace StatiKosev.Pages
@using Microsoft.Extensions.Localization
@inject IStringLocalizer<StatiKosev.StringValues> StringValues
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+1
View File
@@ -0,0 +1 @@
@{ Layout = "_Layout"; }
+10
View File
@@ -0,0 +1,10 @@
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace StatiKosev;
public class _ViewStart : PageModel
{
public void OnGet()
{
Console.WriteLine("_ViewStart accessed!");
}
}