refactor: 使用 Css 表示主题

This commit is contained in:
Argo-Tianyi 2021-12-25 16:02:09 +08:00
parent 35339d7ebf
commit 2eced5eadd
2 changed files with 3 additions and 26 deletions

View File

@ -31,7 +31,7 @@ namespace BootstrapAdmin.DataAccess.Models
/// 获得/设置 用户设置样式表名称
/// </summary>
[Display(Name = "主题")]
public string? Theme { get; set; }
public string? Css { get; set; }
/// <summary>
/// 获得/设置 用户默认登陆 App 标识

View File

@ -56,7 +56,7 @@
</AdminAlert>
<div class="row g-3 form-inline">
<div class="col-12 col-sm-6">
<Dropdown Items="Themes" @bind-Value="CurrentUser.Theme" />
<Dropdown Items="Themes" @bind-Value="CurrentUser.Css" />
</div>
<div class="col-12 col-sm-6 text-end">
<Button Icon="fa fa-save" Text="保存" OnClickWithoutRender="OnSaveTheme" />
@ -66,30 +66,7 @@
</div>
@*
<div class="card" asp-auth="saveTheme">
<div class="card-header"></div>
<div class="card-body">
<div class="alert alert-info" role="alert">
<span>注意:本设置将覆盖<b><a class="badge-pill" href="./Settings">网站设置</a></b>中设置的网站样式</span>
</div>
<div class="form-group">
<div class="btn-group" role="group">
<button id="css" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" data-default-val="" value="@Model.Css">默认样式</button>
<div class="dropdown-menu">
<a href="#" data-val="">默认样式</a>
@foreach (var css in Model.Themes)
{
<a href="#" data-val="@css.Code">@css.Name</a>
}
</div>
</div>
</div>
<div class="modal-footer">
<button id="btnSaveCss" data-method="profileCss" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card" asp-auth="saveIcon">
<div class="card-header">修改头像</div>
<div class="card-body">