Prettify Timeline (#10972)

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
tokarchuk/v1.17
Sorien 5 years ago committed by GitHub
parent bc362ea3c6
commit c97e988380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      integrations/issue_test.go
  2. 4
      integrations/pull_create_test.go
  3. 2
      integrations/pull_merge_test.go
  4. 1
      options/locale/locale_en-US.ini
  5. 16
      templates/repo/issue/view_content.tmpl
  6. 136
      templates/repo/issue/view_content/comments.tmpl
  7. 4
      templates/repo/issue/view_content/pull.tmpl
  8. 169
      web_src/less/_repository.less
  9. 18
      web_src/less/themes/theme-arc-green.less

@ -139,7 +139,7 @@ func testNewIssue(t *testing.T, session *TestSession, user, repo, title, content
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
val := htmlDoc.doc.Find("#issue-title").Text() val := htmlDoc.doc.Find("#issue-title").Text()
assert.Equal(t, title, val) assert.Equal(t, title, val)
val = htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").First().Text() val = htmlDoc.doc.Find(".comment .render-content p").First().Text()
assert.Equal(t, content, val) assert.Equal(t, content, val)
return issueURL return issueURL
@ -154,7 +154,7 @@ func testIssueAddComment(t *testing.T, session *TestSession, issueURL, content,
link, exists := htmlDoc.doc.Find("#comment-form").Attr("action") link, exists := htmlDoc.doc.Find("#comment-form").Attr("action")
assert.True(t, exists, "The template has changed") assert.True(t, exists, "The template has changed")
commentCount := htmlDoc.doc.Find(".comment-list .comments .comment .render-content").Length() commentCount := htmlDoc.doc.Find(".comment-list .comment .render-content").Length()
req = NewRequestWithValues(t, "POST", link, map[string]string{ req = NewRequestWithValues(t, "POST", link, map[string]string{
"_csrf": htmlDoc.GetCSRF(), "_csrf": htmlDoc.GetCSRF(),
@ -168,10 +168,10 @@ func testIssueAddComment(t *testing.T, session *TestSession, issueURL, content,
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
val := htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").Eq(commentCount).Text() val := htmlDoc.doc.Find(".comment-list .comment .render-content p").Eq(commentCount).Text()
assert.Equal(t, content, val) assert.Equal(t, content, val)
idAttr, has := htmlDoc.doc.Find(".comment-list .comments .comment").Eq(commentCount).Attr("id") idAttr, has := htmlDoc.doc.Find(".comment-list .comment").Eq(commentCount).Attr("id")
idStr := idAttr[strings.LastIndexByte(idAttr, '-')+1:] idStr := idAttr[strings.LastIndexByte(idAttr, '-')+1:]
assert.True(t, has) assert.True(t, has)
id, err := strconv.Atoi(idStr) id, err := strconv.Atoi(idStr)
@ -197,7 +197,7 @@ func TestIssueCommentClose(t *testing.T) {
req := NewRequest(t, "GET", issueURL) req := NewRequest(t, "GET", issueURL)
resp := session.MakeRequest(t, req, http.StatusOK) resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
val := htmlDoc.doc.Find(".comment-list .comments .comment .render-content p").First().Text() val := htmlDoc.doc.Find(".comment-list .comment .render-content p").First().Text()
assert.Equal(t, "Description", val) assert.Equal(t, "Description", val)
} }

@ -98,10 +98,10 @@ func TestPullCreate_TitleEscape(t *testing.T) {
req = NewRequest(t, "GET", url) req = NewRequest(t, "GET", url)
resp = session.MakeRequest(t, req, http.StatusOK) resp = session.MakeRequest(t, req, http.StatusOK)
htmlDoc = NewHTMLParser(t, resp.Body) htmlDoc = NewHTMLParser(t, resp.Body)
titleHTML, err := htmlDoc.doc.Find(".comments .event .text b").First().Html() titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").First().Html()
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, "<strike>&lt;i&gt;XSS PR&lt;/i&gt;</strike>", titleHTML) assert.Equal(t, "<strike>&lt;i&gt;XSS PR&lt;/i&gt;</strike>", titleHTML)
titleHTML, err = htmlDoc.doc.Find(".comments .event .text b").Next().Html() titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").Next().Html()
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, "&lt;u&gt;XSS PR&lt;/u&gt;", titleHTML) assert.Equal(t, "&lt;u&gt;XSS PR&lt;/u&gt;", titleHTML)
}) })

@ -49,7 +49,7 @@ func testPullCleanUp(t *testing.T, session *TestSession, user, repo, pullnum str
// Click the little green button to create a pull // Click the little green button to create a pull
htmlDoc := NewHTMLParser(t, resp.Body) htmlDoc := NewHTMLParser(t, resp.Body)
link, exists := htmlDoc.doc.Find(".comments .merge .delete-button").Attr("data-url") link, exists := htmlDoc.doc.Find(".timeline-item .delete-button").Attr("data-url")
assert.True(t, exists, "The template has changed") assert.True(t, exists, "The template has changed")
req = NewRequestWithValues(t, "POST", link, map[string]string{ req = NewRequestWithValues(t, "POST", link, map[string]string{
"_csrf": htmlDoc.GetCSRF(), "_csrf": htmlDoc.GetCSRF(),

@ -1053,6 +1053,7 @@ issues.review.self.approval = You cannot approve your own pull request.
issues.review.self.rejection = You cannot request changes on your own pull request. issues.review.self.rejection = You cannot request changes on your own pull request.
issues.review.approve = "approved these changes %s" issues.review.approve = "approved these changes %s"
issues.review.comment = "reviewed %s" issues.review.comment = "reviewed %s"
issues.review.left_comment = left a comment
issues.review.content.empty = You need to leave a comment indicating the requested change(s). issues.review.content.empty = You need to leave a comment indicating the requested change(s).
issues.review.reject = "requested changes %s" issues.review.reject = "requested changes %s"
issues.review.wait = "was requested for review %s" issues.review.wait = "was requested for review %s"

@ -10,12 +10,12 @@
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }} {{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
<div class="twelve wide column comment-list prevent-before-timeline"> <div class="twelve wide column comment-list prevent-before-timeline">
<ui class="ui comments timeline-line"> <ui class="ui timeline">
<div id="{{.Issue.HashTag}}" class="comment"> <div id="{{.Issue.HashTag}}" class="timeline-item comment first">
{{if .Issue.OriginalAuthor }} {{if .Issue.OriginalAuthor }}
<span class="avatar"><img src="/img/avatar_default.png"></span> <span class="timeline-avatar"><img src="/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
<img src="{{.Issue.Poster.RelAvatarLink}}"> <img src="{{.Issue.Poster.RelAvatarLink}}">
</a> </a>
{{end}} {{end}}
@ -67,8 +67,8 @@
{{end}} {{end}}
{{if .IsSigned}} {{if .IsSigned}}
{{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }} {{ if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
<div class="comment form"> <div class="timeline-item comment form">
<a class="avatar" href="{{.SignedUser.HomeLink}}"> <a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}"> <img src="{{.SignedUser.RelAvatarLink}}">
</a> </a>
<div class="content"> <div class="content">
@ -116,8 +116,8 @@
{{else}} {{else}}
{{if .IsSigned}} {{if .IsSigned}}
{{if .Repository.IsArchived}} {{if .Repository.IsArchived}}
<div class="comment form"> <div class="timeline-item comment form">
<a class="avatar" href="{{.SignedUser.HomeLink}}"> <a class="timeline-avatar" href="{{.SignedUser.HomeLink}}">
<img src="{{.SignedUser.RelAvatarLink}}"> <img src="{{.SignedUser.RelAvatarLink}}">
</a> </a>
<div class="content"> <div class="content">

@ -9,11 +9,11 @@
22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED, 22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST --> 26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST -->
{{if eq .Type 0}} {{if eq .Type 0}}
<div class="comment" id="{{.HashTag}}"> <div class="timeline-item comment" id="{{.HashTag}}">
{{if .OriginalAuthor }} {{if .OriginalAuthor }}
<span class="avatar"><img src="/img/avatar_default.png"></span> <span class="timeline-avatar"><img src="/img/avatar_default.png"></span>
{{else}} {{else}}
<a class="avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar" {{if gt .Poster.ID 0}}href="{{.Poster.HomeLink}}"{{end}}>
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
{{end}} {{end}}
@ -69,16 +69,16 @@
</div> </div>
</div> </div>
{{else if eq .Type 1}} {{else if eq .Type 1}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-primitive-dot" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.reopened_at" .EventTag $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 2}} {{else if eq .Type 2}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="issue-symbol">{{svg "octicon-circle-slash" 16}}</span> <span class="badge">{{svg "octicon-circle-slash" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -98,8 +98,8 @@
{{ $refTr = "repo.issues.ref_reopening_from" }} {{ $refTr = "repo.issues.ref_reopening_from" }}
{{end}} {{end}}
{{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }} {{ $createdStr:= TimeSinceUnix .CreatedUnix $.Lang }}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-bookmark" 16}} <span class="badge">{{svg "octicon-bookmark" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -114,8 +114,8 @@
</div> </div>
</div> </div>
{{else if eq .Type 4}} {{else if eq .Type 4}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-bookmark" 16}} <span class="badge">{{svg "octicon-bookmark" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -128,8 +128,8 @@
</div> </div>
{{else if eq .Type 7}} {{else if eq .Type 7}}
{{if .Label}} {{if .Label}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-tag" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -138,8 +138,8 @@
</div> </div>
{{end}} {{end}}
{{else if eq .Type 8}} {{else if eq .Type 8}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-milestone" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -147,8 +147,8 @@
{{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}</span> {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}</span>
</div> </div>
{{else if eq .Type 9}} {{else if eq .Type 9}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-person" 16}}</span>
{{if gt .AssigneeID 0}} {{if gt .AssigneeID 0}}
{{if .RemovedAssignee}} {{if .RemovedAssignee}}
<a class="ui avatar image" href="{{.Assignee.HomeLink}}"> <a class="ui avatar image" href="{{.Assignee.HomeLink}}">
@ -178,8 +178,8 @@
{{end}} {{end}}
</div> </div>
{{else if eq .Type 10}} {{else if eq .Type 10}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-pencil" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -188,8 +188,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 11}} {{else if eq .Type 11}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-git-branch" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -198,16 +198,16 @@
</span> </span>
</div> </div>
{{else if eq .Type 12}} {{else if eq .Type 12}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.start_tracking_history" $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 13}} {{else if eq .Type 13}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -219,8 +219,8 @@
</div> </div>
</div> </div>
{{else if eq .Type 14}} {{else if eq .Type 14}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -231,16 +231,16 @@
</div> </div>
</div> </div>
{{else if eq .Type 15}} {{else if eq .Type 15}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span> <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a> {{$.i18n.Tr "repo.issues.cancel_tracking_history" $createdStr | Safe}}</span>
</div> </div>
{{else if eq .Type 16}} {{else if eq .Type 16}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -249,8 +249,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 17}} {{else if eq .Type 17}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -259,8 +259,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 18}} {{else if eq .Type 18}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -269,8 +269,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 19}} {{else if eq .Type 19}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-dependent" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -293,8 +293,8 @@
{{end}} {{end}}
</div> </div>
{{else if eq .Type 20}} {{else if eq .Type 20}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-dependent" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -317,17 +317,18 @@
{{end}} {{end}}
</div> </div>
{{else if eq .Type 22}} {{else if eq .Type 22}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item-group">
<span class="issue-symbol {{if eq .Review.Type 1}}green <div class="timeline-item event" id="{{.HashTag}}">
{{- else if eq .Review.Type 2}}grey
{{- else if eq .Review.Type 3}}red
{{- else}}grey{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon) 16}}</span>
{{if .OriginalAuthor }} {{if .OriginalAuthor }}
{{else}} {{else}}
<a class="ui avatar image"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}> <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
{{end}} {{end}}
<span class="badge {{if eq .Review.Type 1}}green
{{- else if eq .Review.Type 2}}grey
{{- else if eq .Review.Type 3}}red
{{- else}}grey{{end}}">{{svg (printf "octicon-%s" .Review.Type.Icon) 16}}</span>
<span class="text grey"> <span class="text grey">
{{if .OriginalAuthor }} {{if .OriginalAuthor }}
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span> <span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
@ -345,12 +346,31 @@
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}} {{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
{{end}} {{end}}
</span> </span>
</div>
{{if .Content}} {{if .Content}}
<div class="timeline-item comment">
<div class="content">
<div class="ui top attached header arrow-top">
<span class="text grey">
{{if .OriginalAuthor }}
<span class="text black"><i class="fa {{MigrationIcon $.Repository.GetOriginalURLHostname}}" aria-hidden="true"></i> {{ .OriginalAuthor }}</span><span class="text grey"> {{if $.Repository.OriginalURL}}</span><span class="text migrate">({{$.i18n.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname | Safe }}){{end}}</span>
{{else}}
<a{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>{{.Poster.GetDisplayName}}</a>
{{end}}
{{$.i18n.Tr "repo.issues.review.left_comment" | Safe}}
</span>
</div>
<div class="ui attached segment">
<div class="detail"> <div class="detail">
{{svg "octicon-quote" 16}} <span class="text black has-emoji">{{.Content}}</span>
<span class="text grey has-emoji">{{.Content}}</span> </div>
</div>
</div>
</div> </div>
{{end}} {{end}}
{{if .Review.CodeComments}}
<div class="timeline-item event">
{{ range $filename, $lines := .Review.CodeComments}} {{ range $filename, $lines := .Review.CodeComments}}
{{range $line, $comms := $lines}} {{range $line, $comms := $lines}}
<div class="ui segments"> <div class="ui segments">
@ -418,9 +438,11 @@
{{end}} {{end}}
{{end}} {{end}}
</div> </div>
{{end}}
</div>
{{else if eq .Type 23}} {{else if eq .Type 23}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="issue-symbol">{{svg "octicon-lock" 16}}</span> <span class="badge">{{svg "octicon-lock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -436,8 +458,8 @@
{{ end }} {{ end }}
</div> </div>
{{else if eq .Type 24}} {{else if eq .Type 24}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="issue-symbol">{{svg "octicon-key" 16}}</span> <span class="badge">{{svg "octicon-key" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -447,8 +469,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 25}} {{else if eq .Type 25}}
<div class="event"> <div class="timeline-item event">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-git-branch" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -457,8 +479,8 @@
</span> </span>
</div> </div>
{{else if eq .Type 26}} {{else if eq .Type 26}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
{{svg "octicon-primitive-dot" 16}} <span class="badge">{{svg "octicon-clock" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>
@ -469,8 +491,8 @@
</div> </div>
</div> </div>
{{else if eq .Type 27}} {{else if eq .Type 27}}
<div class="event" id="{{.HashTag}}"> <div class="timeline-item event" id="{{.HashTag}}">
<span class="issue-symbol">{{svg "octicon-eye" 16}}</span> <span class="badge">{{svg "octicon-eye" 16}}</span>
<a class="ui avatar image" href="{{.Poster.HomeLink}}"> <a class="ui avatar image" href="{{.Poster.HomeLink}}">
<img src="{{.Poster.RelAvatarLink}}"> <img src="{{.Poster.RelAvatarLink}}">
</a> </a>

@ -58,8 +58,8 @@
</div> </div>
</div> </div>
{{end}} {{end}}
<div class="comment merge box"> <div class="timeline-item comment merge box">
<a class="avatar text {{if .Issue.PullRequest.HasMerged}}purple <a class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
{{- else if .Issue.IsClosed}}grey {{- else if .Issue.IsClosed}}grey
{{- else if .IsPullWorkInProgress}}grey {{- else if .IsPullWorkInProgress}}grey
{{- else if .IsFilesConflicted}}grey {{- else if .IsFilesConflicted}}grey

@ -716,13 +716,13 @@
z-index: -1; z-index: -1;
} }
.timeline-line { .timeline {
position: relative; position: relative;
display: block; display: block;
width: 100%; margin-left: 40px;
max-width: 100%; padding-left: 16px;
&:before { &:before { //ciara
display: block; display: block;
content: ""; content: "";
position: absolute; position: absolute;
@ -730,18 +730,91 @@
margin-bottom: 14px; margin-bottom: 14px;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 82px; left: 30px;
width: 2px; width: 2px;
background-color: #f3f3f3; background-color: #f3f3f3;
z-index: -1; z-index: -1;
} }
} }
.comment { .timeline-item,
.avatar { .timeline-item-group {
width: @comment-avatar-width; padding: 12px 0;
}
.timeline-item-group {
.timeline-item {
padding-top: 8px;
padding-bottom: 8px;
}
}
.timeline-item {
margin-left: 16px;
position: relative;
.timeline-avatar {
position: absolute;
left: -72px;
img {
width: 40px;
height: 40px;
}
}
&:first-child {
padding-top: 0 !important;
}
&:last-child {
padding-bottom: 0 !important;
}
.badge {
width: 32px;
height: 32px;
background-color: #fff;
border: 2px solid #eee;
border-radius: 50%;
display: flex;
float: left;
margin-left: -32px;
margin-top: -1px;
margin-right: 8px;
color: #444;
.svg {
width: 28px;
height: 28px;
text-align: center;
line-height: 28px;
padding: 4px;
&.octicon-circle-slash {
color: #bd2c00;
}
&.octicon-primitive-dot {
color: #6cc644;
}
&.octicon-comment {
margin-top: 2px;
}
}
}
&.comment > .content {
margin-left: -16px;
} }
&.event > .text {
line-height: 30px;
}
}
.comment {
.tag { .tag {
color: #767676; color: #767676;
margin-top: 3px; margin-top: 3px;
@ -778,8 +851,6 @@
} }
.content { .content {
margin-left: 4em;
> .header { > .header {
#avatar-arrow; #avatar-arrow;
font-weight: normal; font-weight: normal;
@ -787,7 +858,6 @@
position: relative; position: relative;
color: #767676; color: #767676;
background-color: #f7f7f7; background-color: #f7f7f7;
border-bottom: 1px solid #eeeeee;
border-top-left-radius: 3px; border-top-left-radius: 3px;
border-top-right-radius: 3px; border-top-right-radius: 3px;
@ -796,6 +866,29 @@
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
} }
&.arrow-top::before,
&.arrow-top::after {
transform: rotate(90deg);
}
&.arrow-top::before {
top: -9px;
left: 6px;
}
&.arrow-top::after {
top: -8px;
left: 7px;
}
.actions a {
color: rgba(0, 0, 0, .4);
&:hover {
color: rgba(0, 0, 0, .8);
}
}
} }
> .merge-section { > .merge-section {
@ -892,9 +985,7 @@
} }
.event { .event {
position: relative; padding-left: 15px;
margin: 15px 0 15px 79px;
padding-left: 25px;
& > .svg:not(.issue-symbol) { & > .svg:not(.issue-symbol) {
text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff; text-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;
@ -935,46 +1026,6 @@
} }
} }
.svg {
width: 30px;
float: left;
text-align: center;
&.octicon-circle-slash {
margin-top: 5px;
margin-left: -35.5px;
height: 20px;
color: #bd2c00;
}
&.octicon-primitive-dot {
margin-top: -1px;
margin-left: -35.5px;
margin-right: -1px;
height: 30px;
color: #6cc644;
}
&.octicon-bookmark {
margin-top: 2px;
margin-left: -35.5px;
margin-right: -1px;
height: 25px;
}
&.octicon-eye {
margin-top: 3px;
margin-left: -35.5px;
margin-right: 0;
height: 22px;
}
&.octicon-x {
margin-left: -35.5px;
height: 25px;
}
}
.detail { .detail {
font-size: .9rem; font-size: .9rem;
margin-top: 5px; margin-top: 5px;
@ -986,11 +1037,11 @@
} }
} }
} }
.segments {
box-shadow: none;
} }
} }
.ui.segment.metas {
margin-top: -3px;
} }
.ui.participants { .ui.participants {
@ -2169,8 +2220,8 @@
.select-reaction { .select-reaction {
float: left; float: left;
padding: .5em; padding: .4em;
padding-left: 1em; line-height: 21px;
&:not(.active) a { &:not(.active) a {
display: none; display: none;

@ -672,13 +672,13 @@ a.ui.basic.green.label:hover {
color: #dbdbdb !important; color: #dbdbdb !important;
} }
.ui.comments .comment .actions a { .ui .comment .actions a {
color: #9e9e9e; color: #9e9e9e !important;
} }
.ui.comments .comment .actions a.active, .ui .comment .actions a.active,
.ui.comments .comment .actions a:hover { .ui .comment .actions a:hover {
color: #fff; color: #fff !important;
} }
.repository.view.issue .comment-list .comment .content .header:after { .repository.view.issue .comment-list .comment .content .header:after {
@ -698,10 +698,16 @@ a.ui.basic.green.label:hover {
} }
.repository.view.issue .comment-list:not(.prevent-before-timeline):before, .repository.view.issue .comment-list:not(.prevent-before-timeline):before,
.repository.view.issue .comment-list .timeline-line:before { .repository.view.issue .comment-list .timeline:before {
background-color: #3b4954; background-color: #3b4954;
} }
.repository.view.issue .comment-list .timeline-item .badge {
background-color: #383c4a;
border-color: #3b4954;
color: #9e9e9e;
}
.repository .comment.form .content .form:after { .repository .comment.form .content .form:after {
border-right-color: #313c47; border-right-color: #313c47;
} }

Loading…
Cancel
Save