[HTML] Cleanup templates slightly

pull/639/head
Tyrrrz 3 years ago
parent fd9d367bad
commit 2b0fa4213b

@ -1,8 +1,9 @@
@using System
@using System.Linq
@using System.Threading.Tasks
@namespace DiscordChatExporter.Core.Exporting.Writers.Html
@inherits MiniRazor.TemplateBase<DiscordChatExporter.Core.Exporting.Writers.Html.MessageGroupTemplateContext>
@inherits MiniRazor.TemplateBase<MessageGroupTemplateContext>
@{
string FormatDate(DateTimeOffset date) => Model.ExportContext.FormatDate(date);

@ -1,5 +1,5 @@
@namespace DiscordChatExporter.Core.Exporting.Writers.Html
@inherits MiniRazor.TemplateBase<DiscordChatExporter.Core.Exporting.Writers.Html.PostambleTemplateContext>
@inherits MiniRazor.TemplateBase<PostambleTemplateContext>
</div>

@ -1,7 +1,8 @@
@using System
@using System.Threading.Tasks
@namespace DiscordChatExporter.Core.Exporting.Writers.Html
@inherits MiniRazor.TemplateBase<DiscordChatExporter.Core.Exporting.Writers.Html.PreambleTemplateContext>
@inherits MiniRazor.TemplateBase<PreambleTemplateContext>
@{
string FormatDate(DateTimeOffset date) => Model.ExportContext.FormatDate(date);

@ -1,11 +1,13 @@
@using System
@namespace DiscordChatExporter.Core.Exporting.Writers.Html
@inherits MiniRazor.TemplateBase<DiscordChatExporter.Core.Exporting.Writers.Html.PreambleTemplateContext>
@inherits MiniRazor.TemplateBase<PreambleTemplateContext>
@{
var isDarkTheme = string.Equals(Model.ThemeName, "Dark", StringComparison.OrdinalIgnoreCase);
string Themed(string darkVariant, string lightVariant) => isDarkTheme ? darkVariant : lightVariant;
string Themed(string darkVariant, string lightVariant) =>
string.Equals(Model.ThemeName, "Dark", StringComparison.OrdinalIgnoreCase)
? darkVariant
: lightVariant;
}
<style>

Loading…
Cancel
Save