资源下载链路打通

This commit is contained in:
limqhz
2022-05-03 17:15:54 +08:00
parent f44f36356d
commit f271221d8b
39 changed files with 888 additions and 312 deletions

View File

@@ -0,0 +1,125 @@
<!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}">
<style>
.nav-underline .nav-link {
padding-top: .75rem;
padding-bottom: .75rem;
font-size: .875rem;
color: #6c757d;
}
</style>
</head>
<body style="background: #f2f2f2;">
<!-- 导航栏 -->
<div th:replace="~{common/header::header(activeUrl='source')}"></div>
<main role="main" class="container mt-3 p-3 bg-white rounded">
<div class="row">
<div class="col-md-12 source-main">
<div class="source-post">
<h2 class="source-post-title" th:text="${source.getSourceName()}"></h2>
<p class="source-post-meta">
上传时间:
<span th:text="${#dates.format(source.getGmtUpdate(),'yyyy-MM-dd')}"></span>
类别-
<span th:text="${source.getCategoryName()}"></span>
<a th:href="@{'/source/download/' + ${source.getId()}}" class="btn btn-outline-success col-md-2 float-right">下载</a>
</p>
</div>
<hr style="margin-top: 18px">
<!--文章主体内容-->
<div id="doc-content">
<textarea th:text="${source.getSourceContent()}" style="display:none;" placeholder="markdown"></textarea>
</div>
</div>
<div class="col-md-12 source-main" style="margin-top: 20px">
<hr>
</div>
<div class="col-md-12 source-main" style="margin-top: 20px">
<form th:action="@{'/source/comment/'+${source.getId()}}" method="post">
<input type="hidden" name="userId" th:value="${session.loginUser.getUid()}">
<input type="hidden" name="userName" th:value="${session.loginUser.getUsername()}">
<input type="hidden" name="userAvatar" th:value="${session.loginUser.getAvatar()}">
<input type="hidden" name="topicId" th:value="${source.getId()}">
<div class="form-group">
<textarea name="content" class="form-control" rows="3" required></textarea>
</div>
<button type="submit" class="btn btn-primary float-right">提交评论</button>
</form>
</div>
<div th:if="${commentList.size()!=0}" class="col-md-12 source-main" style="margin-top: 20px">
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom border-gray pb-2 mb-0">评论列表</h6>
<div th:each="comment:${commentList}" class="media text-muted pt-3">
<img th:src="${comment.getUserAvatar()}" style="border-radius: 5px;margin-right: 5px " width="32" height="32">
<p class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<strong class="d-block text-gray-dark" th:text="${comment.getUserName()}"></strong>
<span th:text="${comment.getContent()}"></span>
<span th:text="${#dates.format(comment.getGmtCreate(),'yyyy-MM-dd')}" class="badge badge-light float-right"></span>
</p>
</div>
</div>
</div>
<div th:if="${commentList.size()==0}" class="col-md-12 source-main" style="margin-top: 20px">
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="pb-2 mb-0 text-center">emmm... 这里暂时还没有评论....</h6>
</div>
</div>
</div>
</main>
<div th:replace="~{common/footer::footer}"></div>
<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>
<link rel="stylesheet" th:href="@{/editormd/css/editormd.preview.css}" />
<script th:src="@{/editormd/lib/marked.min.js}"></script>
<script th:src="@{/editormd/lib/prettify.min.js}"></script>
<script th:src="@{/editormd/lib/raphael.min.js}"></script>
<script th:src="@{/editormd/lib/underscore.min.js}"></script>
<script th:src="@{/editormd/lib/sequence-diagram.min.js}"></script>
<script th:src="@{/editormd/lib/flowchart.min.js}"></script>
<script th:src="@{/editormd/lib/jquery.flowchart.min.js}"></script>
<script th:src="@{/editormd/editormd.js}"></script>
<script type="text/javascript">
var testEditor;
$(function () {
testEditor = editormd.markdownToHTML("doc-content", {//注意这里是上面DIV的id
htmlDecode: "style,script,iframe",
emoji: true,
taskList: true,
tocm: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true, // 默认不解析
codeFold: true
});});
</script>
</body>
</html>