diff --git a/src/main/scala/app/CreateRepositoryController.scala b/src/main/scala/app/CreateRepositoryController.scala index 3446d16..a5ebdf1 100644 --- a/src/main/scala/app/CreateRepositoryController.scala +++ b/src/main/scala/app/CreateRepositoryController.scala @@ -1,24 +1,25 @@ package app import util.Directory._ -import util.{LockUtil, JGitUtil, UsersAuthenticator, ReferrerAuthenticator} +import util._ import service._ import java.io.File import org.eclipse.jgit.api.Git import org.apache.commons.io._ import jp.sf.amateras.scalatra.forms._ import org.eclipse.jgit.lib.PersonIdent +import scala.Some class CreateRepositoryController extends CreateRepositoryControllerBase with RepositoryService with AccountService with WikiService with LabelsService with ActivityService - with UsersAuthenticator with ReferrerAuthenticator + with UsersAuthenticator with ReadableUsersAuthenticator /** * Creates new repository. */ trait CreateRepositoryControllerBase extends ControllerBase { self: RepositoryService with AccountService with WikiService with LabelsService with ActivityService - with UsersAuthenticator with ReferrerAuthenticator => + with UsersAuthenticator with ReadableUsersAuthenticator => case class RepositoryCreationForm(owner: String, name: String, description: Option[String], isPrivate: Boolean, createReadme: Boolean) @@ -113,7 +114,7 @@ } }) - post("/:owner/:repository/_fork")(referrersOnly { repository => + get("/:owner/:repository/fork")(readableUsersOnly { repository => val loginAccount = context.loginAccount.get val loginUserName = loginAccount.userName diff --git a/src/main/twirl/header.scala.html b/src/main/twirl/header.scala.html index c29a1f5..9937c17 100644 --- a/src/main/twirl/header.scala.html +++ b/src/main/twirl/header.scala.html @@ -3,7 +3,7 @@ @import view.helpers._
- + Fork @repository.forkedCount
@@ -49,12 +49,5 @@ location.href = $(this).find('a').attr('href'); return false; }); - - // TODO Execute by Ajax? - $('#fork').click(function(){ - var form = $('form#repository_form'); - form.attr('action', '@path/@repository.owner/@repository.name/_fork'); - form.submit(); - }); });