Files
yes.blog/Yes.Blog/Areas/Admin/Pages/Theme/Import.cshtml
2025-04-30 09:51:36 +08:00

99 lines
3.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@page
@model Yes.Blog.Areas.Admin.Pages.Theme.ImportModel
@{
}
<div id="urHere">管理中心<b>></b><strong>导入模板</strong> </div>
<div class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
<h3>
<a asp-page="./Index" class="actionBtn add" style="margin-left:10px">模板列表</a>
导入模板
</h3>
<div class="idTabs">
<form method="post" enctype="multipart/form-data">
<div asp-validation-summary="All" class="text-danger"></div>
<table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
<tr>
<td align="right"><label for="ArticleInput.CoverUrl">选择要导入的模板文件</label></td>
<td>
<input type="text" for="ArticleInput.CoverUrl" size="80" class="inpMain" id="CoverUrl" readonly />
<a href="javascript:;" class="a-upload" id="uploadBtn">
<input type="file" name="file" size="18" for="CoverUrl" accept="image/*" />
上传
</a>
<p class="text-danger" id="error-CoverUrl"></p>
<small></small>
</td>
</tr>
<tr>
<td></td>
<td>
<input name="submit" class="btn" type="submit" value="提交" />
</td>
</tr>
</table>
</form>
</div>
</div>
@section Scripts {
<script src="~/admin/js/jquery.tab.js" asp-append-version="true"></script>
<script type="text/javascript" src="~/admin/editor.md/editormd.min.js" asp-append-version="true"></script>
<script src="~/admin/js/qiniu.min.js" asp-append-version="true"></script>
<script type="text/javascript">
$(function () {
var editor = editormd("content-editor", {
// width : "100%",
height: "600",
path: "/admin/editor.md/lib/",
codeFold: true,
htmlDecode: 'iframe|on*', // 开启标签
imageUpload: true,
imageUploadURL: "./data/upload.php?type=editormd",
/*
上传的后台只需要返回一个 JSON 数据,结构如下:
{
success : 0 | 1, // 0 表示上传失败,1 表示上传成功
message : "提示的信息,上传成功或上传失败及错误信息等。",
url : "图片地址" // 上传成功时才返回
}
*/
});
});
$(function () { $(".idTabs").idTabs(); });
$(function () {
$("body").on("change propertychange", "input[type='file']", function (e) {
var id = $(this).attr("for");
var file = e.target.files[0];
if (!file) {
$("#error-" + id).html("文件上传失败!");
return;
}
$("#" + id).val(file.name);
});
});
</script>
}