Skip to content

Commit a39fe62

Browse files
committed
cut timeline length with last element on issue view
fix go-gitea#7304 - lightly enlight dark theme issue timeline color Signed-off-by: Michael Gnehr <[email protected]>
1 parent 49ee9d2 commit a39fe62

File tree

5 files changed

+123
-100
lines changed

5 files changed

+123
-100
lines changed

public/css/index.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,9 @@ footer .ui.left,footer .ui.right{line-height:40px}
524524
.repository.view.issue .pull .review-item .type-icon{float:right;margin-right:1em}
525525
.repository.view.issue .pull .review-item .divider{margin:.5rem 0}
526526
.repository.view.issue .pull .review-item .review-content{padding:1em 0 1em 3.8em}
527-
.repository.view.issue .comment-list:before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:96px;width:2px;background-color:#f3f3f3;z-index:-1}
527+
.repository.view.issue .comment-list:not(.prevent-before-timeline):before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:96px;width:2px;background-color:#f3f3f3;z-index:-1}
528+
.repository.view.issue .comment-list .timeline-line{position:relative}
529+
.repository.view.issue .comment-list .timeline-line:before{display:block;content:"";position:absolute;margin-top:12px;margin-bottom:14px;top:0;bottom:0;left:82px;width:2px;background-color:#f3f3f3;z-index:-1}
528530
.repository.view.issue .comment-list .comment .avatar{width:3em}
529531
.repository.view.issue .comment-list .comment .tag{color:#767676;margin-top:3px;padding:2px 5px;font-size:12px;border:1px solid rgba(0,0,0,.1);border-radius:3px}
530532
.repository.view.issue .comment-list .comment .actions .item{float:left}

public/css/theme-arc-green.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ footer{background:#2e323e;border-top:1px solid #313131}
118118
.repository.new.issue .comment.form .content:after{border-right-color:#353945}
119119
.repository.view.issue .comment-list .comment .content .header:before{border-right-color:#404552}
120120
.repository.new.issue .comment.form .content:before{border-right-color:#353945}
121-
.repository.view.issue .comment-list:before{background-color:#313c47}
121+
.repository.view.issue .comment-list .timeline-line:before,.repository.view.issue .comment-list:not(.prevent-before-timeline):before{background-color:#3b4954}
122122
.repository .comment.form .content .form:after{border-right-color:#313c47}
123123
.repository .comment.form .content .form:before{border-right-color:#313c47}
124124
.ui .text.grey a:hover{color:#dbdbdb!important}

public/less/_repository.less

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@
749749
}
750750

751751
.comment-list {
752-
&:before {
752+
&:not(.prevent-before-timeline):before {
753753
display: block;
754754
content: "";
755755
position: absolute;
@@ -763,6 +763,24 @@
763763
z-index: -1;
764764
}
765765

766+
.timeline-line {
767+
position: relative;
768+
769+
&:before {
770+
display: block;
771+
content: "";
772+
position: absolute;
773+
margin-top: 12px;
774+
margin-bottom: 14px;
775+
top: 0;
776+
bottom: 0;
777+
left: 82px;
778+
width: 2px;
779+
background-color: #f3f3f3;
780+
z-index: -1;
781+
}
782+
}
783+
766784
.comment {
767785
.avatar {
768786
width: @comment-avatar-width;

public/less/themes/arc-green.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,9 @@ a.ui.basic.green.label:hover {
619619
border-right-color: #353945;
620620
}
621621

622-
.repository.view.issue .comment-list:before {
623-
background-color: #313c47;
622+
.repository.view.issue .comment-list:not(.prevent-before-timeline):before,
623+
.repository.view.issue .comment-list .timeline-line:before {
624+
background-color: #3b4954;
624625
}
625626

626627
.repository .comment.form .content .form:after {

templates/repo/issue/view_content.tmpl

Lines changed: 97 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -9,109 +9,69 @@
99
{{end}}
1010

1111
{{ $createdStr:= TimeSinceUnix .Issue.CreatedUnix $.Lang }}
12-
<div class="twelve wide column comment-list">
12+
<div class="twelve wide column comment-list prevent-before-timeline">
1313
<ui class="ui comments">
14-
<div class="comment">
15-
<a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
16-
<img src="{{.Issue.Poster.RelAvatarLink}}">
17-
</a>
18-
<div class="content">
19-
<div class="ui top attached header">
20-
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
21-
{{if not $.Repository.IsArchived}}
22-
<div class="ui right actions">
23-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}
24-
{{if or .IsIssueWriter .IsIssuePoster}}
25-
<div class="item action">
26-
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
27-
</div>
28-
{{end}}
29-
</div>
30-
{{end}}
31-
</div>
32-
<div class="ui attached segment">
33-
<div class="render-content markdown has-emoji">
34-
{{if .Issue.RenderedContent}}
35-
{{.Issue.RenderedContent|Str2html}}
36-
{{else}}
37-
<span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
14+
<div class="timeline-line">
15+
<div class="comment">
16+
<a class="avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
17+
<img src="{{.Issue.Poster.RelAvatarLink}}">
18+
</a>
19+
<div class="content">
20+
<div class="ui top attached header">
21+
<span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.GetDisplayName}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span>
22+
{{if not $.Repository.IsArchived}}
23+
<div class="ui right actions">
24+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }}
25+
{{if or .IsIssueWriter .IsIssuePoster}}
26+
<div class="item action">
27+
<a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a>
28+
</div>
29+
{{end}}
30+
</div>
3831
{{end}}
3932
</div>
40-
<div class="raw-content hide">{{.Issue.Content}}</div>
41-
<div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div>
42-
</div>
43-
{{$reactions := .Issue.Reactions.GroupByType}}
44-
{{if $reactions}}
45-
<div class="ui attached segment reactions">
46-
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }}
47-
</div>
48-
{{end}}
49-
{{if .Issue.Attachments}}
50-
<div class="ui bottom attached segment">
51-
<div class="ui small images">
52-
{{range .Issue.Attachments}}
53-
<a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
54-
{{if FilenameIsImage .Name}}
55-
<img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
56-
{{else}}
57-
<span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
58-
{{end}}
59-
</a>
33+
<div class="ui attached segment">
34+
<div class="render-content markdown has-emoji">
35+
{{if .Issue.RenderedContent}}
36+
{{.Issue.RenderedContent|Str2html}}
37+
{{else}}
38+
<span class="no-content">{{.i18n.Tr "repo.issues.no_content"}}</span>
6039
{{end}}
6140
</div>
41+
<div class="raw-content hide">{{.Issue.Content}}</div>
42+
<div class="edit-content-zone hide" data-write="issue-{{.Issue.ID}}-write" data-preview="issue-{{.Issue.ID}}-preview" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/content" data-context="{{.RepoLink}}"></div>
6243
</div>
63-
{{end}}
64-
</div>
65-
</div>
66-
67-
{{ template "repo/issue/view_content/comments" . }}
68-
69-
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
70-
{{ template "repo/issue/view_content/pull". }}
71-
{{end}}
72-
{{if .IsSigned}}
73-
{{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
74-
<div class="comment form">
75-
<a class="avatar" href="{{.SignedUser.HomeLink}}">
76-
<img src="{{.SignedUser.RelAvatarLink}}">
77-
</a>
78-
<div class="content">
79-
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
80-
{{template "repo/issue/comment_tab" .}}
81-
{{.CsrfTokenHtml}}
82-
<input id="status" name="status" type="hidden">
83-
<div class="text right">
84-
{{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}}
85-
{{if .Issue.IsClosed}}
86-
<div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
87-
{{.i18n.Tr "repo.issues.reopen_issue"}}
88-
</div>
89-
{{else}}
90-
<div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
91-
{{.i18n.Tr "repo.issues.close_issue"}}
92-
</div>
44+
{{$reactions := .Issue.Reactions.GroupByType}}
45+
{{if $reactions}}
46+
<div class="ui attached segment reactions">
47+
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions }}
48+
</div>
49+
{{end}}
50+
{{if .Issue.Attachments}}
51+
<div class="ui bottom attached segment">
52+
<div class="ui small images">
53+
{{range .Issue.Attachments}}
54+
<a target="_blank" rel="noopener noreferrer" href="{{AppSubUrl}}/attachments/{{.UUID}}">
55+
{{if FilenameIsImage .Name}}
56+
<img class="ui image" src="{{AppSubUrl}}/attachments/{{.UUID}}" title='{{$.i18n.Tr "repo.issues.attachment.open_tab" .Name}}'>
57+
{{else}}
58+
<span class="ui image octicon octicon-desktop-download" title='{{$.i18n.Tr "repo.issues.attachment.download" .Name}}'></span>
59+
{{end}}
60+
</a>
9361
{{end}}
94-
{{end}}
95-
<button class="ui green button" tabindex="5">
96-
{{.i18n.Tr "repo.issues.create_comment"}}
97-
</button>
62+
</div>
9863
</div>
99-
</form>
64+
{{end}}
10065
</div>
10166
</div>
102-
{{ end }}
103-
{{else}}
104-
{{if .Repository.IsArchived}}
105-
<div class="ui warning message">
106-
{{if .Issue.IsPull}}
107-
{{.i18n.Tr "repo.archive.pull.nocomment"}}
108-
{{else}}
109-
{{.i18n.Tr "repo.archive.issue.nocomment"}}
110-
{{end}}
111-
</div>
112-
{{else}}
67+
68+
{{ template "repo/issue/view_content/comments" . }}
69+
70+
{{if and .Issue.IsPull (not $.Repository.IsArchived)}}
71+
{{ template "repo/issue/view_content/pull". }}
72+
{{end}}
11373
{{if .IsSigned}}
114-
{{if .Repository.IsArchived}}
74+
{{ if and (or .IsRepoAdmin .IsRepoIssuesWriter (or (not .Issue.IsLocked))) (not .Repository.IsArchived) }}
11575
<div class="comment form">
11676
<a class="avatar" href="{{.SignedUser.HomeLink}}">
11777
<img src="{{.SignedUser.RelAvatarLink}}">
@@ -140,14 +100,56 @@
140100
</form>
141101
</div>
142102
</div>
143-
{{end}}
103+
{{ end }}
144104
{{else}}
105+
{{if .Repository.IsArchived}}
145106
<div class="ui warning message">
146-
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
107+
{{if .Issue.IsPull}}
108+
{{.i18n.Tr "repo.archive.pull.nocomment"}}
109+
{{else}}
110+
{{.i18n.Tr "repo.archive.issue.nocomment"}}
111+
{{end}}
147112
</div>
113+
{{else}}
114+
{{if .IsSigned}}
115+
{{if .Repository.IsArchived}}
116+
<div class="comment form">
117+
<a class="avatar" href="{{.SignedUser.HomeLink}}">
118+
<img src="{{.SignedUser.RelAvatarLink}}">
119+
</a>
120+
<div class="content">
121+
<form class="ui segment form" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
122+
{{template "repo/issue/comment_tab" .}}
123+
{{.CsrfTokenHtml}}
124+
<input id="status" name="status" type="hidden">
125+
<div class="text right">
126+
{{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}}
127+
{{if .Issue.IsClosed}}
128+
<div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen">
129+
{{.i18n.Tr "repo.issues.reopen_issue"}}
130+
</div>
131+
{{else}}
132+
<div id="status-button" class="ui red basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.close_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.close_comment_issue"}}" data-status-val="close">
133+
{{.i18n.Tr "repo.issues.close_issue"}}
134+
</div>
135+
{{end}}
136+
{{end}}
137+
<button class="ui green button" tabindex="5">
138+
{{.i18n.Tr "repo.issues.create_comment"}}
139+
</button>
140+
</div>
141+
</form>
142+
</div>
143+
</div>
144+
{{end}}
145+
{{else}}
146+
<div class="ui warning message">
147+
{{.i18n.Tr "repo.issues.sign_in_require_desc" .SignInLink | Safe}}
148+
</div>
149+
{{end}}
148150
{{end}}
149151
{{end}}
150-
{{end}}
152+
</div>
151153
</ui>
152154
</div>
153155

0 commit comments

Comments
 (0)