信息公开前端
This commit is contained in:
1 parent
1f7603923e
commit
eebc5518c5
14 files changed
+176
-100
No files matched your search
@@ -0,0 +1,21 @@
|
||||
namespace ElectionSystem.Api.Modules.Cms;
|
||||
|
||||
public sealed record PublicContentSection(string ContentType, string Title, string Description);
|
||||
|
||||
public static class PublicContentSections
|
||||
{
|
||||
public static IReadOnlyList<PublicContentSection> All { get; } =
|
||||
[
|
||||
new("ElectionNotice", "选举公告", "事项、安排与正式通知"),
|
||||
new("PolicyDocument", "规则与政策", "适用规则与制度文件"),
|
||||
new("CandidateDisclosure", "候选人公示", "候选人公开信息"),
|
||||
new("VoterGuide", "选民指南", "参与流程与操作说明"),
|
||||
new("ResultAnnouncement", "结果公告", "已发布的正式结果"),
|
||||
new("PublicFaq", "常见问题", "公开查阅与参与答疑"),
|
||||
new("DownloadAsset", "资料下载", "公开资料与表单文件"),
|
||||
new("ArchiveRecord", "历史归档", "过往活动公开记录")
|
||||
];
|
||||
|
||||
public static bool TryGet(string contentType, out PublicContentSection? section) =>
|
||||
(section = All.FirstOrDefault(item => string.Equals(item.ContentType, contentType, StringComparison.Ordinal))) is not null;
|
||||
}
|
||||
@@ -12,23 +12,24 @@
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header"><a class="brand" href="/">选举与投票信息系统</a><nav aria-label="主导航"><a href="/content">信息公开</a></nav></header>
|
||||
<main class="container article">
|
||||
<partial name="_PublicHeader" />
|
||||
<main id="main-content" class="container article detail-page">
|
||||
@if (!Model.CmsAvailable)
|
||||
{
|
||||
<p class="status-note">信息公开服务暂不可用,请稍后刷新页面。</p>
|
||||
}
|
||||
else if (Model.Item is { } item)
|
||||
{
|
||||
<p class="eyebrow">@item.ContentType</p>
|
||||
<a class="back-link" href="/content">← 返回信息公开</a>
|
||||
<p class="eyebrow">正式公开内容</p>
|
||||
<h1>@item.Title</h1>
|
||||
@if (item.PublishedUtc is { } publishedUtc)
|
||||
{
|
||||
<p class="published-at">发布时间:<time datetime="@publishedUtc.ToString("O")">@publishedUtc.ToLocalTime().ToString("yyyy-MM-dd HH:mm")</time></p>
|
||||
<p class="published-at"><span>发布时间</span><time datetime="@publishedUtc.ToString("O")">@publishedUtc.ToLocalTime().ToString("yyyy-MM-dd HH:mm")</time></p>
|
||||
}
|
||||
<div class="cms-body">@Html.Raw(item.Html)</div>
|
||||
}
|
||||
</main>
|
||||
<footer class="site-footer">所有时间和结果以活动正式公告为准。</footer>
|
||||
<partial name="_PublicFooter" />
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,10 +12,11 @@
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header"><a class="brand" href="/">选举与投票信息系统</a><nav aria-label="主导航"><a href="/content">信息公开</a></nav></header>
|
||||
<main class="container article">
|
||||
<p class="eyebrow">PUBLIC INFORMATION</p>
|
||||
<partial name="_PublicHeader" />
|
||||
<main id="main-content" class="container article listing-page">
|
||||
<p class="eyebrow">信息公开目录</p>
|
||||
<h1>@Model.Heading</h1>
|
||||
<p class="article__intro">以下内容均为已审核发布的信息。请以页面所示发布日期及正式公告为准。</p>
|
||||
@if (!Model.CmsAvailable)
|
||||
{
|
||||
<p class="status-note">信息公开服务暂不可用,请稍后刷新页面。</p>
|
||||
@@ -25,6 +26,6 @@
|
||||
<partial name="~/Pages/Content/_PublicContentList.cshtml" model="Model.Items" />
|
||||
}
|
||||
</main>
|
||||
<footer class="site-footer">所有时间和结果以活动正式公告为准。</footer>
|
||||
<partial name="_PublicFooter" />
|
||||
</body>
|
||||
</html>
|
||||
Loaded 3 of 14 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user