Skip to content

Commit 5f88816

Browse files
committed
comments html/css refactoring
1 parent 2c1d746 commit 5f88816

3 files changed

Lines changed: 31 additions & 6 deletions

File tree

src/main/webapp/WEB-INF/templates/fragments/comments.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99
<body>
1010
<th:block th:fragment="commentList">
1111
<div class="comment" th:attr="data-commentId=${comment.id}" th:each="comment : ${comments}">
12-
<a th:unless="${comment.deleted}" class="comment-title" th:href="@{|/users/${comment.user.username}|}" th:text="${comment.user.username}"></a>
13-
<span th:if="${comment.deleted}" class="deleted">[deleted]</span>
12+
<div class="comment-header">
13+
<th:block th:unless="${comment.deleted}">
14+
<a class="avatar" th:href="@{|/users/${comment.user.username}|}">
15+
<img class="img-rounded" src="http://i.imgur.com/ecaVXWH.jpg"/>
16+
</a>
17+
<a class="comment-username" th:href="@{|/users/${comment.user.username}|}" th:text="${comment.user.username}"></a>
18+
</th:block>
19+
<span th:if="${comment.deleted}" class="deleted">[deleted]</span>
1420

15-
<span class="post-date" th:text="${#temporals.format(comment.dateTime, 'MMM dd, yyyy HH:mm')}"></span>
21+
<span class="post-date" th:text="${#temporals.format(comment.dateTime, 'MMM dd, yyyy HH:mm')}"></span>
22+
</div>
1623

1724
<div>
1825
<div class="comment-content" th:classappend="${comment.deleted} ? 'deleted'" th:utext="${comment.deleted} ? '[deleted]' : ${comment.getCommentTextHtml()}"></div>

src/main/webapp/WEB-INF/templates/profile.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<div class="col-sm-3 no-padding-col profile-info">
2020
<h3 th:text="${user.username}"></h3>
2121

22-
<div class="avatar">
22+
<div class="avatar-big">
2323
<img class="img-responsive img-rounded" src="http://i.imgur.com/ecaVXWH.jpg"/>
2424
</div>
2525

src/main/webapp/css/blog.css

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,28 @@ label.error {
130130
.comments {
131131
}
132132

133-
.comment-title {
133+
.avatar {
134+
margin-right: 10px;
135+
}
136+
137+
.avatar img {
138+
width: 28px;
139+
height: 28px;
140+
}
141+
142+
.comment-username {
134143
font-weight: bold;
135144
color: #369;
136145
margin-right: 10px;
146+
vertical-align: middle;
147+
}
148+
149+
.comment-header .post-date {
150+
vertical-align: middle;
151+
}
152+
153+
.comment-header {
154+
margin-bottom: 10px;
137155
}
138156

139157
.comment {
@@ -169,7 +187,7 @@ label.error {
169187
font-weight: bold;
170188
}
171189

172-
.avatar {
190+
.avatar-big {
173191
margin-top: 15px;
174192
margin-bottom: 15px;
175193
}

0 commit comments

Comments
 (0)