mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Add a button to show forked repos to the fork account select dialog
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
@(repository: gitbucket.core.service.RepositoryService.RepositoryInfo,
|
||||||
groupAndPerm: Seq[(String, Boolean)])(implicit context: gitbucket.core.controller.Context)
|
groupAndPerm: Seq[(String, Boolean)])(implicit context: gitbucket.core.controller.Context)
|
||||||
@import gitbucket.core.view.helpers
|
@import gitbucket.core.view.helpers
|
||||||
<h2 class="facebox-header">Where should we fork this repository?</h2>
|
<h2 class="facebox-header">
|
||||||
|
Where should we fork this repository?
|
||||||
|
<a class="btn btn-default btn-sm" href="@helpers.url(repository)/network/members">Show forks</a>
|
||||||
|
</h2>
|
||||||
<form action="@helpers.url(repository)/fork" id="fork" method="post">
|
<form action="@helpers.url(repository)/fork" id="fork" method="post">
|
||||||
<div class="content">
|
|
||||||
<div class="block">
|
<div class="block">
|
||||||
@helpers.avatar(context.loginAccount.get.userName, 24) <a href="javascript:void(0);" class="js-fork-owner-select-target">@@@context.loginAccount.get.userName</a>
|
@helpers.avatar(context.loginAccount.get.userName, 24) <a href="javascript:void(0);" class="js-fork-owner-select-target">@@@context.loginAccount.get.userName</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,6 +20,5 @@
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
|
||||||
<input id="account" name="account" type="hidden" />
|
<input id="account" name="account" type="hidden" />
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -76,10 +76,19 @@
|
|||||||
@repositoryHeaderComponent(repository, context)
|
@repositoryHeaderComponent(repository, context)
|
||||||
}
|
}
|
||||||
@if(repository.repository.options.allowFork) {
|
@if(repository.repository.options.allowFork) {
|
||||||
<a class="btn btn-default btn-sm" href="@helpers.url(repository)/network/members">
|
@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>
|
<span class="strong"><i class="octicon octicon-repo-forked"></i>Fork</span><span class="muted">: @repository.forkedCount</span>
|
||||||
</a>
|
</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>
|
</div>
|
||||||
@gitbucket.core.helper.html.repositoryicon(repository, true)
|
@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>
|
<a href="@helpers.url(repository.owner)">@repository.owner</a> / <a href="@helpers.url(repository)" class="strong">@repository.name</a>
|
||||||
@@ -97,4 +106,19 @@
|
|||||||
@body
|
@body
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,23 +5,7 @@
|
|||||||
@import gitbucket.core.view.helpers
|
@import gitbucket.core.view.helpers
|
||||||
@gitbucket.core.html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
@gitbucket.core.html.main(s"${repository.owner}/${repository.name}", Some(repository)) {
|
||||||
@gitbucket.core.html.menu("fork", repository){
|
@gitbucket.core.html.menu("fork", repository){
|
||||||
<h1 class="body-title">
|
<h1 class="body-title">Forked repositories</h1>
|
||||||
Forked repositories
|
|
||||||
@if(context.loginAccount.isEmpty){
|
|
||||||
<a href="@context.path/signin?redirect=@helpers.urlEncode(s"${context.path}/${repository.owner}/${repository.name}")" class="btn btn-success">Fork</a>
|
|
||||||
} else {
|
|
||||||
@if(groupNames.isEmpty) {
|
|
||||||
<a id="fork-link" href="javascript:void(0);" class="btn btn-success">Fork</a>
|
|
||||||
} else {
|
|
||||||
<a href="@context.path/@repository.owner/@repository.name/fork" class="btn btn-success" rel="facebox">Fork</a>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</h1>
|
|
||||||
@if(context.loginAccount.isDefined && groupNames.isEmpty){
|
|
||||||
<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 class="block">
|
<div class="block">
|
||||||
@if(originRepository.isDefined){
|
@if(originRepository.isDefined){
|
||||||
@helpers.avatarLink(originRepository.get.owner, 20)
|
@helpers.avatarLink(originRepository.get.owner, 20)
|
||||||
@@ -46,24 +30,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<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();
|
|
||||||
});
|
|
||||||
|
|
||||||
@if(context.loginAccount.isDefined){
|
|
||||||
$(document).on("click", "a#fork-link", function(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
$('#fork-form').submit();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user