Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix button in branch list, avoid unexpected page jump before restore branch actually done #21562

Merged
merged 24 commits into from Nov 24, 2022
Merged
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4135439
UI: bug fix, replace html tags <a> with <div> in button: delete branch
Oct 23, 2022
f957d23
Merge branch 'main' into ui/repo/branch/delete-branch-button
Oct 23, 2022
21c5e53
Merge branch 'main' into ui/repo/branch/delete-branch-button
Oct 23, 2022
16e9f4e
UI: use `button` tags as buttons in branch view
Oct 24, 2022
f52ac59
Merge branch 'main' into ui/repo/branch/delete-branch-button
Oct 24, 2022
e31db19
Merge branch 'main' into ui/repo/branch/delete-branch-button
Oct 29, 2022
fa1d11e
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 15, 2022
01ef49b
Merge branch 'main' into ui/repo/branch/delete-branch-button
lafriks Nov 15, 2022
52aebb0
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 15, 2022
0d7f176
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 19, 2022
c874fe0
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 19, 2022
a03ec85
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 21, 2022
7ffc3b1
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 21, 2022
0e32f1f
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 22, 2022
b78b43c
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 22, 2022
d42b729
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 22, 2022
271a742
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 23, 2022
4c08bc2
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 23, 2022
3cee06e
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 23, 2022
b2e74f8
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 23, 2022
d798f2a
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 24, 2022
aeb6055
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 24, 2022
6da4157
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 24, 2022
57d09da
Merge branch 'main' into ui/repo/branch/delete-branch-button
lunny Nov 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@
</td>
<td class="right aligned overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
<div class="ui basic jump button icon tooltip show-create-branch-modal" data-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-branch-from="{{$.DefaultBranch}}" data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right">
<button class="ui basic jump button icon tooltip show-create-branch-modal" data-content="{{$.locale.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-branch-from="{{$.DefaultBranch}}" data-branch-from-urlcomponent="{{PathEscapeSegments $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right">
{{svg "octicon-git-branch"}}
</div>
</button>
{{end}}
{{if not $.DisableDownloadSourceArchives}}
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}" data-position="top right">
<button class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}" data-position="top right">
{{svg "octicon-download"}}
<div class="menu">
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranch}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments $.DefaultBranch}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
</div>
</div>
</button>
{{end}}
</td>
</tr>
Expand Down Expand Up @@ -108,26 +108,30 @@
</td>
<td class="three wide right aligned overflow-visible">
{{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}}
<div class="ui basic jump button icon tooltip show-create-branch-modal" data-branch-from="{{.Name}}" data-branch-from-urlcomponent="{{PathEscapeSegments .Name}}" data-content="{{$.locale.Tr "repo.branch.new_branch_from" .Name}}" data-position="top right" data-modal="#create-branch-modal" data-name="{{.Name}}">
<button class="ui basic jump button icon tooltip show-create-branch-modal" data-branch-from="{{.Name}}" data-branch-from-urlcomponent="{{PathEscapeSegments .Name}}" data-content="{{$.locale.Tr "repo.branch.new_branch_from" .Name}}" data-position="top right" data-modal="#create-branch-modal" data-name="{{.Name}}">
{{svg "octicon-git-branch"}}
</div>
</button>
{{end}}
{{if and (not .IsDeleted) (not $.DisableDownloadSourceArchives)}}
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" (.Name)}}" data-position="top right">
<button class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" (.Name)}}" data-position="top right">
{{svg "octicon-download"}}
<div class="menu">
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .Name}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
<a class="item archive-link" href="{{$.RepoLink}}/archive/{{PathEscapeSegments .Name}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
</div>
</div>
</button>
{{end}}
{{if and $.IsWriter (not $.IsMirror) (not $.Repository.IsArchived) (not .IsProtected)}}
{{if .IsDeleted}}
<a class="ui basic jump button icon tooltip undo-button" href data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}" data-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}" data-position="top right"><span class="text blue">{{svg "octicon-reply"}}</span></a>
<button class="ui basic jump button icon tooltip undo-button" data-url="{{$.Link}}/restore?branch_id={{.DeletedBranch.ID}}&name={{.DeletedBranch.Name}}" data-content="{{$.locale.Tr "repo.branch.restore" (.Name)}}" data-position="top right">
<span class="text blue">
{{svg "octicon-reply"}}
</span>
</button>
{{else}}
<a class="ui basic jump button icon tooltip delete-button delete-branch-button" href data-url="{{$.Link}}/delete?name={{.Name}}" data-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-position="top right" data-name="{{.Name}}">
<button class="ui basic jump button icon tooltip delete-button delete-branch-button" data-url="{{$.Link}}/delete?name={{.Name}}" data-content="{{$.locale.Tr "repo.branch.delete" (.Name)}}" data-position="top right" data-name="{{.Name}}">
{{svg "octicon-trash"}}
</a>
</button>
{{end}}
{{end}}
</td>
Expand Down