feat: 侧边栏收缩配置项生效
This commit is contained in:
parent
5a91330bf6
commit
c21e3d06c0
|
@ -17,6 +17,7 @@ namespace Bootstrap.Admin.Models
|
|||
Theme = DictHelper.RetrieveActiveTheme();
|
||||
IsDemo = DictHelper.RetrieveSystemModel();
|
||||
ShowCardTitle = DictHelper.RetrieveCardTitleStatus() ? "" : "no-card-header";
|
||||
ShowSideBar = DictHelper.RetrieveSidebarStatus() ? "" : "sidebar-open";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -43,5 +44,10 @@ namespace Bootstrap.Admin.Models
|
|||
/// 是否显示卡片标题
|
||||
/// </summary>
|
||||
public string ShowCardTitle { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否收缩侧边栏
|
||||
/// </summary>
|
||||
public string ShowSideBar { get; protected set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
<div class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="control-label" for="sider">侧边栏设置</label>
|
||||
<input id="sider" hidden type="checkbox" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="展开" data-off="收缩" />
|
||||
<input id="sider" hidden type="checkbox" data-default-val="@Model.ShowSideBar" data-toggle="toggle" data-width="120" data-onstyle="success" data-on="展开" data-off="收缩" />
|
||||
</div>
|
||||
<div class="form-group col-sm-6">
|
||||
<label class="control-label" for="cardTitle">标题设置</label>
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
.breadcrumb {
|
||||
border-top: solid 1px #ddd !important;
|
||||
}
|
||||
|
||||
.sidebar-open .sidebar-toggle-box .fa-bars {
|
||||
transform: rotate(0);
|
||||
}
|
||||
</style>
|
||||
}
|
||||
<div class="content-body welcome-bg">
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
@model ModelBase
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
@ -13,7 +14,7 @@
|
|||
<link href="../css/IE8.css" rel="stylesheet" />
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<body class="@Model.ShowSideBar">
|
||||
<!--[if lt IE 10 ]>
|
||||
<div id="ieAlert" class="alert alert-danger alert-dismissible">
|
||||
<div>当前浏览器版本太低,不支持本系统,请升级到至少IE10 <a href="../browser/IE10.exe" target="_blank">本地下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软下载</a>,或者使用Chrome浏览器 <a href="../browser/ChromeSetup.exe" target="_blank">本地下载</a></div>
|
||||
|
|
|
@ -191,6 +191,12 @@ namespace Bootstrap.DataAccess
|
|||
/// 获得 数据库标题是否显示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool RetrieveCardTitleStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "卡片标题状态" && d.Define == 0)?.Code ?? "") == "1";
|
||||
public bool RetrieveCardTitleStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "卡片标题状态" && d.Define == 0)?.Code ?? "1") == "1";
|
||||
|
||||
/// <summary>
|
||||
/// 获得 是否显示侧边栏 为真时显示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool RetrieveSidebarStatus() => (DictHelper.RetrieveDicts().FirstOrDefault(d => d.Category == "网站设置" && d.Name == "侧边栏状态" && d.Define == 0)?.Code ?? "1") == "1";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,5 +208,11 @@ namespace Bootstrap.DataAccess
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool RetrieveCardTitleStatus() => DbContextManager.Create<Dict>().RetrieveCardTitleStatus();
|
||||
|
||||
/// <summary>
|
||||
/// 获得侧边栏状态 未真时显示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static bool RetrieveSidebarStatus() => DbContextManager.Create<Dict>().RetrieveSidebarStatus();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue