Skip to content

Commit c97e988

Browse files
Sorienmrsdizzie
andauthored
Prettify Timeline (#10972)
Co-authored-by: mrsdizzie <[email protected]>
1 parent bc362ea commit c97e988

File tree

9 files changed

+296
-216
lines changed

9 files changed

+296
-216
lines changed

integrations/issue_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func testNewIssue(t *testing.T, session *TestSession, user, repo, title, content
139139
htmlDoc = NewHTMLParser(t, resp.Body)
140140
val := htmlDoc.doc.Find("#issue-title").Text()
141141
assert.Equal(t, title, val)
142-
val = htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").First().Text()
142+
val = htmlDoc.doc.Find(".comment .render-content p").First().Text()
143143
assert.Equal(t, content, val)
144144

145145
return issueURL
@@ -154,7 +154,7 @@ func testIssueAddComment(t *testing.T, session *TestSession, issueURL, content,
154154
link, exists := htmlDoc.doc.Find("#comment-form").Attr("action")
155155
assert.True(t, exists, "The template has changed")
156156

157-
commentCount := htmlDoc.doc.Find(".comment-list .comments .comment .render-content").Length()
157+
commentCount := htmlDoc.doc.Find(".comment-list .comment .render-content").Length()
158158

159159
req = NewRequestWithValues(t, "POST", link, map[string]string{
160160
"_csrf": htmlDoc.GetCSRF(),
@@ -168,10 +168,10 @@ func testIssueAddComment(t *testing.T, session *TestSession, issueURL, content,
168168

169169
htmlDoc = NewHTMLParser(t, resp.Body)
170170

171-
val := htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").Eq(commentCount).Text()
171+
val := htmlDoc.doc.Find(".comment-list .comment .render-content p").Eq(commentCount).Text()
172172
assert.Equal(t, content, val)
173173

174-
idAttr, has := htmlDoc.doc.Find(".comment-list .comments .comment").Eq(commentCount).Attr("id")
174+
idAttr, has := htmlDoc.doc.Find(".comment-list .comment").Eq(commentCount).Attr("id")
175175
idStr := idAttr[strings.LastIndexByte(idAttr, '-')+1:]
176176
assert.True(t, has)
177177
id, err := strconv.Atoi(idStr)
@@ -197,7 +197,7 @@ func TestIssueCommentClose(t *testing.T) {
197197
req := NewRequest(t, "GET", issueURL)
198198
resp := session.MakeRequest(t, req, http.StatusOK)
199199
htmlDoc := NewHTMLParser(t, resp.Body)
200-
val := htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").First().Text()
200+
val := htmlDoc.doc.Find(".comment-list .comment .render-content p").First().Text()
201201
assert.Equal(t, "Description", val)
202202
}
203203

integrations/pull_create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ func TestPullCreate_TitleEscape(t *testing.T) {
9898
req = NewRequest(t, "GET", url)
9999
resp = session.MakeRequest(t, req, http.StatusOK)
100100
htmlDoc = NewHTMLParser(t, resp.Body)
101-
titleHTML, err := htmlDoc.doc.Find(".comments .event .text b").First().Html()
101+
titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").First().Html()
102102
assert.NoError(t, err)
103103
assert.Equal(t, "<strike>&lt;i&gt;XSS PR&lt;/i&gt;</strike>", titleHTML)
104-
titleHTML, err = htmlDoc.doc.Find(".comments .event .text b").Next().Html()
104+
titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").Next().Html()
105105
assert.NoError(t, err)
106106
assert.Equal(t, "&lt;u&gt;XSS PR&lt;/u&gt;", titleHTML)
107107
})

integrations/pull_merge_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func testPullCleanUp(t *testing.T, session *TestSession, user, repo, pullnum str
4949

5050
// Click the little green button to create a pull
5151
htmlDoc := NewHTMLParser(t, resp.Body)
52-
link, exists := htmlDoc.doc.Find(".comments .merge .delete-button").Attr("data-url")
52+
link, exists := htmlDoc.doc.Find(".timeline-item .delete-button").Attr("data-url")
5353
assert.True(t, exists, "The template has changed")
5454
req = NewRequestWithValues(t, "POST", link, map[string]string{
5555
"_csrf": htmlDoc.GetCSRF(),

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,7 @@ issues.review.self.approval = You cannot approve your own pull request.
10531053
issues.review.self.rejection = You cannot request changes on your own pull request.
10541054
issues.review.approve = "approved these changes %s"
10551055
issues.review.comment = "reviewed %s"
1056+
issues.review.left_comment = left a comment
10561057
issues.review.content.empty = You need to leave a comment indicating the requested change(s).
10571058
issues.review.reject = "requested changes %s"
10581059
issues.review.wait = "was requested for review %s"

templates/repo/issue/view_content.tmpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
1212
<div class="twelve wide column comment-list prevent-before-timeline">
13-
<ui class="ui comments timeline-line">
14-
<div id="{{.Issue.HashTag}}" class="comment">
13+
<ui class="ui timeline">
14+
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
1515
{{if .Issue.OriginalAuthor }}
16-
<span class="avatar"><img src="/img/avatar_default.png"></span>
16+
<span class="timeline-avatar"><img src="/img/avatar_default.png"></span>
1717
{{else}}
18-
<a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
18+
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
1919
<img src="{{.Issue.Poster.RelAvatarLink}}">
2020
</a>
2121
{{end}}
@@ -67,8 +67,8 @@
6767
{{end}}
6868
{{if .IsSigned}}
6969
{{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
70-
<div class="comment form">
71-
<a class="avatar" href="{{.SignedUser.HomeLink}}">
70+
<div class="timeline-item comment form">
71+
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
7272
<img src="{{.SignedUser.RelAvatarLink}}">
7373
</a>
7474
<div class="content">
@@ -116,8 +116,8 @@
116116
{{else}}
117117
{{if .IsSigned}}
118118
{{if .Repository.IsArchived}}
119-
<div class="comment form">
120-
<a class="avatar" href="{{.SignedUser.HomeLink}}">
119+
<div class="timeline-item comment form">
120+
<a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
121121
<img src="{{.SignedUser.RelAvatarLink}}">
122122
</a>
123123
<div class="content">

0 commit comments

Comments
 (0)