mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-16 02:15:50 +01:00
(refs #224)Add delete branch button
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@(branchInfo: List[(String, java.util.Date)],
|
||||
hasWritePermission: Boolean,
|
||||
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
|
||||
@import context._
|
||||
@import view.helpers._
|
||||
@@ -17,9 +18,9 @@
|
||||
<tr>
|
||||
<td>
|
||||
<a href="@url(repository)/tree/@encodeRefName(branchName)">@branchName</a>
|
||||
@*
|
||||
<a href="#" class="btn btn-danger btn-mini">Delete branch</a>
|
||||
*@
|
||||
@if(hasWritePermission && repository.repository.defaultBranch != branchName){
|
||||
<a href="@url(repository)/delete/@encodeRefName(branchName)" class="btn btn-danger btn-mini pull-right delete-branch" data-name="@branchName">Delete branch</a>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@datetime(latestUpdateDate)
|
||||
@@ -35,4 +36,12 @@
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
}
|
||||
<script>
|
||||
$(function(){
|
||||
$('.delete-branch').click(function(e){
|
||||
var branchName = $(e.target).data('name');
|
||||
return confirm('Are you sure you want to remove the ' + branchName + ' branch?');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user