Skip to content

Commit ba709b1

Browse files
committed
comment
1 parent 9401372 commit ba709b1

15 files changed

Lines changed: 948 additions & 817 deletions

File tree

‎i18n/zh_CN.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
"confirm": "确定",
4343
"preStep": "上一步",
4444
"preArticle": "上一篇",
45+
"prePage": "上一页",
4546
"nextStep": "下一步",
4647
"nextArticle": "下一篇",
48+
"nextPage": "下一页",
4749
"experienceNow": "立即体验",
4850
"pipeUseHacpaiAccount": "Pipe 目前使用黑客派账号体系",
4951
"registerHacpaiAccount": "注册黑客派账号",

‎theme/comment/comment.html‎

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
11
{{define "comment/comment"}}
2-
<section class="comment__item" id="comment{{.Item.ID}}">
2+
<section class="pipe-comment__item" id="pipeComment{{.Item.ID}}">
33
<a rel="nofollow"
4-
class="avatar fn-absolute"
4+
class="pipe-comment__avatar"
55
data-src="{{.Item.Author.AvatarURL}}"
66
href="{{.Item.Author.URL}}">
77
</a>
8-
<div class="fn-padding60">
9-
<div>
10-
<a href="{{.Item.Author.AvatarURL}}" class="module__list-title">{{.Item.Author.Name}}</a>
8+
<div class="pipe-comment__body">
9+
<div class="fn-clear">
10+
<a href="{{.Item.Author.AvatarURL}}" class="ft-gray">{{.Item.Author.Name}}</a>
1111
<span class="ft-nowrap ft-12 ft-fade"> • {{.Item.CreatedAt}} •</span>
1212
<a class="ft-nowrap ft-12 ft-gray" href="#123">
1313
<svg><use xlink:href="#reply"></use></svg>{{.I18n.Reply}} Vanessa
1414
</a>
15-
<span class="comment__btn commentAdd"
16-
data-title="{{.I18n.Reply}}{{.I18n.Colon}}{{.Item.Author.Name}}"
17-
data-id="{{.ArticleID}}"
18-
data-commentid="{{.Item.ID}}">
19-
{{.I18n.Reply}} <svg><use xlink:href="#comment"></use></svg>
20-
</span>
21-
{{if .Item.Removable}}
22-
<span class="comment__btn commentDelete"
23-
data-id="{{.Item.ID}}"
24-
data-label="{{.I18n.ConfirmDelete}}"
25-
data-label2="{{.I18n.StayStep}}">
26-
<svg><use xlink:href="#remove"></use></svg>
27-
</span>
28-
{{end}}
15+
<div class="fn-right">
16+
<button class="btn"
17+
data-title="{{.I18n.Reply}}{{.I18n.Colon}}{{.Item.Author.Name}}"
18+
data-id="{{.ArticleID}}"
19+
data-commentid="{{.Item.ID}}">
20+
{{.I18n.Reply}} <svg class="fn-right"><use xlink:href="#comment"></use></svg>
21+
</button>
22+
<button class="btn btn--danger btn--space"
23+
data-id="{{.Item.ID}}"
24+
data-label="{{.I18n.ConfirmDelete}}"
25+
data-label2="{{.I18n.StayStep}}">
26+
{{.I18n.Delete}} <svg class="fn-right"><use xlink:href="#remove"></use></svg>
27+
</button>
28+
{{if .Item.Removable}}
29+
<span class="btn"
30+
data-id="{{.Item.ID}}"
31+
data-label="{{.I18n.ConfirmDelete}}"
32+
data-label2="{{.I18n.StayStep}}">
33+
<svg><use xlink:href="#remove"></use></svg>
34+
</span>
35+
{{end}}
36+
</div>
2937
</div>
3038
<div class="content__reset">
3139
{{.Item.Content}}

‎theme/comment/comments.html‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
{{define "comment/comments"}}
22
{{if gt (len .Comments) 0}}
3-
<div id="comments">
4-
<div class="module__header">
5-
<span id="commentsCnt">{{len $.Comments}}</span> {{$.I18n.Comment}}
3+
<div id="pipeComments" class="fn-clear">
4+
<div class="pipe-comment__header">
5+
<span id="pipeCommentsCnt">{{len $.Comments}}</span> {{$.I18n.Comment}}
66
</div>
77
<div>
88
{{range .Comments}}
99
{{template "comment/comment" dict "Item" . "I18n" $.I18n "Username" $.User.UName "ArticleID" $.Article.ID}}
1010
{{end}}
1111
</div>
1212
{{if $.Pagination}}
13-
<nav class="comment__pagination">
13+
<nav class="pipe-comment__pagination fn-right">
1414
{{range $.Pagination.PageNums}}
1515
{{if eq . -1}}
16-
<a href="{{$.Pagination.PageURL}}{{$.Pagination.PreviousPageNum}}">
17-
<svg><use xlink:href="#chevron-left"></use></svg>
16+
<a class="btn fn-left" href="{{$.Pagination.PageURL}}{{$.Pagination.PreviousPageNum}}">
17+
<svg class="fn-left"><use xlink:href="#chevron-left"></use></svg> {{$.I18n.prePage}}
1818
</a>
1919
{{else if eq . -2}}
20-
<a href="{{$.Pagination.PageURL}}{{$.Pagination.NextPageNum}}">
21-
<svg><use xlink:href="#chevron-right"></use></svg>
20+
<a class="btn btn--space fn-left" href="{{$.Pagination.PageURL}}{{$.Pagination.NextPageNum}}">
21+
{{$.I18n.nextPage}} <svg class="fn-right"><use xlink:href="#chevron-right"></use></svg>
2222
</a>
2323
{{end}}
2424
{{end}}
2525
</nav>
2626
{{end}}
2727
</div>
2828
{{else}}
29-
<div class="{{if ne (len .RelevantArticles) 0}}fn-bottom{{end}} ft-center comment__null"
29+
<div class="pipe-comment__null fn-clear"
3030
data-title="{{.I18n.Comment}}{{.I18n.Colon}}{{.Article.Title}}"
3131
data-id="{{.Article.ID}}"
32-
id="comments">
32+
id="pipeComments">
3333
{{.I18n.StayStep}}
3434
<svg>
3535
<use xlink:href="#comment"></use>

‎theme/comment/editor.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
</div>
2424
<textarea id="pipeEditorComment" data-blogurl="{{.BlogURL}}" placeholder="{{.I18n.CommentPlaceholder}}" rows="3"></textarea>
2525
<div class="fn-clear">
26-
<span class="fn-right btn btn--space btn--green"
26+
<span class="fn-right btn btn--space btn--success"
2727
id="pipeEditorAdd"
2828
data-label2="{{.I18n.Required}}"
2929
data-label="{{.I18n.Comment}}">

0 commit comments

Comments
 (0)