From 7375ff9f977e273b9a1e6d8c70c82cdf831a454c Mon Sep 17 00:00:00 2001 From: Naoki Takezoe Date: Sat, 28 Mar 2015 17:01:41 +0900 Subject: [PATCH] (refs #677)Fix Fork button for non group users --- src/main/twirl/gitbucket/core/menu.scala.html | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/main/twirl/gitbucket/core/menu.scala.html b/src/main/twirl/gitbucket/core/menu.scala.html index 7da239aff..fa38262d3 100644 --- a/src/main/twirl/gitbucket/core/menu.scala.html +++ b/src/main/twirl/gitbucket/core/menu.scala.html @@ -40,18 +40,23 @@ @if(repository.commitCount > 0){
- @if(loginAccount.isEmpty){ - Fork - } else { - @if(isNoGroup) { - Fork + @if(loginAccount.isEmpty){ + Fork } else { - Fork + @if(isNoGroup) { + Fork + } else { + Fork + } } - } @repository.forkedCount
+ @if(loginAccount.isDefined && isNoGroup){ +
+ +
+ } }
@helper.html.repositoryicon(repository, true) @@ -194,19 +199,9 @@ $(function(){ }); @if(loginAccount.isDefined){ - $(document).on("click", "a[data-account]", function(e) { + $(document).on("click", "a#fork-link", function(e) { e.preventDefault(); - var form = $('
', { - action: $(this).attr('href'), - method: "post" - }); - var account = $('', { - type: "hidden", - name: "account", - value: $(this).data('account') - }); - form.append(account); - form.submit(); + $('#fork-form').submit(); }); }