mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
(refs #677)Fix Fork button for non group users
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
<a title="You must be signed in to fork a repository" href="@path/signin" class="btn btn-small" style="margin-bottom: 10px;">Fork</a>
|
<a title="You must be signed in to fork a repository" href="@path/signin" class="btn btn-small" style="margin-bottom: 10px;">Fork</a>
|
||||||
} else {
|
} else {
|
||||||
@if(isNoGroup) {
|
@if(isNoGroup) {
|
||||||
<a href="@path/@repository.owner/@repository.name/fork" class="btn btn-small" style="margin-bottom: 10px;" data-account="@loginAccount.get.userName">Fork</a>
|
<a id="fork-link" href="javascript:void(0);" class="btn btn-small" style="margin-bottom: 10px;">Fork</a>
|
||||||
} else {
|
} else {
|
||||||
<a href="@path/@repository.owner/@repository.name/fork" class="btn btn-small" rel="facebox" style="margin-bottom: 10px;">Fork</a>
|
<a href="@path/@repository.owner/@repository.name/fork" class="btn btn-small" rel="facebox" style="margin-bottom: 10px;">Fork</a>
|
||||||
}
|
}
|
||||||
@@ -52,6 +52,11 @@
|
|||||||
<span class="add-on count"><a href="@url(repository)/network/members">@repository.forkedCount</a></span>
|
<span class="add-on count"><a href="@url(repository)/network/members">@repository.forkedCount</a></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if(loginAccount.isDefined && isNoGroup){
|
||||||
|
<form id="fork-form" method="post" action="@path/@repository.owner/@repository.name/fork">
|
||||||
|
<input type="hidden" name="account" value="@loginAccount.get.userName"/>
|
||||||
|
</form>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
<div class="head">
|
<div class="head">
|
||||||
@helper.html.repositoryicon(repository, true)
|
@helper.html.repositoryicon(repository, true)
|
||||||
@@ -194,19 +199,9 @@ $(function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
@if(loginAccount.isDefined){
|
@if(loginAccount.isDefined){
|
||||||
$(document).on("click", "a[data-account]", function(e) {
|
$(document).on("click", "a#fork-link", function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var form = $('<form/>', {
|
$('#fork-form').submit();
|
||||||
action: $(this).attr('href'),
|
|
||||||
method: "post"
|
|
||||||
});
|
|
||||||
var account = $('<input/>', {
|
|
||||||
type: "hidden",
|
|
||||||
name: "account",
|
|
||||||
value: $(this).data('account')
|
|
||||||
});
|
|
||||||
form.append(account);
|
|
||||||
form.submit();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user