Skip to content

Commit 94549bc

Browse files
authored
Change review buttons to icons to make space for text (#20934)
The layout on the review code view was broken depending on length of the text. Change all three buttons to icons with tooltip to make more space for these long texts. Fixes: #20922
1 parent b0c6284 commit 94549bc

11 files changed

+20
-9
lines changed

public/img/svg/gitea-join.svg

+1
Loading

public/img/svg/gitea-split.svg

+1
Loading

public/img/svg/gitea-whitespace.svg

+1
Loading

templates/repo/diff/box.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<h4>{{.locale.Tr "repo.diff.data_not_available"}}</h4>
1414
{{else}}
1515
<div>
16-
<div class="diff-detail-box diff-box sticky df sb ac">
16+
<div class="diff-detail-box diff-box sticky df sb ac fw">
1717
<div class="diff-detail-stats df ac">
1818
{{svg "octicon-diff" 16 "mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
1919
</div>
2020
<div class="diff-detail-actions df ac">
2121
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}}
2222
<progress id="viewed-files-summary" class="mr-2" value="{{.Diff.NumViewedFiles}}" max="{{.Diff.NumFiles}}"></progress>
23-
<label for="viewed-files-summary" id="viewed-files-summary-label" class="mr-2" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
23+
<label for="viewed-files-summary" id="viewed-files-summary-label" class="mr-3" data-text-changed-template="{{.locale.Tr "repo.pulls.viewed_files_label"}}">
2424
{{.locale.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
2525
</label>
2626
{{end}}

templates/repo/diff/new_review.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="ui top right pointing dropdown custom" id="review-box">
2-
<div class="ui tiny green button btn-review">
2+
<div class="ui tiny green button btn-review ml-2 mr-0">
33
{{.locale.Tr "repo.diff.review"}}
44
<span class="ui small label review-comments-counter" data-pending-comment-number="{{.PendingCodeCommentNumber}}">{{.PendingCodeCommentNumber}}</span>
55
{{svg "octicon-triangle-down" 14 "dropdown icon"}}

templates/repo/diff/options_dropdown.tmpl

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<div class="ui dropdown tiny basic button">
2-
{{.locale.Tr "repo.diff.options_button"}}
3-
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
1+
<div class="ui dropdown tiny basic button icon-button tooltip" data-content="{{.locale.Tr "repo.diff.options_button"}}">
2+
{{svg "octicon-kebab-horizontal"}}
43
<div class="menu">
54
<a class="item tiny basic toggle button" data-target="#diff-files">{{.locale.Tr "repo.diff.show_diff_stats"}}</a>
65
{{if .Issue.Index}}

templates/repo/diff/whitespace_dropdown.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="ui dropdown tiny basic button">
2-
{{.locale.Tr "repo.diff.whitespace_button"}}
1+
<div class="ui dropdown tiny basic button icon-button tooltip" data-content="{{.locale.Tr "repo.diff.whitespace_button"}}">
2+
{{svg "gitea-whitespace"}}
33
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
44
<div class="menu">
55
<a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all">
@@ -20,4 +20,4 @@
2020
</a>
2121
</div>
2222
</div>
23-
<a class="ui tiny basic toggle button" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}">{{ if .IsSplitStyle }}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}</a>
23+
<a class="ui tiny basic toggle button icon-button tooltip" href="?style={{if .IsSplitStyle}}unified{{else}}split{{end}}&whitespace={{$.WhitespaceBehavior}}" data-content="{{if .IsSplitStyle}}{{.locale.Tr "repo.diff.show_unified_view"}}{{else}}{{.locale.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>

web_src/less/_base.less

+6
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ a.commit-statuses-trigger {
304304
&:extend(.unselectable);
305305
}
306306

307+
/* try to match button with no icons in height */
308+
.icon-button {
309+
padding-top: 7.42px !important;
310+
padding-bottom: 7.42px !important;
311+
}
312+
307313
.ui.breadcrumb a:hover {
308314
text-decoration: underline !important;
309315
}

web_src/svg/gitea-join.svg

+1
Loading

web_src/svg/gitea-split.svg

+1
Loading

web_src/svg/gitea-whitespace.svg

+1
Loading

0 commit comments

Comments
 (0)