Skip to content

Commit f6303f2

Browse files
committed
Change review buttons to icons to make space for text
The layout on the review code view was broken depending on length of the text before. Change all three buttons to icons with tooltip to make more space for these long texts. Fixes: #20922
1 parent 3d870f6 commit f6303f2

File tree

9 files changed

+17
-8
lines changed

9 files changed

+17
-8
lines changed

public/img/svg/gitea-join.svg

+1
Loading

public/img/svg/gitea-split.svg

+1
Loading

templates/repo/diff/box.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
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>

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 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 mr-2" 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 "octicon-gear"}}
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

0 commit comments

Comments
 (0)