Skip to content

Commit 1b2db43

Browse files
committed
Change review buttons to icons to make space for text (go-gitea#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: go-gitea#20922
1 parent 85f829f commit 1b2db43

File tree

11 files changed

+20
-9
lines changed

11 files changed

+20
-9
lines changed

public/img/svg/gitea-join.svg

Lines changed: 1 addition & 0 deletions
Loading

public/img/svg/gitea-split.svg

Lines changed: 1 addition & 0 deletions
Loading

public/img/svg/gitea-whitespace.svg

Lines changed: 1 addition & 0 deletions
Loading

templates/repo/diff/box.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
<h4>{{.i18n.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"}}{{.i18n.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="{{.i18n.Tr "repo.pulls.viewed_files_label"}}">
23+
<label for="viewed-files-summary" id="viewed-files-summary-label" class="mr-3" data-text-changed-template="{{.i18n.Tr "repo.pulls.viewed_files_label"}}">
2424
{{.i18n.Tr "repo.pulls.viewed_files_label" .Diff.NumViewedFiles .Diff.NumFiles}}
2525
</label>
2626
{{end}}

templates/repo/diff/new_review.tmpl

Lines changed: 1 addition & 1 deletion
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
{{.i18n.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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<div class="ui dropdown tiny basic button">
2-
{{.i18n.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="{{.i18n.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">{{.i18n.Tr "repo.diff.show_diff_stats"}}</a>
65
{{if .Issue.Index}}

templates/repo/diff/whitespace_dropdown.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<div class="ui dropdown tiny basic button">
2-
{{.i18n.Tr "repo.diff.whitespace_button"}}
1+
<div class="ui dropdown tiny basic button icon-button tooltip" data-content="{{.i18n.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 }}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.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}}{{.i18n.Tr "repo.diff.show_unified_view"}}{{else}}{{.i18n.Tr "repo.diff.show_split_view"}}{{end}}">{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}}</a>

web_src/less/_base.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ a.commit-statuses-trigger {
299299
&:extend(.unselectable);
300300
}
301301

302+
/* try to match button with no icons in height */
303+
.icon-button {
304+
padding-top: 7.42px !important;
305+
padding-bottom: 7.42px !important;
306+
}
307+
302308
.ui.breadcrumb a:hover {
303309
text-decoration: underline !important;
304310
}

web_src/svg/gitea-join.svg

Lines changed: 1 addition & 0 deletions
Loading

web_src/svg/gitea-split.svg

Lines changed: 1 addition & 0 deletions
Loading

web_src/svg/gitea-whitespace.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)