Skip to content

Commit 442cf3b

Browse files
committed
rollback modal changes
1 parent defbb95 commit 442cf3b

File tree

16 files changed

+32
-550
lines changed

16 files changed

+32
-550
lines changed

options/locale/locale_en-US.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ copy_error = Copy failed
111111
copy_type_unsupported = This file type cannot be copied
112112
copy_filename = Copy filename
113113

114-
repo.more_operations = More Operations
115-
116114
write = Write
117115
preview = Preview
118116
loading = Loading…
@@ -1319,7 +1317,6 @@ ambiguous_character = `%[1]c [U+%04[1]X] can be confused with %[2]c [U+%04[2]X]`
13191317
escape_control_characters = Escape
13201318
unescape_control_characters = Unescape
13211319
file_copy_permalink = Copy Permalink
1322-
center_content = Center content
13231320
view_git_blame = View Git Blame
13241321
video_not_supported_in_browser = Your browser does not support the HTML5 'video' tag.
13251322
audio_not_supported_in_browser = Your browser does not support the HTML5 'audio' tag.

routers/web/repo/view_file.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,5 @@ func prepareFileViewEditorButtons(ctx *context.Context) bool {
306306
ctx.Data["EditFileTooltip"] = util.Iif(isLFSLocked, ctx.Tr("repo.editor.this_file_locked"), ctx.Tr("repo.editor.edit_this_file"))
307307
ctx.Data["CanDeleteFile"] = !isLFSLocked
308308
ctx.Data["DeleteFileTooltip"] = util.Iif(isLFSLocked, ctx.Tr("repo.editor.this_file_locked"), ctx.Tr("repo.editor.delete_this_file"))
309-
310-
// Generate unique branch name for delete modal
311-
if ctx.Doer != nil {
312-
ctx.Data["new_branch_name"] = getUniquePatchBranchName(ctx, ctx.Doer.LowerName, ctx.Repo.Repository)
313-
}
314-
315309
return true
316310
}

templates/repo/editor/commit_form.tmpl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
<div class="commit-form-wrapper">
2-
<button type="button" class="commit-modal-close" id="commit-modal-close-btn" aria-label="Close">
3-
{{svg "octicon-x" 20}}
4-
</button>
52
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}}
63
<div class="commit-form avatar-content-left-arrow">
74
<h3>
@@ -83,9 +80,8 @@
8380
{{end}}
8481
</div>
8582
<input type="hidden" name="last_commit" value="{{.last_commit}}">
86-
<div class="tw-text-right tw-mt-4">
87-
<button id="commit-button" type="submit" class="ui primary button">
88-
{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
89-
</button>
90-
</div>
83+
<button id="commit-button" type="submit" class="ui primary button">
84+
{{if eq .commit_choice "commit-to-new-branch"}}{{ctx.Locale.Tr "repo.editor.propose_file_change"}}{{else}}{{ctx.Locale.Tr "repo.editor.commit_changes"}}{{end}}
85+
</button>
86+
<a class="ui button red" href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
9187
</div>

templates/repo/editor/common_breadcrumb.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
<span class="section"><a href="{{$.BranchLink}}/{{index $.TreePaths $i | PathEscapeSegments}}">{{$v}}</a></span>
1212
{{end}}
1313
{{end}}
14+
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{or .ReturnURI (print $.BranchLink "/" (PathEscapeSegments .TreePath))}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
1415
<input type="hidden" id="tree_path" name="tree_path" value="{{.TreePath}}">
1516
</div>

templates/repo/editor/edit.tmpl

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,13 @@
1414
>
1515
{{.CsrfTokenHtml}}
1616
{{template "repo/editor/common_top" .}}
17-
<div class="repo-editor-header tw-flex tw-items-center tw-justify-between tw-gap-2">
18-
<div class="tw-flex tw-items-center tw-gap-2">
19-
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
20-
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
21-
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
22-
{{svg "octicon-sidebar-collapse"}}
23-
</button>
24-
{{template "repo/editor/common_breadcrumb" .}}
25-
</div>
26-
<div class="tw-flex tw-gap-2">
27-
<a class="ui red button" href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
28-
<button type="button" class="ui primary button disabled" id="commit-changes-button">
29-
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
30-
</button>
31-
</div>
17+
<div class="repo-editor-header tw-flex tw-items-center tw-gap-2">
18+
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
19+
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
20+
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
21+
{{svg "octicon-sidebar-collapse"}}
22+
</button>
23+
{{template "repo/editor/common_breadcrumb" .}}
3224
</div>
3325
{{if not .NotEditableReason}}
3426
<div class="field">
@@ -64,22 +56,10 @@
6456
</div>
6557
</div>
6658
{{end}}
67-
{{/* Commit form fields - inside form but hidden, will be shown in modal */}}
68-
<div id="commit-form-fields" style="display: none;">
69-
{{template "repo/editor/commit_form" .}}
70-
</div>
71-
{{/* Hidden dummy button for repo-editor.ts compatibility */}}
72-
<button id="commit-button" type="button" style="display: none;"></button>
59+
{{template "repo/editor/commit_form" .}}
7360
</form>
7461
</div>
7562
</div>
7663
</div>
77-
78-
{{/* Commit Changes Modal - fields will be moved here visually */}}
79-
<div class="ui modal" id="commit-changes-modal">
80-
<i class="close icon"></i>
81-
<div class="content" id="commit-modal-content">
82-
</div>
83-
</div>
8464
</div>
8565
{{template "base/footer" .}}

templates/repo/editor/patch.tmpl

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,18 @@
1414
>
1515
{{.CsrfTokenHtml}}
1616
{{template "repo/editor/common_top" .}}
17-
<div class="repo-editor-header tw-flex tw-items-center tw-justify-between tw-gap-2">
18-
<div class="tw-flex tw-items-center tw-gap-2">
19-
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
20-
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
21-
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
22-
{{svg "octicon-sidebar-collapse"}}
23-
</button>
24-
<div class="breadcrumb">
25-
<span>{{ctx.Locale.Tr "repo.editor.patching"}}</span>
17+
<div class="repo-editor-header tw-flex tw-items-center tw-gap-2">
18+
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
19+
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
20+
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
21+
{{svg "octicon-sidebar-collapse"}}
22+
</button>
23+
<div class="breadcrumb">
24+
{{ctx.Locale.Tr "repo.editor.patching"}}
2625
<a class="section" href="{{$.BranchLink}}">{{.BranchName}}</a>
26+
<span>{{ctx.Locale.Tr "repo.editor.or"}} <a href="{{$.BranchLink}}">{{ctx.Locale.Tr "repo.editor.cancel_lower"}}</a></span>
2727
<input type="hidden" name="tree_path" value="__dummy_for_EditRepoFileForm.TreePath(Required)__">
2828
<input id="file-name" type="hidden" value="diff.patch">
29-
</div>
30-
</div>
31-
<div class="tw-flex tw-gap-2">
32-
<a class="ui red button" href="{{$.BranchLink}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
33-
<button type="button" class="ui primary button disabled" id="commit-changes-button">
34-
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
35-
</button>
3629
</div>
3730
</div>
3831
<div class="field">
@@ -47,22 +40,10 @@
4740
<div class="editor-loading is-loading"></div>
4841
</div>
4942
</div>
50-
{{/* Commit form fields - inside form but hidden, will be shown in modal */}}
51-
<div id="commit-form-fields" style="display: none;">
52-
{{template "repo/editor/commit_form" .}}
53-
</div>
54-
{{/* Hidden dummy button for repo-editor.ts compatibility */}}
55-
<button id="commit-button" type="button" style="display: none;"></button>
43+
{{template "repo/editor/commit_form" .}}
5644
</form>
5745
</div>
5846
</div>
5947
</div>
60-
61-
{{/* Commit Changes Modal - fields will be moved here visually */}}
62-
<div class="ui modal" id="commit-changes-modal">
63-
<i class="close icon"></i>
64-
<div class="content" id="commit-modal-content">
65-
</div>
66-
</div>
6748
</div>
6849
{{template "base/footer" .}}

templates/repo/editor/upload.tmpl

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,21 @@
1111
<form class="ui comment form form-fetch-action" method="post" action="{{.CommitFormOptions.TargetFormAction}}">
1212
{{.CsrfTokenHtml}}
1313
{{template "repo/editor/common_top" .}}
14-
<div class="repo-editor-header tw-flex tw-items-center tw-justify-between tw-gap-2">
15-
<div class="tw-flex tw-items-center tw-gap-2">
16-
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
17-
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
18-
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
19-
{{svg "octicon-sidebar-collapse"}}
20-
</button>
21-
{{template "repo/editor/common_breadcrumb" .}}
22-
</div>
23-
<div class="tw-flex tw-gap-2">
24-
<a class="ui red button" href="{{if .ReturnURI}}{{.ReturnURI}}{{else}}{{$.BranchLink}}/{{PathEscapeSegments .TreePath}}{{end}}">{{ctx.Locale.Tr "repo.editor.cancel"}}</a>
25-
<button type="button" class="ui primary button disabled" id="commit-changes-button">
26-
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
27-
</button>
28-
</div>
14+
<div class="repo-editor-header tw-flex tw-items-center tw-gap-2">
15+
<button type="button" class="repo-view-file-tree-toggle-show ui compact basic button icon not-mobile {{if .UserSettingCodeViewShowFileTree}}tw-hidden{{end}}"
16+
data-global-click="onRepoViewFileTreeToggle" data-toggle-action="show"
17+
data-tooltip-content="{{ctx.Locale.Tr "repo.diff.show_file_tree"}}">
18+
{{svg "octicon-sidebar-collapse"}}
19+
</button>
20+
{{template "repo/editor/common_breadcrumb" .}}
2921
</div>
3022
<div class="field">
3123
{{template "repo/upload" .}}
3224
</div>
33-
{{/* Commit form fields - inside form but hidden, will be shown in modal */}}
34-
<div id="commit-form-fields" style="display: none;">
35-
{{template "repo/editor/commit_form" .}}
36-
</div>
37-
{{/* Hidden dummy button for repo-editor.ts compatibility */}}
38-
<button id="commit-button" type="button" style="display: none;"></button>
25+
{{template "repo/editor/commit_form" .}}
3926
</form>
4027
</div>
4128
</div>
4229
</div>
43-
44-
{{/* Commit Changes Modal - fields will be moved here visually */}}
45-
<div class="ui modal" id="commit-changes-modal">
46-
<i class="close icon"></i>
47-
<div class="content" id="commit-modal-content">
48-
</div>
49-
</div>
5030
</div>
5131
{{template "base/footer" .}}

templates/repo/view_file.tmpl

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<span class="btn-octicon disabled" data-tooltip-content="{{.EditFileTooltip}}">{{svg "octicon-pencil"}}</span>
7575
{{end}}
7676
{{if .CanDeleteFile}}
77-
<a type="button" class="btn-octicon btn-octicon-danger" data-tooltip-content="{{.DeleteFileTooltip}}" id="delete-file-button">{{svg "octicon-trash"}}</a>
77+
<a class="btn-octicon btn-octicon-danger" data-tooltip-content="{{.DeleteFileTooltip}}" href="{{.RepoLink}}/_delete/{{PathEscapeSegments .BranchName}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-trash"}}</a>
7878
{{else}}
7979
<span class="btn-octicon disabled" data-tooltip-content="{{.DeleteFileTooltip}}">{{svg "octicon-trash"}}</span>
8080
{{end}}
@@ -148,75 +148,4 @@
148148
<a class="item copy-line-permalink" role="menuitem" data-url="{{.Repository.Link}}/src/commit/{{PathEscape .CommitID}}/{{PathEscapeSegments .TreePath}}{{if $.HasSourceRenderedToggle}}?display=source{{end}}">{{ctx.Locale.Tr "repo.file_copy_permalink"}}</a>
149149
</div>
150150
</div>
151-
152-
{{/* Delete File Modal */}}
153-
{{if .CanDeleteFile}}
154-
<div class="ui modal" id="delete-file-modal">
155-
<i class="close icon"></i>
156-
<div class="content">
157-
<form id="delete-file-form" class="ui form form-fetch-action" method="post" action="{{.RepoLink}}/_delete/{{.BranchName | PathEscapeSegments}}/{{.TreePath | PathEscapeSegments}}">
158-
{{.CsrfTokenHtml}}
159-
<input type="hidden" name="last_commit" value="{{.CommitID}}">
160-
<input type="hidden" name="tree_path" value="{{.TreePath}}">
161-
<div class="commit-form-wrapper">
162-
{{ctx.AvatarUtils.Avatar .SignedUser 40 "commit-avatar"}}
163-
<div class="commit-form avatar-content-left-arrow">
164-
<h3>
165-
<span>{{svg "octicon-unlock" 24}}</span>
166-
{{ctx.Locale.Tr "repo.editor.commit_changes"}}
167-
</h3>
168-
<div class="field">
169-
<input name="commit_summary" maxlength="100" placeholder="Delete {{.TreePath}}" value="Delete {{.TreePath}}" autofocus>
170-
</div>
171-
<div class="field">
172-
<textarea name="commit_message" placeholder="{{ctx.Locale.Tr "repo.editor.commit_message_desc"}}" rows="5"></textarea>
173-
</div>
174-
<div class="inline field">
175-
<div class="ui checkbox">
176-
<input name="signoff" type="checkbox">
177-
<label>{{ctx.Locale.Tr "repo.editor.signoff_desc"}}</label>
178-
</div>
179-
</div>
180-
<div class="quick-pull-choice">
181-
<div class="field">
182-
<div class="ui radio checkbox">
183-
<input type="radio" name="commit_choice" value="direct" checked>
184-
<label>
185-
{{svg "octicon-git-commit"}}
186-
{{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}}
187-
</label>
188-
</div>
189-
</div>
190-
{{if not .Repository.IsEmpty}}
191-
<div class="field">
192-
<div class="ui radio checkbox">
193-
<input type="radio" name="commit_choice" value="commit-to-new-branch">
194-
<label>
195-
{{svg "octicon-git-pull-request"}}
196-
{{ctx.Locale.Tr "repo.editor.create_new_branch_np"}}
197-
</label>
198-
</div>
199-
</div>
200-
<div class="quick-pull-branch-name tw-hidden">
201-
<div class="new-branch-name-input field">
202-
{{svg "octicon-git-branch"}}
203-
<input type="text" name="new_branch_name" maxlength="100" value="{{.new_branch_name}}" class="input-contrast tw-mr-1" placeholder="{{ctx.Locale.Tr "repo.editor.new_branch_name_desc"}}" title="{{ctx.Locale.Tr "repo.editor.new_branch_name"}}">
204-
<span class="text-muted"></span>
205-
</div>
206-
</div>
207-
{{end}}
208-
</div>
209-
</div>
210-
</div>
211-
<div class="tw-text-right tw-mt-4">
212-
<button type="button" class="ui button" onclick="$('#delete-file-modal').modal('hide')">{{ctx.Locale.Tr "cancel"}}</button>
213-
<button type="submit" class="ui red button">
214-
{{svg "octicon-trash" 16}}
215-
{{ctx.Locale.Tr "repo.editor.delete_this_file"}}
216-
</button>
217-
</div>
218-
</form>
219-
</div>
220-
</div>
221-
{{end}}
222151
</div>

web_src/css/index.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
@import "./repo/list-header.css";
6565
@import "./repo/file-view.css";
6666
@import "./repo/file-actions.css";
67-
@import "./repo/editor-commit.css";
68-
@import "./repo/delete-file.css";
6967
@import "./repo/wiki.css";
7068
@import "./repo/header.css";
7169
@import "./repo/home.css";

0 commit comments

Comments
 (0)