demo20230512/Areas/admin/Views/Account/WebSiteInfoSet.cshtml

160 lines
7.6 KiB
Plaintext
Raw Normal View History

2023-05-12 10:20:28 +08:00
@using Resources
@model Weee.Areas.Admin.ViewModels.AccountWebSiteInfoSetViewModel
@{
ViewBag.Title = "WebSite Info Set";
Layout = "~/Areas/Admin/Views/Shared/_AdminLayout.cshtml";
}
<div class="col-md-12">
<h2>@Resource.WebSiteInfoSet</h2>
@if (TempData["SuccessMsg"] != null)
{<div class="alert alert-info" role="alert">@TempData["SuccessMsg"]</div>}
@if (TempData["ErrorMsg"] != null)
{<div class="alert alert-danger" role="alert">@TempData["ErrorMsg"]</div>}
<hr />
<div class="col-md-1"></div>
<div class="col-md-10">
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.ID)
<div class="form-group">
@Html.LabelFor(m => m.footerAddress, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.footerAddress, new { htmlAttributes = new { @class = "form-control", maxlength = "50" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.footerPhone, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.footerPhone, new { htmlAttributes = new { @class = "form-control", maxlength = "20" } })
@Html.ValidationMessageFor(model => model.footerPhone)
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.footerFax, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.footerFax, new { htmlAttributes = new { @class = "form-control", maxlength = "20" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.footerEmail, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.footerEmail, new { htmlAttributes = new { @type = "email", @class = "form-control", maxlength = "50" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.footerCopyright, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.footerCopyright, new { htmlAttributes = new { @class = "form-control", maxlength = "30" } })
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.text1welcome, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.text1welcome, new { htmlAttributes = new { @class = "form-control", maxlength = "20" } })
(ex: Welcome to)
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.text2Qcarbon, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.text2Qcarbon, new { htmlAttributes = new { @class = "form-control", maxlength = "20" } })
(ex: Q-Carbon!)
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.loginImageStyle, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.EditorFor(m => m.loginImageStyle, new { htmlAttributes = new { @class = "form-control", maxlength = "50" } })
(ex: width: 600px; height: 600px; margin: 50px;)
</div>
</div>
<div class="form-group">
@Html.LabelFor(m => m.loginImageBackGroundColor, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
@Html.TextBoxFor(m => m.loginImageBackGroundColor, new { @class = "form-control", pattern = @"^#[A-Fa-f0-9]{6}" })
(ex: #aaBB56)
</div>
</div>
<div class="form-group" style="padding-top: 10px;">
<div class="col-md-offset-3 col-md-9 text-right">
<input type="submit" value="@Resource.StaticLabelGlobal_Save" class="btn btn-default" />
</div>
</div>
</div>
}
@if (Model.ID > 0)
{
<hr />
<div class="form-horizontal">
<div class="form-group">
@Html.LabelFor(m => m.loginImagePath, new { @class = "control-label docs-control-label col-xs-3" })
<div class="col-xs-9">
<button class="btn btn-default" id="upload-button-1" onclick="showModel()">上傳底圖</button>
@if (!string.IsNullOrWhiteSpace(Model.loginImagePath))
{
<img src="~/Browser_Local/WebFilesRoot/WebSiteInfo/@(Model.loginImagePath)" style="width:150px;padding-left:10px" />
<input class="btn btn-default" type="button" value="刪除圖片" onclick="delSiteImg()" />
}
</div>
</div>
</div>
<hr />
}
</div>
</div>
@using (Html.BeginForm("DelSiteImg", "Account", FormMethod.Post, new {id = "form_delSiteImg"})){}
@using (Html.BeginForm("UploadImg", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="table_edit_wrap transition show_table_edit" id="file-upload-img" style="display: none; width: 100%; height: calc(100vh + 150px); background-color: rgb(128,128,128, 0.6); position: fixed; z-index: 1001;margin-top: -150px">
<div>
<div class="edit_form" style="z-index: 1001; position: fixed; margin: auto; left: 0; right: 0; top: 30%; background-color: #eeeeee; width: 500px; border: 1px solid #bbb; border-radius: 5px; padding-bottom: 20px; box-shadow: 1px 1px 1px 1px #ddd; height: 140px;">
<div style="float:right;margin: 10px 10px;cursor: pointer;" onclick="cancel()">
<img src="@ViewBag.baseUrl/Browser_Local/img/header_image7_1.png" alt="close" />
</div>
<div id="upload-file-result-msg" style="padding: 20px 0 10px 10px;">上傳圖片:</div>
<div style="margin-left: 30px;">
<input id="fileUpload" type="file" accept="image/*" name="uploadedFile" required />
<input type="submit" value="@Resource.StaticLabelImport" class="btn btn-default" />
</div>
<p style="color:red;margin-top: 0;margin-left:28px;">支持的文件類型jpg, png, svg, gif</p>
</div>
</div>
</div>
}
<script>
function showModel() {
var model = document.getElementById("file-upload-img");
model.style.display = "block";
}
function cancel() {
let box = document.getElementById('file-upload-img');
box.style.display = 'none';
}
function delSiteImg() {
document.getElementById("form_delSiteImg").submit();
}
</script>