Skip to content

Commit

Permalink
add DisplayTimeForPubDate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Sep 27, 2023
1 parent 2640b4a commit e1d9ffe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Moonglade.Configuration/ContentSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public class ContentSettings : IBlogSettings
[Display(Name = "Show call-out section")]
public bool ShowCalloutSection { get; set; }

[Display(Name = "Display time for publish date")]
public bool DisplayTimeForPubDate { get; set; } = true;

[Display(Name = "Show customize footer on each post")]
public bool ShowPostFooter { get; set; }

Expand Down
16 changes: 16 additions & 0 deletions src/Moonglade.Web/Pages/Settings/Content.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,22 @@
</div>
</div>
</div>

<div class="settings-entry2 row align-items-center py-3 px-2 rounded-3 shadow-sm border bg-white mb-2">
<div class="col-auto">
<i class="bi-alarm settings-entry-icon"></i>
</div>
<div class="col">
<label asp-for="@settings.DisplayTimeForPubDate" class="form-check-label"></label>
<div class="form-text">@SharedLocalizer["e.g. 6/27/2016 2:51:35 PM"]</div>
</div>
<div class="col-md-5 text-end">
<div class="form-check form-switch form-control-lg">
<input type="hidden" name="DisplayTimeForPubDate" value="false">
<input type="checkbox" name="DisplayTimeForPubDate" value="true" class="form-check-input" @(settings.DisplayTimeForPubDate ? "checked" : null)>
</div>
</div>
</div>

<div class="rounded-3 shadow-sm border bg-white">
<div class="settings-entry2 row align-items-center py-3 px-2">
Expand Down

0 comments on commit e1d9ffe

Please sign in to comment.