mirror of
https://github.com/go-gitea/gitea
synced 2024-12-21 05:24:25 +01:00
eb748f5f3c
This code adds a simple endpoint to apply patches to repositories and branches on gitea. This is then used along with the conflicting checking code in #18004 to provide a basic implementation of cherry-pick revert. Now because the buttons necessary for cherry-pick and revert have required us to create a dropdown next to the Browse Source button I've also implemented Create Branch and Create Tag operations. Fix #3880 Fix #17986 Signed-off-by: Andrew Thornton <art27@cantab.net>
18 lines
648 B
JavaScript
18 lines
648 B
JavaScript
import $ from 'jquery';
|
|
|
|
export function initRepoBranchButton() {
|
|
$('.show-create-branch-modal').on('click', function () {
|
|
let modalFormName = $(this).attr('data-modal-form');
|
|
if (!modalFormName) {
|
|
modalFormName = '#create-branch-form';
|
|
}
|
|
$(modalFormName)[0].action = $(modalFormName).attr('data-base-action') + $(this).attr('data-branch-from-urlcomponent');
|
|
let fromSpanName = $(this).attr('data-modal-from-span');
|
|
if (!fromSpanName) {
|
|
fromSpanName = '#modal-create-branch-from-span';
|
|
}
|
|
|
|
$(fromSpanName).text($(this).attr('data-branch-from'));
|
|
$($(this).attr('data-modal')).modal('show');
|
|
});
|
|
}
|