Skip to content

Commit a3d9f0d

Browse files
silverwindwxiaoguangGiteaBot
authored
Fix all rounded borders, change affected tab menus to pills (#30707)
Fixes #30673, all 23 issues. Notes: - Tab bar menus had to change to pills because of unsolvable issue with the border-radius as tab bar renders a overlapping border onto the box below. And I think pills look better. - Added padding to code editor empty preview message - Hide monaco's built-in blue focus border, we don't need it and it never showed before either. - Label add menu is simplified, removing the nested segment. <img width="1322" alt="Screenshot 2024-04-25 at 22 26 19" src="https://github.com/go-gitea/gitea/assets/115237/7e394e0c-b7ad-417d-8e9f-12f1dea93ed1"> <img width="1326" alt="Screenshot 2024-04-25 at 22 28 00" src="https://github.com/go-gitea/gitea/assets/115237/66c8499f-aa9f-4d95-8cca-ef13dfa82c65"> <img width="997" alt="Screenshot 2024-04-25 at 22 36 53" src="https://github.com/go-gitea/gitea/assets/115237/07896102-c71d-4246-8173-c2bc2e1d3cae"> <img width="832" alt="Screenshot 2024-04-25 at 22 56 09" src="https://github.com/go-gitea/gitea/assets/115237/d83afc96-08ca-4adc-baf4-3d02804be57c"> <img width="361" alt="Screenshot 2024-04-25 at 22 57 12" src="https://github.com/go-gitea/gitea/assets/115237/c7371a68-00b5-47d8-84d0-ddc5268b2b2c"> --------- Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 4daea7c commit a3d9f0d

25 files changed

+107
-68
lines changed

routers/web/repo/editor.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,9 @@ func DiffPreviewPost(ctx *context.Context) {
419419
return
420420
}
421421

422-
if diff.NumFiles == 0 {
423-
ctx.PlainText(http.StatusOK, ctx.Locale.TrString("repo.editor.no_changes_to_show"))
424-
return
422+
if diff.NumFiles != 0 {
423+
ctx.Data["File"] = diff.Files[0]
425424
}
426-
ctx.Data["File"] = diff.Files[0]
427425

428426
ctx.HTML(http.StatusOK, tplEditDiffPreview)
429427
}

templates/org/team/members.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="ui ten wide column">
99
{{template "org/team/navbar" .}}
1010
{{if .IsOrganizationOwner}}
11-
<div class="ui attached segment">
11+
<div class="ui top attached segment">
1212
<form class="ui form ignore-dirty tw-flex tw-flex-wrap tw-gap-2" action="{{$.OrgLink}}/teams/{{$.Team.LowerName | PathEscape}}/action/add" method="post">
1313
{{.CsrfTokenHtml}}
1414
<input type="hidden" name="uid" value="{{.SignedUser.ID}}">
@@ -21,7 +21,7 @@
2121
</form>
2222
</div>
2323
{{end}}
24-
<div class="ui attached segment">
24+
<div class="ui{{if not .IsOrganizationOwner}} top{{end}} attached segment">
2525
<div class="flex-list">
2626
{{range .Team.Members}}
2727
<div class="flex-item tw-items-center">

templates/org/team/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="ui top attached tabular menu org-team-navbar">
1+
<div class="ui compact small menu small-menu-items org-team-navbar">
22
<a class="item{{if .PageIsOrgTeamMembers}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}">{{svg "octicon-person"}} <strong>{{.Team.NumMembers}}</strong>&nbsp; {{ctx.Locale.Tr "org.lower_members"}}</a>
33
<a class="item{{if .PageIsOrgTeamRepos}} active{{end}}" href="{{.OrgLink}}/teams/{{.Team.LowerName | PathEscape}}/repositories">{{svg "octicon-repo"}} <strong>{{.Team.NumRepos}}</strong>&nbsp; {{ctx.Locale.Tr "org.lower_repositories"}}</a>
44
</div>

templates/org/team/repositories.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
</div>
2727
{{end}}
28-
<div class="ui attached segment">
28+
<div class="ui{{if not $canAddRemove}} top{{end}} attached segment">
2929
<div class="flex-list">
3030
{{range .Team.Repos}}
3131
<div class="flex-item tw-items-center">

templates/repo/commit_page.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
{{end}}
140140
{{template "repo/commit_load_branches_and_tags" .}}
141141
</div>
142-
<div class="ui attached segment tw-flex tw-items-center tw-justify-between tw-py-1 commit-header-row tw-flex-wrap {{$class}}">
142+
<div class="ui{{if not .Commit.Signature}} bottom{{end}} attached segment tw-flex tw-items-center tw-justify-between tw-py-1 commit-header-row tw-flex-wrap {{$class}}">
143143
<div class="tw-flex tw-items-center author">
144144
{{if .Author}}
145145
{{ctx.AvatarUtils.Avatar .Author 28 "tw-mr-2"}}

templates/repo/editor/diff_preview.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{if .File}}
12
<div class="diff-file-box">
23
<div class="ui attached table segment">
34
<div class="file-body file-code code-diff code-diff-unified unicode-escaped">
@@ -9,3 +10,8 @@
910
</div>
1011
</div>
1112
</div>
13+
{{else}}
14+
<div class="tw-p-6 tw-text-center">
15+
{{ctx.Locale.Tr "repo.editor.no_changes_to_show"}}
16+
</div>
17+
{{end}}

templates/repo/editor/edit.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@
2626
</div>
2727
</div>
2828
<div class="field">
29-
<div class="ui top attached tabular menu" data-write="write" data-preview="preview" data-diff="diff">
29+
<div class="ui compact small menu small-menu-items repo-editor-menu">
3030
<a class="active item" data-tab="write">{{svg "octicon-code"}} {{if .IsNewFile}}{{ctx.Locale.Tr "repo.editor.new_file"}}{{else}}{{ctx.Locale.Tr "repo.editor.edit_file"}}{{end}}</a>
3131
<a class="item" data-tab="preview" data-url="{{.Repository.Link}}/markup" data-context="{{.RepoLink}}/src/{{.BranchNameSubURL}}" data-markup-mode="file">{{svg "octicon-eye"}} {{ctx.Locale.Tr "preview"}}</a>
3232
{{if not .IsNewFile}}
3333
<a class="item" data-tab="diff" hx-params="context,content" hx-vals='{"context":"{{.BranchLink}}"}' hx-include="#edit_area" hx-swap="innerHTML" hx-target=".tab[data-tab='diff']" hx-indicator=".tab[data-tab='diff']" hx-post="{{.RepoLink}}/_preview/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">{{svg "octicon-diff"}} {{ctx.Locale.Tr "repo.editor.preview_changes"}}</a>
3434
{{end}}
3535
</div>
36-
<div class="ui bottom attached active tab segment" data-tab="write">
36+
<div class="ui active tab segment tw-rounded" data-tab="write">
3737
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-{{.TreePath}}"
3838
data-url="{{.Repository.Link}}/markup"
3939
data-context="{{.RepoLink}}"
4040
data-previewable-extensions="{{.PreviewableExtensions}}"
4141
data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
4242
<div class="editor-loading is-loading"></div>
4343
</div>
44-
<div class="ui bottom attached tab segment markup" data-tab="preview">
44+
<div class="ui tab segment markup tw-rounded" data-tab="preview">
4545
{{ctx.Locale.Tr "loading"}}
4646
</div>
47-
<div class="ui bottom attached tab segment diff edit-diff" data-tab="diff">
47+
<div class="ui tab segment diff edit-diff" data-tab="diff">
4848
<div class="tw-p-16"></div>
4949
</div>
5050
</div>

templates/repo/editor/patch.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
</div>
2020
</div>
2121
<div class="field">
22-
<div class="ui top attached tabular menu" data-write="write">
22+
<div class="ui compact small menu small-menu-items repo-editor-menu">
2323
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>
2424
</div>
25-
<div class="ui bottom attached active tab segment" data-tab="write">
25+
<div class="ui active tab segment tw-rounded tw-p-0" data-tab="write">
2626
<textarea id="edit_area" name="content" class="tw-hidden" data-id="repo-{{.Repository.Name}}-patch"
2727
data-context="{{.RepoLink}}"
2828
data-line-wrap-extensions="{{.LineWrapExtensions}}">
Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<div class="ui centered grid">
22
<div class="twelve wide computer column">
3-
<div class="ui attached left aligned segment">
4-
<p>{{ctx.Locale.Tr "repo.issues.label_templates.info"}}</p>
5-
<br>
6-
<form class="ui form center" action="{{.Link}}/initialize" method="post">
7-
{{.CsrfTokenHtml}}
8-
<div class="field">
9-
<div class="ui selection dropdown">
10-
<input type="hidden" name="template_name" value="Default">
11-
<div class="default text">{{ctx.Locale.Tr "repo.issues.label_templates.helper"}}</div>
12-
<div class="menu">
13-
{{range .LabelTemplateFiles}}
14-
<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
15-
{{end}}
16-
</div>
17-
{{svg "octicon-triangle-down" 18 "dropdown icon"}}
3+
<p>{{ctx.Locale.Tr "repo.issues.label_templates.info"}}</p>
4+
<form class="ui form center" action="{{.Link}}/initialize" method="post">
5+
{{.CsrfTokenHtml}}
6+
<div class="field">
7+
<div class="ui selection dropdown">
8+
<input type="hidden" name="template_name" value="Default">
9+
<div class="default text">{{ctx.Locale.Tr "repo.issues.label_templates.helper"}}</div>
10+
<div class="menu">
11+
{{range .LabelTemplateFiles}}
12+
<div class="item" data-value="{{.DisplayName}}">{{.DisplayName}}<br><i>({{.Description}})</i></div>
13+
{{end}}
1814
</div>
15+
{{svg "octicon-triangle-down" 18 "dropdown icon"}}
1916
</div>
20-
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.label_templates.use"}}</button>
21-
</form>
22-
</div>
17+
</div>
18+
<button type="submit" class="ui primary button">{{ctx.Locale.Tr "repo.issues.label_templates.use"}}</button>
19+
</form>
2320
</div>
2421
</div>

templates/repo/tag/list.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<div class="ui container">
55
{{template "base/alert" .}}
66
{{template "repo/release_tag_header" .}}
7+
{{if .Releases}}
78
<h4 class="ui top attached header">
89
<div class="five wide column tw-flex tw-items-center">
910
{{svg "octicon-tag" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.release.tags"}}
@@ -57,6 +58,7 @@
5758
</tbody>
5859
</table>
5960
</div>
61+
{{end}}
6062

6163
{{template "base/paginate" .}}
6264
</div>

0 commit comments

Comments
 (0)