diff options
author | Viktor Yakovchuk <viktor@yakovchuk.net> | 2021-05-24 17:57:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 15:57:46 +0100 |
commit | 5285a3e70e0718d0df0b4acaaf41926dcef303fd (patch) | |
tree | 12ef6af2b728ff7112ed476a3158ef8e4568e1d3 /templates/repo/branch/list.tmpl | |
parent | 3aaf64885f47eb65bf7353a5613acfcac786e5b2 (diff) | |
download | gitea-5285a3e70e0718d0df0b4acaaf41926dcef303fd.tar.gz gitea-5285a3e70e0718d0df0b4acaaf41926dcef303fd.zip |
Add possibility to make branch in branch page (#15960)
* Add possibility to make branch in branch page (#15911)
Add possibility to make branch in branch page
in the area next to Download and Delete buttons.
It is a more intuitive place in the interface
compared to what is already there.
Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net>
* Update templates/repo/branch/list.tmpl
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'templates/repo/branch/list.tmpl')
-rw-r--r-- | templates/repo/branch/list.tmpl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index 3b678e2ce1..1e21863ee1 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -24,6 +24,11 @@ {{end}} </td> <td class="right aligned overflow-visible"> + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + <div class="ui basic jump button icon poping up show-create-branch-modal" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" ($.DefaultBranch)}}" data-variation="tiny inverted" data-branch-from="{{EscapePound $.DefaultBranch}}" data-modal="#create-branch-modal" data-position="top right"> + {{svg "octicon-git-branch"}} + </div> + {{end}} <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" ($.DefaultBranch)}}" data-variation="tiny inverted" data-position="top right"> {{svg "octicon-download"}} <div class="menu"> @@ -102,6 +107,11 @@ {{end}} </td> <td class="two wide right aligned overflow-visible"> + {{if and $.IsWriter (not $.Repository.IsArchived) (not .IsDeleted)}} + <div class="ui basic jump button icon poping up show-create-branch-modal" data-branch-from="{{EscapePound .Name}}" data-content="{{$.i18n.Tr "repo.branch.new_branch_from" .Name}}" data-variation="tiny inverted" data-position="top right" data-modal="#create-branch-modal" data-name="{{.Name}}"> + {{svg "octicon-git-branch"}} + </div> + {{end}} {{if (not .IsDeleted)}} <div class="ui basic jump dropdown icon button poping up" data-content="{{$.i18n.Tr "repo.branch.download" (.Name)}}" data-variation="tiny inverted" data-position="top right"> {{svg "octicon-download"}} @@ -142,4 +152,30 @@ </div> {{template "base/delete_modal_actions" .}} </div> + +<div class="ui small modal" id="create-branch-modal"> + <div class="header"> + {{.i18n.Tr "repo.branch.new_branch"}} + </div> + <div class="content"> + <form class="ui form" id="create-branch-form" action="" data-base-action="{{.Link}}/_new/branch/" method="post"> + {{.CsrfTokenHtml}} + <div class="field"> + <label> + {{.i18n.Tr "repo.branch.create_new_branch"}} + <span class="text" id="modal-create-branch-from-span"></span> + </label> + </div> + <div class="required field"> + <label for="new_branch_name">{{.i18n.Tr "repo.branch.name"}}</label> + <input id="new_branch_name" name="new_branch_name" required> + </div> + + <div class="text right actions"> + <div class="ui cancel button">{{.i18n.Tr "settings.cancel"}}</div> + <button class="ui green button">{{.i18n.Tr "repo.branch.confirm_create_branch"}}</button> + </div> + </form> + </div> +</div> {{template "base/footer" .}} |