mirror of
https://github.com/Kakune55/ComiPy.git
synced 2025-09-15 11:49:47 +08:00
feat:添加评论上传功能 未完全完成
This commit is contained in:
@@ -72,6 +72,36 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="exampleModalLabel">评论</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="comment" action="/api/comment/upload" method="post">
|
||||
<select class="form-select" aria-label="Default select example" name="score">
|
||||
<option value="none">无评价</option>
|
||||
<option value="like">赞👍</option>
|
||||
<option value="dislike">踩👎</option>
|
||||
</select>
|
||||
<div class="input-group" style="margin-top: 10px;" >
|
||||
<span class="input-group-text">评论</span>
|
||||
<textarea class="form-control" name="text" aria-label="With textarea"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="bookid" value="{{data[0][1]}}"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">取消</button>
|
||||
<button type="button" class="btn btn-primary" onclick="commentSubmit()">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<div class="movie-poster">
|
||||
@@ -81,24 +111,51 @@
|
||||
<div class="movie-details">
|
||||
<!-- 详细信息 -->
|
||||
<h1>{{ data[0][2] }}</h1>
|
||||
<h2>时间: {{time}}</h2>
|
||||
<h2>暂无评价</h2>
|
||||
<h3>更新时间: {{time}}</h3>
|
||||
<h2>👍{{socre["like"]}} 👎{{socre["dislike"]}}</h2>
|
||||
<button class="btn btn-primary" onclick="window.location.href='/view/{{ id }}'">在线浏览</button>
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">撰写评论</button>
|
||||
<button class="btn btn-danger">删除资源</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="container">
|
||||
<div class="comments-section">
|
||||
<h2>评论区</h2>
|
||||
<!-- 评论 -->
|
||||
{% if not comments%}
|
||||
<p>暂无评论</p>
|
||||
{%endif%}
|
||||
{% for item in comments %}
|
||||
<div class="comment">
|
||||
<p>用户A:Lorem ipsum dolor sit amet consectetur adipisicing elit. Nobis, quam!</p>
|
||||
</div>
|
||||
<div class="comment">
|
||||
<p>用户B:Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aut sunt tempore architecto minus, cum
|
||||
mollitia voluptatibus repellendus aliquid id reprehenderit.</p>
|
||||
<h3>{{item["from"]}}:
|
||||
{%if item["socre"] == "like"%}
|
||||
<small class="text-muted">觉得很赞👍</small>
|
||||
{%endif%}
|
||||
{%if item["socre"] == "dislike"%}
|
||||
<small class="text-muted">点了个踩👎</small>
|
||||
{%endif%}
|
||||
</h3>
|
||||
<h3>{{item["text"]}}</h3>
|
||||
<small class="text-muted">id:{{item["id"]}} {{item["time"]}}</small>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<!-- 在此添加更多评论 -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
const comment = document.getElementById("comment")
|
||||
function commentSubmit(){
|
||||
comment.submit()
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -50,7 +50,7 @@
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
/* 模糊度可以根据需要调整 */
|
||||
transition: display;
|
||||
z-index: 1;
|
||||
z-index: 10;
|
||||
/* 保证遮罩在页面上方 */
|
||||
pointer-events: none;
|
||||
/* 确保遮罩不影响下方元素的交互 */
|
||||
@@ -61,10 +61,20 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="search_text" placeholder="键入以搜索">
|
||||
<button class="btn btn-secondary" type="button"
|
||||
onclick="window.location.href='/overview/1?search='+document.getElementById('search_text').value">Search</button>
|
||||
<div style="display: flex;">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="search_text" placeholder="键入以搜索">
|
||||
<button class="btn btn-secondary" type="button"
|
||||
onclick="window.location.href='/overview/1?search='+document.getElementById('search_text').value">Search</button>
|
||||
</div>
|
||||
<div class="dropdown" style="margin-left: 10px;">
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{username}}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><button class="dropdown-item" href="#" onclick="logout()">Log out</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div id="gallery">
|
||||
@@ -98,6 +108,9 @@
|
||||
|
||||
<div id="global-blur" onclick="unshow_global_blur()"></div>
|
||||
|
||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script>
|
||||
function linkjump(url) {
|
||||
window.open("/book/" + url)
|
||||
@@ -124,6 +137,11 @@
|
||||
global_blur.style.pointerEvents = "none";
|
||||
}
|
||||
|
||||
function logout() {
|
||||
document.cookie = "islogin=1; max-age=0"
|
||||
//location.href = "/";
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/popper.min.js"></script>
|
||||
<script src="https://unpkg.com/@popperjs/core@2"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
|
||||
<script>
|
||||
|
@@ -58,7 +58,7 @@
|
||||
<img data-src="/api/img/{{ id }}/{{ i }}" loading="lazy" alt="{{ i }}" class="imgs">
|
||||
{% endfor %}
|
||||
<div style="display:flex;justify-content: center; align-items:center;">
|
||||
<img src="/static/loading.gif" id="loadingGIF">
|
||||
<h1>已经到底了哦</h1>
|
||||
</div>
|
||||
<div id="global-blur" onclick="unshow_global_blur()"></div>
|
||||
<script>
|
||||
|
Reference in New Issue
Block a user