Skip to content

Commit

Permalink
feat: 回复支持楼层标识
Browse files Browse the repository at this point in the history
  • Loading branch information
yangrunkang committed Jan 19, 2023
1 parent da177d3 commit 521baae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions upupor-web/src/main/resources/static/js/common/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ function comment(contentId,commentSource,desc) {
/**
* 渲染回复用户的名字
*/
function renderReplayUserName(userName,userId) {
function renderReplayUserName(userName,userId,floorNum) {
try {
let replayUser = '[**!!#7D8B99 @'+userName+'!!**](/profile/'+userId+'/content) ';
let replayUser = '[**!!#7D8B99 @'+userName+'!!**](/profile/'+userId+'/content) `'+floorNum+'#`: ';
$.cvSetEditorContent(replayUser);
$("#reply_to_user").val(userId);
//滚动到锚点位置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<span class="lead">评论<span class="badge bg-gradient rounded-3 fw-normal bg-warning text-dark ms-1" th:text="${total}"></span></span>
</div>
<div class="list-group list-group-flush">
<div class="d-flex align-items-top list-group-item p-1 mt-1" th:if="${commentEnhance.comment.commentId != 'google-ad-feed'}" th:each="commentEnhance : ${commentEnhance}">
<div th:id="${'comment_' + commentEnhance.floorNum}" class="d-flex align-items-top list-group-item p-1 mt-1" th:if="${commentEnhance.comment.commentId != 'google-ad-feed'}" th:each="commentEnhance : ${commentEnhance}">
<a class="cv-link" th:href="'/profile/'+${commentEnhance.memberEnhance.member.userId}+'/content'">
<img th:data-src="${commentEnhance.memberEnhance.member.via}" class="lazyload align-self-center me-1 mb-1 cv-icon-50 img rounded" th:alt="${commentEnhance.memberEnhance.member.userName}"/>
</a>
Expand All @@ -80,7 +80,7 @@
</a>
<div class="float-end text-black-50 small">
<span class="d-none d-sm-block float-start text-black-50 ">[[${commentEnhance.createDateDiff}]]&nbsp;·&nbsp;</span>
<span style="cursor: pointer" th:if="${session?.cv_user_id}" th:onclick="renderReplayUserName([[${commentEnhance.memberEnhance.member.userName}]],[[${commentEnhance.memberEnhance.member.userId}]])">回复<i class="bi bi-reply-fill"></i></span>
<span style="cursor: pointer" th:if="${session?.cv_user_id}" th:onclick="renderReplayUserName([[${commentEnhance.memberEnhance.member.userName}]],[[${commentEnhance.memberEnhance.member.userId}]],[[${commentEnhance.floorNum}]])">回复<i class="bi bi-reply-fill"></i></span>
<span style="cursor: pointer" th:if="!${session?.cv_user_id}" th:onclick="window.location.href='/login?back=' + window.location.pathname">回复<i class="bi bi-reply-fill"></i></span>
·&nbsp;<span class="badge bg-gradient bg-light text-black-50" th:text="${commentEnhance.floorNum} + '#'"></span>
</div>
Expand Down

0 comments on commit 521baae

Please sign in to comment.