Skip to content

Commit 392461d

Browse files
committed
fix ui
1 parent 7884bf5 commit 392461d

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

routers/web/repo/editor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func prepareEditorCommitFormOptions(ctx *context.Context, editorAction string) *
8888

8989
func prepareTreePathFieldsAndPaths(ctx *context.Context, treePath string) {
9090
// show the tree path fields in the "breadcrumb" and help users to edit the target tree path
91-
ctx.Data["TreeNames"], ctx.Data["TreePaths"] = getParentTreeFields(treePath)
91+
ctx.Data["TreeNames"], ctx.Data["TreePaths"] = getParentTreeFields(strings.TrimPrefix(treePath, "/"))
9292
}
9393

9494
type preparedEditorCommitForm[T any] struct {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{if .CommitFormOptions.WillSubmitToFork}}
22
<div class="ui blue message">
3-
{{ctx.Locale.Tr "repo.editor.fork_edit_description" .CommitFormOptions.TargetRepo.FullName}}
3+
{{$repoLinkHTML := HTMLFormat `<a href="%s">%s</a>` .CommitFormOptions.TargetRepo.Link .CommitFormOptions.TargetRepo.FullName}}
4+
{{ctx.Locale.Tr "repo.editor.fork_edit_description" $repoLinkHTML}}
45
</div>
56
{{end}}

templates/repo/editor/edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
99
>
1010
{{.CsrfTokenHtml}}
11+
{{template "repo/editor/common_top" .}}
1112
<div class="repo-editor-header">
1213
{{template "repo/editor/common_breadcrumb" .}}
1314
</div>
1415
{{if not .NotEditableReason}}
15-
{{template "repo/editor/common_top" .}}
1616
<div class="field">
1717
<div class="ui top attached header">
1818
<div class="ui compact small menu small-menu-items repo-editor-menu">

templates/repo/editor/fork.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
{{template "base/alert" .}}
66
<form class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_fork/{{.BranchName | PathEscapeSegments}}">
77
{{.CsrfTokenHtml}}
8-
<div class="field center">
9-
<h3>{{ctx.Locale.Tr "repo.editor.fork_create"}}</h3>
10-
<p>{{ctx.Locale.Tr "repo.editor.fork_create_description"}}</p>
11-
<button class="ui primary button">
12-
{{ctx.Locale.Tr "repo.fork_repo"}}
13-
</button>
8+
<div class="tw-text-center">
9+
<div class="tw-my-[40px]">
10+
<h3>{{ctx.Locale.Tr "repo.editor.fork_create"}}</h3>
11+
<p>{{ctx.Locale.Tr "repo.editor.fork_create_description"}}</p>
12+
</div>
13+
<button class="ui primary button">{{ctx.Locale.Tr "repo.fork_repo"}}</button>
1414
</div>
1515
</form>
1616
</div>

templates/repo/editor/patch.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
data-text-empty-confirm-content="{{ctx.Locale.Tr "repo.editor.commit_empty_file_text"}}"
99
>
1010
{{.CsrfTokenHtml}}
11+
{{template "repo/editor/common_top" .}}
1112
<div class="repo-editor-header">
1213
<div class="breadcrumb">
1314
{{ctx.Locale.Tr "repo.editor.patching"}}
@@ -19,7 +20,6 @@
1920
<input id="file-name" type="hidden" value="diff.patch">
2021
</div>
2122
</div>
22-
{{template "repo/editor/common_top" .}}
2323
<div class="field">
2424
<div class="ui compact small menu small-menu-items repo-editor-menu">
2525
<a class="active item" data-tab="write">{{svg "octicon-code" 16 "tw-mr-1"}}{{ctx.Locale.Tr "repo.editor.new_patch"}}</a>

templates/repo/editor/upload.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
{{template "base/alert" .}}
66
<form class="ui comment form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
77
{{.CsrfTokenHtml}}
8+
{{template "repo/editor/common_top" .}}
89
<div class="repo-editor-header">
910
{{template "repo/editor/common_breadcrumb" .}}
1011
</div>
11-
{{template "repo/editor/common_top" .}}
1212
<div class="field">
1313
{{template "repo/upload" .}}
1414
</div>

0 commit comments

Comments
 (0)