1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Implement delete release attachments and update release attachments' name (#14130) (#15666)

* Implement delete release attachment

* Add attachments on release edit page

* Fix bug

* Finish del release attachments

* Fix frontend lint

* Fix tests

* Support edit release attachments

* Added tests

* Remove the unnecessary parameter isCreate from UpdateReleaseOrCreatReleaseFromTag

* Rename UpdateReleaseOrCreatReleaseFromTag to UpdateRelease

* Fix middle align

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Kyle D
2021-05-03 11:27:00 -06:00
committed by GitHub
parent 4fa2804238
commit cead819cb5
11 changed files with 276 additions and 56 deletions

View File

@@ -1260,6 +1260,15 @@ function initPullRequestMergeInstruction() {
});
}
function initRelease() {
$(document).on('click', '.remove-rel-attach', function() {
const uuid = $(this).data('uuid');
const id = $(this).data('id');
$(`input[name='attachment-del-${uuid}']`).attr('value', true);
$(`#attachment-${id}`).hide();
});
}
function initPullRequestReview() {
if (window.location.hash && window.location.hash.startsWith('#issuecomment-')) {
const commentDiv = $(window.location.hash);
@@ -2758,6 +2767,7 @@ $(document).ready(async () => {
initNotificationsTable();
initPullRequestMergeInstruction();
initReleaseEditor();
initRelease();
const routes = {
'div.user.settings': initUserSettings,

View File

@@ -1853,6 +1853,13 @@
margin-bottom: 1em;
}
}
.wrap_remove {
height: 38px;
}
.attachment_edit {
width: 450px !important;
}
}
}