Added footer Customization support
This commit is contained in:
parent
7c3fecf70b
commit
37f16270b6
|
@ -1,10 +1,13 @@
|
||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
@using System.Net
|
@using System.Net
|
||||||
@using Microsoft.Extensions.Options
|
@using Microsoft.Extensions.Options
|
||||||
|
@using Wave.Data
|
||||||
|
@using Wave.Utilities
|
||||||
@inherits LayoutComponentBase
|
@inherits LayoutComponentBase
|
||||||
|
|
||||||
@inject NavigationManager Navigation
|
@inject NavigationManager Navigation
|
||||||
@inject IOptions<RequestLocalizationOptions> LocalizationOptions
|
@inject IOptions<RequestLocalizationOptions> LocalizationOptions
|
||||||
|
@inject IOptions<Customization> Customizations
|
||||||
@inject IStringLocalizer<MainLayout> Localizer
|
@inject IStringLocalizer<MainLayout> Localizer
|
||||||
|
|
||||||
<div class="drawer md:drawer-open drawer-end">
|
<div class="drawer md:drawer-open drawer-end">
|
||||||
|
@ -26,8 +29,12 @@
|
||||||
</main>
|
</main>
|
||||||
<footer class="flex flex-col md:flex-row items-center justify-center p-4 gap-y-3 gap-x-4 bg-base-300 text-base-content">
|
<footer class="flex flex-col md:flex-row items-center justify-center p-4 gap-y-3 gap-x-4 bg-base-300 text-base-content">
|
||||||
<span class="flex-1 text-center md:text-left">
|
<span class="flex-1 text-center md:text-left">
|
||||||
Powered by
|
@if (Customizations.Value.Footer is { } footer && !string.IsNullOrWhiteSpace(footer)) {
|
||||||
|
<span class="prose prose-neutral">@MarkdownUtilities.ParseToMarkup(footer)</span>
|
||||||
|
} else {
|
||||||
|
<text>Powered by</text>
|
||||||
<a class="link link-primary" target="_blank" href="https://github.com/miawinter98/Wave">Wave</a>
|
<a class="link link-primary" target="_blank" href="https://github.com/miawinter98/Wave">Wave</a>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
<div class="join w-56" title="@Localizer["Language_Label"]">
|
<div class="join w-56" title="@Localizer["Language_Label"]">
|
||||||
<button type="button" class="btn btn-sm btn-neutral btn-square no-animation join-item">
|
<button type="button" class="btn btn-sm btn-neutral btn-square no-animation join-item">
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
public class Customization {
|
public class Customization {
|
||||||
public string AppName { get; set; } = "Wave";
|
public string AppName { get; set; } = "Wave";
|
||||||
|
public string Footer { get; set; } = "";
|
||||||
}
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
using Markdig;
|
using Markdig;
|
||||||
|
using Microsoft.AspNetCore.Components;
|
||||||
using Wave.Data;
|
using Wave.Data;
|
||||||
|
|
||||||
namespace Wave.Utilities;
|
namespace Wave.Utilities;
|
||||||
|
@ -12,4 +13,8 @@ public static class MarkdownUtilities {
|
||||||
.Build();
|
.Build();
|
||||||
return Markdown.ToHtml(markdown, pipeline);
|
return Markdown.ToHtml(markdown, pipeline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static MarkupString ParseToMarkup(string markdown) {
|
||||||
|
return new MarkupString(Parse(markdown));
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue