Skip to content

Commit 7cc47da

Browse files
authored
Refactor view issue & comment list styles (go-gitea#35061)
Fix go-gitea#35060
1 parent 6599efb commit 7cc47da

File tree

14 files changed

+110
-240
lines changed

14 files changed

+110
-240
lines changed

templates/repo/commits_list_small.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<button class="ui button ellipsis-button show-panel toggle" data-panel="[data-singular-commit-body-for='{{$tag}}']">...</button>
2323
{{end}}
2424

25-
<span class="tw-flex tw-items-center tw-gap-2">
25+
<span class="flex-text-block">
2626
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
2727
{{template "repo/commit_sign_badge" dict "Commit" . "CommitBaseLink" $commitBaseLink "CommitSignVerification" .Verification}}
2828
</span>

templates/repo/diff/comments.tmpl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
{{$createdStr:= DateUtils.TimeSince .CreatedUnix}}
44
<div class="comment" id="{{.HashTag}}">
5-
{{if .OriginalAuthor}}
6-
<span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
7-
{{else}}
8-
{{template "shared/user/avatarlink" dict "user" .Poster}}
9-
{{end}}
5+
<div class="tw-mt-2 tw-mr-4">
6+
{{if .OriginalAuthor}}
7+
<span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
8+
{{else}}
9+
{{template "shared/user/avatarlink" dict "user" .Poster}}
10+
{{end}}
11+
</div>
1012
<div class="content comment-container">
11-
<div class="comment-header">
13+
<div class="comment-header avatar-content-left-arrow">
1214
<div class="comment-header-left">
1315
{{if .OriginalAuthor}}
1416
<span class="text black tw-font-semibold tw-mr-1">

templates/repo/editor/commit_form.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="commit-form-wrapper">
22
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}}
3-
<div class="commit-form">
3+
<div class="commit-form avatar-content-left-arrow">
44
<h3>{{- if .CommitFormOptions.WillSign}}
55
<span title="{{ctx.Locale.Tr "repo.signing.will_sign" .CommitFormOptions.SigningKey}}">{{svg "octicon-lock" 24}}</span>
66
{{ctx.Locale.Tr "repo.editor.commit_signed_changes"}}

templates/repo/issue/new_form.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<div class="issue-content-left">
55
<div class="ui comments">
66
<div class="comment">
7-
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
8-
<div class="ui segment content tw-my-0">
7+
<div class=" tw-mr-4 not-mobile">{{ctx.AvatarUtils.Avatar .SignedUser 40}}</div>
8+
<div class="ui segment content tw-my-0 avatar-content-left-arrow">
99
<div class="field">
1010
<input name="title" data-global-init="initInputAutoFocusEnd" id="issue_title" required maxlength="255" autocomplete="off"
1111
placeholder="{{ctx.Locale.Tr "repo.milestones.title"}}"

templates/repo/issue/view_content.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</a>
1414
{{end}}
1515
<div class="content comment-container">
16-
<div class="comment-header" role="heading" aria-level="3">
16+
<div class="comment-header avatar-content-left-arrow" role="heading" aria-level="3">
1717
<div class="comment-header-left">
1818
{{if .Issue.OriginalAuthor}}
1919
<span class="text black tw-font-semibold">
@@ -78,7 +78,7 @@
7878
{{ctx.AvatarUtils.Avatar .SignedUser 40}}
7979
</a>
8080
<div class="content">
81-
<div class="ui segment">
81+
<div class="ui segment avatar-content-left-arrow">
8282
<form class="ui form form-fetch-action" id="comment-form" action="{{$.RepoLink}}/issues/{{.Issue.Index}}/comments" method="post">
8383
{{template "repo/issue/comment_tab" .}}
8484
{{.CsrfTokenHtml}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 51 additions & 53 deletions
Large diffs are not rendered by default.

templates/repo/issue/view_content/pull_merge_box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939
{{end}}
4040
{{$showGeneralMergeForm := false}}
41-
<div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}no-header{{end}} flex-items-block">
41+
<div class="ui attached segment merge-section {{if not $.LatestCommitStatus}}avatar-content-left-arrow{{end}} flex-items-block">
4242
{{if .Issue.PullRequest.HasMerged}}
4343
{{if .IsPullBranchDeletable}}
4444
<div class="item item-section text tw-flex-1">

templates/repo/issue/view_title.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="issue-title-header">
1313
{{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
1414
<div class="issue-title" id="issue-title-display">
15-
<h1 class="tw-break-anywhere">
15+
<h1>
1616
{{ctx.RenderUtils.RenderIssueTitle .Issue.Title $.Repository}}
1717
<span class="index">#{{.Issue.Index}}</span>
1818
</h1>

templates/shared/user/avatarlink.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a class="avatar"{{if gt .user.ID 0}} href="{{.user.HomeLink}}"{{end}}>{{ctx.AvatarUtils.Avatar .user}}</a>
1+
<a class="avatar-with-link" {{if gt .user.ID 0}}href="{{.user.HomeLink}}"{{end}}>{{ctx.AvatarUtils.Avatar .user}}</a>

tests/integration/pull_create_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ func TestPullCreate_TitleEscape(t *testing.T) {
163163
req = NewRequest(t, "GET", url)
164164
resp = session.MakeRequest(t, req, http.StatusOK)
165165
htmlDoc = NewHTMLParser(t, resp.Body)
166-
titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").First().Html()
166+
titleHTML, err := htmlDoc.doc.Find(".comment-list .timeline-item.event .comment-text-line b").First().Html()
167167
assert.NoError(t, err)
168168
assert.Equal(t, "<strike>&lt;i&gt;XSS PR&lt;/i&gt;</strike>", titleHTML)
169-
titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .text b").Next().Html()
169+
titleHTML, err = htmlDoc.doc.Find(".comment-list .timeline-item.event .comment-text-line b").Next().Html()
170170
assert.NoError(t, err)
171171
assert.Equal(t, "&lt;u&gt;XSS PR&lt;/u&gt;", titleHTML)
172172
})

0 commit comments

Comments
 (0)