working on commenting ability

master
Vyacheslav N. Boyko 2017-12-11 17:48:01 +03:00
parent a250ace937
commit ad77b46d26
5 changed files with 59 additions and 35 deletions

View File

@ -174,4 +174,26 @@ img.borderless {
float: left;
color: red;
padding-right: 10px;
}
h1 {
font-size: 30px !important;
}
h2 {
font-size: 24px !important;
}
h3 {
font-size: 18px !important;
}
h4 {
font-size: 16px !important;
}
h5 {
font-size: 14px !important;
}
h6 {
font-size: 12px !important;
}
body {
font: 300 14px "Helvetica Neue",Helvetica, Microsoft Yahei, Hiragino Sans GB, Microsoft Sans Serif, WenQuanYi Micro Hei, sans;
}

View File

@ -1,6 +1,7 @@
hr
form#commentForm.comment-form(action="comments", method="POST")
form#commentForm.comment-form(action="/posts/"+post.getId()+"/comments", method="POST")
.item-row
input(type="hidden", name='_csrf', value='#{_csrf.token}')
.item-row

View File

@ -0,0 +1,26 @@
.load-more
nav
ul.pagination
if page > 1
li.previous
a.btn(href="?page=#{page - 1}")
span(aria-hidden="true") ←
| Older comments
for pageNum in pagesList
if pageNum==page
li.active
a.btn(href="?page=#{pageNum}")
= pageNum
else
li
a.btn(href="?page=#{pageNum}")
= pageNum
if totalPages > page
li.next
a.btn(href="?page=#{page + 1}")
| Newer comments
span(aria-hidden="true") →

View File

@ -1,29 +1,5 @@
.load-more
nav
ul.pagination
if page > 1
li.previous
a.btn(href="?page=#{page - 1}")
span(aria-hidden="true") ←
| Older comments
for pageNum in pagesList
if pageNum==page
li.active
a.btn(href="?page=#{pageNum}")
= pageNum
else
li
a.btn(href="?page=#{pageNum}")
= pageNum
if totalPages > page
li.next
a.btn(href="?page=#{page + 1}")
| Newer comments
span(aria-hidden="true") →
include fragments/pagination
for comment in comments
if comment.getDeletedMark()
@ -31,6 +7,10 @@ for comment in comments
else
include one
include fragments/pagination
if userService.currentUserCanWrite()
include fragments/commentCreationForm

View File

@ -1,22 +1,17 @@
.panel.panel-default
.panel-heading
span #{comment.getUser().getNickname()}, #{viewHelper.getFormattedDate(comment.getCreatedAt())}
span
b #{comment.getUser().getNickname()}
|, #{viewHelper.getFormattedDate(comment.getCreatedAt())}
div
if userService.isCurrentUserAdmin()
.td
admin
| admin
.panel-body
!{comment.getRenderedContent()}
//if userService.currentUserCanWrite()
// div
// = userService.currentUser().getNickname()
// include fragments/commentCreationForm
//if commentService.childrenCount(comments, comment) > 0
// .comment-children(style="padding-left: #{5 * commentService.childrenCount(comments, comment)}px")
// include list