修改BUG:演示模式下禁止更改管理员显示名称 closed #IV93R

#Issue
https://gitee.com/LongbowEnterprise/dashboard/issues?id=IV93R
This commit is contained in:
Argo Zhang 2019-04-12 15:17:35 +08:00
parent b79b8b8d57
commit f68a90db7e
1 changed files with 133 additions and 130 deletions

View File

@ -1,131 +1,134 @@
@model ProfilesModel
@{
ViewBag.Title = "个人中心";
}
@section css {
<environment include="Development">
<link href="~/lib/bootstrap-fileinput/css/fileinput.css" rel="stylesheet" />
</environment>
<environment exclude="Development">
<link href="~/lib/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" />
</environment>
<link href="~/css/tasks.css" rel="stylesheet" asp-append-version="true" />
}
@section javascript {
<environment include="Development">
<script src="~/lib/bootstrap-fileinput/js/fileinput.js"></script>
<script src="~/lib/bootstrap-fileinput/js/locales/zh.js"></script>
<script src="~/lib/bootstrap-fileinput/themes/fa/theme.js"></script>
<script src="~/lib/validate/jquery.validate.js"></script>
<script src="~/lib/validate/localization/messages_zh.js"></script>
</environment>
<environment exclude="Development">
<script src="~/lib/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="~/lib/bootstrap-fileinput/js/locales/zh.min.js"></script>
<script src="~/lib/bootstrap-fileinput/themes/fa/theme.min.js"></script>
<script src="~/lib/validate/jquery.validate.min.js"></script>
<script src="~/lib/validate/localization/messages_zh.min.js"></script>
</environment>
<script src="~/lib/longbow/longbow.dataentity.js" asp-append-version="true"></script>
<script src="~/lib/longbow/longbow.validate.js" asp-append-version="true"></script>
<script src="~/js/profiles.js" asp-append-version="true"></script>
}
<div class="card">
<div class="card-header">基本资料</div>
<div class="card-body" data-toggle="LgbValidate" data-valid-button="#btnSaveDisplayName">
<form class="form-inline">
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="userName">登陆名称</label>
<input type="text" class="form-control ignore" id="userName" name="userName" value="@Model.UserName" readonly />
</div>
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="DisplayName">显示名称</label>
<input type="text" class="form-control" id="displayName" name="displayName" value="@Model.DisplayName" placeholder="不可为空20字以内" maxlength="20" data-valid="true" />
</div>
</div>
</form>
<div class="modal-footer" asp-auth="saveDisplayName">
<button id="btnSaveDisplayName" data-method="user" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">修改密码</div>
<div class="card-body" data-toggle="LgbValidate" data-valid-button="#btnSavePassword">
<div class="alert alert-danger" role="alert" asp-condition="@Model.IsDemo">
<span>演示系统禁止更改管理员密码</span>
</div>
<form class="form-inline">
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="currentPassword">原密码: </label>
<input type="password" class="form-control" id="currentPassword" placeholder="原密码" maxlength="16" data-valid="true" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="newPassword">新密码: </label>
<input type="password" class="form-control" id="newPassword" placeholder="新密码" maxlength="16" data-valid="true" />
</div>
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="confirmPassword">确认密码: </label>
<input type="password" class="form-control" id="confirmPassword" placeholder="与新密码一致" maxlength="16" equalTo="#newPassword" data-valid="true" />
</div>
</div>
</form>
<div class="modal-footer" asp-auth="savePassword" asp-condition="!@Model.IsDemo">
<button id="btnSavePassword" data-method="password" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">默认应用</div>
<div class="card-body">
<div class="form-group">
<div class="btn-group" role="group">
<button id="app" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" data-default-val="" value="@Model.AppCode">未设置</button>
<div class="dropdown-menu">
@foreach (var app in Model.Applications)
{
<a href="#" data-val="@app.Key">@app.Value</a>
}
</div>
</div>
</div>
<div class="modal-footer" asp-auth="saveApp">
<button id="btnSaveApp" data-method="app" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">网站皮肤</div>
<div class="card-body">
<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.Theme">默认样式</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" asp-auth="saveTheme">
<button id="btnSaveCss" data-method="css" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">修改头像</div>
<div class="card-body">
<form enctype="multipart/form-data" asp-auth="saveIcon">
<div class="form-group">
<input id="fileIcon" type="file" data-init="@Model.Size" data-file="@Model.FileName">
</div>
</form>
<img class="card-img d-none" src="@Url.Content(Model.Icon)" />
</div>
@model ProfilesModel
@{
ViewBag.Title = "个人中心";
}
@section css {
<environment include="Development">
<link href="~/lib/bootstrap-fileinput/css/fileinput.css" rel="stylesheet" />
</environment>
<environment exclude="Development">
<link href="~/lib/bootstrap-fileinput/css/fileinput.min.css" rel="stylesheet" />
</environment>
<link href="~/css/tasks.css" rel="stylesheet" asp-append-version="true" />
}
@section javascript {
<environment include="Development">
<script src="~/lib/bootstrap-fileinput/js/fileinput.js"></script>
<script src="~/lib/bootstrap-fileinput/js/locales/zh.js"></script>
<script src="~/lib/bootstrap-fileinput/themes/fa/theme.js"></script>
<script src="~/lib/validate/jquery.validate.js"></script>
<script src="~/lib/validate/localization/messages_zh.js"></script>
</environment>
<environment exclude="Development">
<script src="~/lib/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="~/lib/bootstrap-fileinput/js/locales/zh.min.js"></script>
<script src="~/lib/bootstrap-fileinput/themes/fa/theme.min.js"></script>
<script src="~/lib/validate/jquery.validate.min.js"></script>
<script src="~/lib/validate/localization/messages_zh.min.js"></script>
</environment>
<script src="~/lib/longbow/longbow.dataentity.js" asp-append-version="true"></script>
<script src="~/lib/longbow/longbow.validate.js" asp-append-version="true"></script>
<script src="~/js/profiles.js" asp-append-version="true"></script>
}
<div class="card">
<div class="card-header">基本资料</div>
<div class="card-body" data-toggle="LgbValidate" data-valid-button="#btnSaveDisplayName">
<div class="alert alert-danger" role="alert" asp-condition="@Model.IsDemo">
<span>演示系统禁止更改管理员显示名称</span>
</div>
<form class="form-inline">
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="userName">登陆名称</label>
<input type="text" class="form-control ignore" id="userName" name="userName" value="@Model.UserName" readonly />
</div>
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="DisplayName">显示名称</label>
<input type="text" class="form-control" id="displayName" name="displayName" value="@Model.DisplayName" placeholder="不可为空20字以内" maxlength="20" data-valid="true" />
</div>
</div>
</form>
<div class="modal-footer" asp-auth="saveDisplayName" asp-condition="!@Model.IsDemo">
<button id="btnSaveDisplayName" data-method="user" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">修改密码</div>
<div class="card-body" data-toggle="LgbValidate" data-valid-button="#btnSavePassword">
<div class="alert alert-danger" role="alert" asp-condition="@Model.IsDemo">
<span>演示系统禁止更改管理员密码</span>
</div>
<form class="form-inline">
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="currentPassword">原密码: </label>
<input type="password" class="form-control" id="currentPassword" placeholder="原密码" maxlength="16" data-valid="true" />
</div>
</div>
<div class="row">
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="newPassword">新密码: </label>
<input type="password" class="form-control" id="newPassword" placeholder="新密码" maxlength="16" data-valid="true" />
</div>
<div class="form-group col-sm-6 col-md-auto">
<label class="control-label" for="confirmPassword">确认密码: </label>
<input type="password" class="form-control" id="confirmPassword" placeholder="与新密码一致" maxlength="16" equalTo="#newPassword" data-valid="true" />
</div>
</div>
</form>
<div class="modal-footer" asp-auth="savePassword" asp-condition="!@Model.IsDemo">
<button id="btnSavePassword" data-method="password" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">默认应用</div>
<div class="card-body">
<div class="form-group">
<div class="btn-group" role="group">
<button id="app" class="btn btn-success dropdown-select dropdown-toggle" data-toggle="dropdown" data-default-val="" value="@Model.AppCode">未设置</button>
<div class="dropdown-menu">
@foreach (var app in Model.Applications)
{
<a href="#" data-val="@app.Key">@app.Value</a>
}
</div>
</div>
</div>
<div class="modal-footer" asp-auth="saveApp">
<button id="btnSaveApp" data-method="app" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">网站皮肤</div>
<div class="card-body">
<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.Theme">默认样式</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" asp-auth="saveTheme">
<button id="btnSaveCss" data-method="css" class="btn btn-secondary" type="button"><i class="fa fa-save"></i><span>保存</span></button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">修改头像</div>
<div class="card-body">
<form enctype="multipart/form-data" asp-auth="saveIcon">
<div class="form-group">
<input id="fileIcon" type="file" data-init="@Model.Size" data-file="@Model.FileName">
</div>
</form>
<img class="card-img d-none" src="@Url.Content(Model.Icon)" />
</div>
</div>