From e79ccf7e8c153ea3a95f19873b1d92cc7c2786fe Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Tue, 2 Jun 2026 17:47:49 +0330 Subject: [PATCH] feat: logo and favicon management in admin panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Admin panel: - New 'هویت سایت' page under تنظیمات in sidebar - Upload logo (PNG transparent, 200×60px recommended) - Upload favicon (PNG/ICO, 32×32 or 64×64px) - Live preview panel shows how logo looks in header and how favicon looks in a browser tab mockup - Saved to SiteSettings with section='identity', key='logo'/'favicon' Frontend (_Layout.cshtml): - Injects AppDbContext to load identity settings per request - If logo is set: shows in header instead of text - If favicon is set: uses uploaded file as - Falls back to text / favicon.ico when not configured Co-Authored-By: Claude Sonnet 4.5 --- DrSousan.Api/Pages/Shared/_Layout.cshtml | 30 +++++- DrSousan.Api/wwwroot/admin/index.html | 130 ++++++++++++++++++++++- 2 files changed, 157 insertions(+), 3 deletions(-) diff --git a/DrSousan.Api/Pages/Shared/_Layout.cshtml b/DrSousan.Api/Pages/Shared/_Layout.cshtml index 2d466e6..4aeb688 100644 --- a/DrSousan.Api/Pages/Shared/_Layout.cshtml +++ b/DrSousan.Api/Pages/Shared/_Layout.cshtml @@ -1,3 +1,12 @@ +@using Microsoft.EntityFrameworkCore +@inject DrSousan.Api.Data.AppDbContext _layoutDb +@{ + var _identity = await _layoutDb.SiteSettings + .Where(s => s.Section == "identity") + .ToListAsync(); + var _logoUrl = _identity.FirstOrDefault(s => s.Key == "logo")?.Value ?? ""; + var _faviconUrl = _identity.FirstOrDefault(s => s.Key == "favicon")?.Value ?? ""; +} @@ -8,7 +17,15 @@ - + @if (!string.IsNullOrEmpty(_faviconUrl)) + { + + + } + else + { + + }