125 lines
6.1 KiB
HTML
125 lines
6.1 KiB
HTML
<!doctype html>
|
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
<title>资源-Quinn</title>
|
|
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}">
|
|
<link rel="stylesheet" th:href="@{/wangedit/css/wang.style.css}"/>
|
|
</head>
|
|
<body style="background: #f2f2f2;">
|
|
<main role="main" class="container mt-3 p-3 bg-white rounded">
|
|
<div class="row">
|
|
<div class="col-md-12 blog-main">
|
|
<div class="col-md-12 order-md-1">
|
|
<h4 class="mb-3">发布新资源</h4>
|
|
|
|
<form class="needs-validation" th:action="@{/tracy/mcgrady/lmq/love/wn}" enctype="multipart/form-data" method="post">
|
|
<!-- 隐藏域 -->
|
|
<!-- <input type="hidden" name="authorId" th:value="${session.loginUser.getUid()}">-->
|
|
<!-- <input type="hidden" name="authorName" th:value="${session.loginUser.getUsername()}">-->
|
|
<!-- <input type="hidden" name="authorAvatar" th:value="${session.loginUser.getAvatar()}">-->
|
|
|
|
<div class="form-row">
|
|
<div class="form-group col-md-8">
|
|
<label for="title">资源标题</label>
|
|
<input type="text" name="title" class="form-control" id="title" value="" required>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4">
|
|
<label for="enName">英文名</label>
|
|
<input type="text" name="enName" class="form-control" id="enName" value="" required>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4">
|
|
<label for="sType">资源标签</label>
|
|
<select name="categoryId" class="custom-select d-block w-100" id="sType">
|
|
<option th:each="category:${categoryList}"
|
|
th:value="${category.getId()}" th:text="${category.getCategory()}">
|
|
</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group col-md-4">
|
|
<label for="keyWords">摘要</label>
|
|
<input type="text" name="keyWords" class="form-control" id="keyWords" value="" required>
|
|
</div>
|
|
|
|
<div id="uploadPassWordDiv" class="form-group col-md-4">
|
|
<label for="uploadPassWord">管理员密码(*重要*)</label>
|
|
<input type="text" class="form-control" id="uploadPassWord" name="uploadPassWord" required />
|
|
</div>
|
|
|
|
<div class="form-group col-md-12">
|
|
<label for="subContent">简介</label>
|
|
<textarea name="subContent" class="form-control" id="subContent" required></textarea>
|
|
</div>
|
|
|
|
<div class="form-group col-md-6">
|
|
<label for="sourceType">下载方式</label>
|
|
<select name="sourceType" class="custom-select d-block w-100" id="sourceType" required>
|
|
<option value="">请选择...</option>
|
|
<option value="BAIDU">百度云</option>
|
|
<option value="OSS" >服务器</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div id="baiduSourceTypeDiv" style="display: none" class="form-group col-md-6">
|
|
<label for="sourceLink">百度云URL</label>
|
|
<input type="text" name="sourceLink" class="form-control" id="sourceLink" />
|
|
</div>
|
|
|
|
<div id="uploadData" style="display: none" class="form-group col-md-12">
|
|
<label for="toUploadFile" style="color: darkgreen">穷~文件请不要大于20M,否则会报错</label>
|
|
<input type="file" id="toUploadFile" class="btn" name="file" value="请选择文件" />
|
|
</div>
|
|
|
|
<div class="col-md-12 mb-3">
|
|
<hr/>
|
|
<div id="blog-content">
|
|
<div id="editor-toolbar"></div>
|
|
<div id="editor-text-area" style="height: 400px;border: 1px solid lightgrey"></div>
|
|
<textarea id="content-textarea" name="content" style="display: none;"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-primary btn-lg btn-block" type="submit" onclick="this.disabled=true; this.form.submit();">发布资源</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<a class="to-top">返回顶部</a>
|
|
<script th:src="@{/js/jquery-3.5.1.min.js}"></script>
|
|
<script th:src="@{/bootstrap/js/bootstrap.bundle.min.js}"></script>
|
|
<script th:src="@{/js/toTop.js}"></script>
|
|
<script th:src="@{/js/jquery-ui.min.js}"></script>
|
|
<script th:src="@{/live/js/addlive2d.js}"></script>
|
|
|
|
<script th:src="@{/wangedit/js/wang.min.js}"></script>
|
|
<script th:src="@{/wangedit/js/wang.init.js}"></script>
|
|
<script th:src="@{/layer/layer.js}"></script>
|
|
<script th:src="@{/js/axios.js}"></script>
|
|
<script type="text/javascript">
|
|
$("#sourceType").change(function(){
|
|
const jSourceType = $('#sourceType').val();
|
|
if (jSourceType == 'BAIDU') {
|
|
$("#uploadData").hide();
|
|
$("#baiduSourceTypeDiv").show();
|
|
}
|
|
if (jSourceType == 'OSS') {
|
|
$("#baiduSourceTypeDiv").hide();
|
|
$("#uploadData").show();
|
|
}
|
|
if (jSourceType != 'OSS' && jSourceType != 'BAIDU'){
|
|
$("#baiduSourceTypeDiv").hide();
|
|
$("#uploadData").hide();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|