feat/live-preview #8
@ -31,7 +31,7 @@ public class UserPageRepository : IUserPageRepository
|
||||
|
||||
public async Task<UserPage?> GetBySlugAsync(string category, string slug)
|
||||
{
|
||||
return await _pages.Find(x => x.Category == category.ToLower() && x.Slug == slug && x.IsActive).FirstOrDefaultAsync();
|
||||
return await _pages.Find(x => x.Category.ToLower() == category.ToLower() && x.Slug == slug && x.IsActive).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<UserPage?> GetByUserIdAsync(string userId)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
var seo = ViewBag.SeoSettings as BCards.Web.Models.SeoSettings;
|
||||
var category = ViewBag.Category as BCards.Web.Models.Category;
|
||||
var isPreview = ViewBag.IsPreview as bool? ?? false;
|
||||
|
||||
|
||||
ViewData["Title"] = seo?.Title ?? $"{Model.DisplayName} - {category?.Name}";
|
||||
Layout = isPreview ? "_Layout" : "_UserPageLayout";
|
||||
}
|
||||
@ -11,9 +11,16 @@
|
||||
@if (!isPreview)
|
||||
{
|
||||
@section Styles {
|
||||
<style>
|
||||
@Html.Raw(await Html.PartialAsync("_ThemeStyles", Model.Theme))
|
||||
</style>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<style>
|
||||
@Html.Raw(await Html.PartialAsync("_ThemeStyles", Model.Theme))
|
||||
</style>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@section Styles {
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +66,7 @@
|
||||
onclick="recordClick('@Model.Id', @i)">
|
||||
@if (!string.IsNullOrEmpty(link.Icon))
|
||||
{
|
||||
<span class="link-icon me-2">@link.Icon</span>
|
||||
<i class="@link.Icon"></i>
|
||||
}
|
||||
<div>
|
||||
<div class="link-title">@link.Title</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user