mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 15:35:59 +01:00
Add a button to show forked repos to the fork account select dialog
This commit is contained in:
@@ -76,10 +76,19 @@
|
||||
@repositoryHeaderComponent(repository, context)
|
||||
}
|
||||
@if(repository.repository.options.allowFork) {
|
||||
<a class="btn btn-default btn-sm" href="@helpers.url(repository)/network/members">
|
||||
<span class="strong"><i class="octicon octicon-repo-forked"></i>Fork</span><span class="muted">: @repository.forkedCount</span>
|
||||
</a>
|
||||
@if(context.loginAccount.isEmpty){
|
||||
<a class="btn btn-default btn-sm" href="@context.path/signin?redirect=@helpers.urlEncode(s"${context.path}/${repository.owner}/${repository.name}")">
|
||||
<span class="strong"><i class="octicon octicon-repo-forked"></i>Fork</span><span class="muted">: @repository.forkedCount</span>
|
||||
</a>
|
||||
} else {
|
||||
<a class="btn btn-default btn-sm" href="@context.path/@repository.owner/@repository.name/fork" rel="facebox">
|
||||
<span class="strong"><i class="octicon octicon-repo-forked"></i>Fork</span><span class="muted">: @repository.forkedCount</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
<form id="fork-form" method="post" action="@context.path/@repository.owner/@repository.name/fork" style="display: none;">
|
||||
<input type="hidden" name="account" value="@context.loginAccount.get.userName"/>
|
||||
</form>
|
||||
</div>
|
||||
@gitbucket.core.helper.html.repositoryicon(repository, true)
|
||||
<a href="@helpers.url(repository.owner)">@repository.owner</a> / <a href="@helpers.url(repository)" class="strong">@repository.name</a>
|
||||
@@ -97,4 +106,19 @@
|
||||
@body
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('a[rel*=facebox]').facebox({
|
||||
'loadingImage': '@helpers.assets("/vendors/facebox/loading.gif")',
|
||||
'closeImage': '@helpers.assets("/vendors/facebox/closelabel.png")'
|
||||
});
|
||||
|
||||
$(document).on("click", ".js-fork-owner-select-target", function() {
|
||||
var account = $(this).text().replace("@@", "");
|
||||
$("#account").val(account);
|
||||
$("#fork").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user