mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-01 02:56:08 +01:00
Refactor to use ProjectService instead of JGitUtil directly to retrieve project information.
This commit is contained in:
@@ -78,7 +78,7 @@ trait CreateRepositoryControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
def validate(name: String, value: String): Option[String] = {
|
def validate(name: String, value: String): Option[String] = {
|
||||||
if(!value.matches("^[a-zA-Z0-9\\-_]+$")){
|
if(!value.matches("^[a-zA-Z0-9\\-_]+$")){
|
||||||
Some("Repository name contains invalid character.")
|
Some("Repository name contains invalid character.")
|
||||||
} else if(getRepositories(context.loginUser).contains(value)){
|
} else if(getRepositories(context.loginUser, servletContext).contains(value)){
|
||||||
Some("Repository already exists.")
|
Some("Repository already exists.")
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
get("/:owner") {
|
get("/:owner") {
|
||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
|
|
||||||
html.user(owner, getProjects(owner, servletContext))
|
html.user(owner, getRepositories(owner, servletContext))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +72,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
||||||
val (logs, hasNext) = JGitUtil.getCommitLog(git, branchName, page, 30)
|
val (logs, hasNext) = JGitUtil.getCommitLog(git, branchName, page, 30)
|
||||||
|
|
||||||
repo.html.commits(Nil, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext),
|
repo.html.commits(Nil, branchName, getRepository(owner, repository, servletContext).get,
|
||||||
logs.splitWith{ (commit1, commit2) =>
|
logs.splitWith{ (commit1, commit2) =>
|
||||||
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
||||||
}, page, hasNext)
|
}, page, hasNext)
|
||||||
@@ -92,7 +92,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
||||||
val (logs, hasNext) = JGitUtil.getCommitLog(git, branchName, page, 30, path)
|
val (logs, hasNext) = JGitUtil.getCommitLog(git, branchName, page, 30, path)
|
||||||
|
|
||||||
repo.html.commits(path.split("/").toList, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext),
|
repo.html.commits(path.split("/").toList, branchName, getRepository(owner, repository, servletContext).get,
|
||||||
logs.splitWith{ (commit1, commit2) =>
|
logs.splitWith{ (commit1, commit2) =>
|
||||||
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
view.helpers.date(commit1.time) == view.helpers.date(commit2.time)
|
||||||
}, page, hasNext)
|
}, page, hasNext)
|
||||||
@@ -109,7 +109,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
val id = params("id") // branch name or commit id
|
val id = params("id") // branch name or commit id
|
||||||
val raw = params.get("raw").getOrElse("false").toBoolean
|
val raw = params.get("raw").getOrElse("false").toBoolean
|
||||||
val path = multiParams("splat").head //.replaceFirst("^tree/.+?/", "")
|
val path = multiParams("splat").head //.replaceFirst("^tree/.+?/", "")
|
||||||
val repositoryInfo = JGitUtil.getRepositoryInfo(owner, repository, servletContext)
|
val repositoryInfo = getRepository(owner, repository, servletContext).get
|
||||||
|
|
||||||
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
||||||
val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(id))
|
val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(id))
|
||||||
@@ -153,7 +153,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getRepositoryDir(owner, repository)){ git =>
|
||||||
val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(id))
|
val revCommit = JGitUtil.getRevCommitFromId(git, git.getRepository.resolve(id))
|
||||||
repo.html.commit(id, new JGitUtil.CommitInfo(revCommit),
|
repo.html.commit(id, new JGitUtil.CommitInfo(revCommit),
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext), JGitUtil.getDiffs(git, id))
|
getRepository(owner, repository, servletContext).get, JGitUtil.getDiffs(git, id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
repo.html.tags(JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
repo.html.tags(getRepository(owner, repository, servletContext).get)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -239,7 +239,7 @@ trait RepositoryViewerControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
// current branch
|
// current branch
|
||||||
revision,
|
revision,
|
||||||
// repository
|
// repository
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext),
|
getRepository(owner, repository, servletContext).get,
|
||||||
// current path
|
// current path
|
||||||
if(path == ".") Nil else path.split("/").toList,
|
if(path == ".") Nil else path.split("/").toList,
|
||||||
// latest commit
|
// latest commit
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import util.JGitUtil
|
import service._
|
||||||
|
|
||||||
class SettingsController extends ControllerBase {
|
class SettingsController extends SettingsControllerBase with ProjectService with AccountService
|
||||||
|
|
||||||
|
|
||||||
|
trait SettingsControllerBase extends ControllerBase { self: ProjectService =>
|
||||||
|
|
||||||
get("/:owner/:repository/settings") {
|
get("/:owner/:repository/settings") {
|
||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
@@ -14,14 +17,14 @@ class SettingsController extends ControllerBase {
|
|||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
settings.html.options(JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
settings.html.options(getRepository(owner, repository, servletContext).get)
|
||||||
}
|
}
|
||||||
|
|
||||||
get("/:owner/:repository/settings/collaborators") {
|
get("/:owner/:repository/settings/collaborators") {
|
||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
settings.html.collaborators(JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
settings.html.collaborators(getRepository(owner, repository, servletContext).get)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4,11 +4,10 @@ import service._
|
|||||||
import util.JGitUtil
|
import util.JGitUtil
|
||||||
import util.Directory._
|
import util.Directory._
|
||||||
import jp.sf.amateras.scalatra.forms._
|
import jp.sf.amateras.scalatra.forms._
|
||||||
import org.eclipse.jgit.api.Git
|
|
||||||
|
|
||||||
class WikiController extends WikiControllerBase with WikiService
|
class WikiController extends WikiControllerBase with WikiService with ProjectService with AccountService
|
||||||
|
|
||||||
trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
trait WikiControllerBase extends ControllerBase { self: WikiService with ProjectService =>
|
||||||
|
|
||||||
case class WikiPageEditForm(pageName: String, content: String, message: Option[String], currentPageName: String)
|
case class WikiPageEditForm(pageName: String, content: String, message: Option[String], currentPageName: String)
|
||||||
|
|
||||||
@@ -31,10 +30,8 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
getWikiPage(owner, repository, "Home") match {
|
getWikiPage(owner, repository, "Home") match {
|
||||||
case Some(page) => wiki.html.wiki("Home", page,
|
case Some(page) => wiki.html.wiki("Home", page, getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
case None => wiki.html.wikiedit("Home", None, getRepository(owner, repository, servletContext).get)
|
||||||
case None => wiki.html.wikiedit("Home", None,
|
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,10 +41,8 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val pageName = params("page")
|
val pageName = params("page")
|
||||||
|
|
||||||
getWikiPage(owner, repository, pageName) match {
|
getWikiPage(owner, repository, pageName) match {
|
||||||
case Some(page) => wiki.html.wiki(pageName, page,
|
case Some(page) => wiki.html.wiki(pageName, page, getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
case None => wiki.html.wikiedit(pageName, None, getRepository(owner, repository, servletContext).get)
|
||||||
case None => wiki.html.wikiedit(pageName, None,
|
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,8 +53,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
|
|
||||||
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
||||||
wiki.html.wikihistory(Some(page),
|
wiki.html.wikihistory(Some(page),
|
||||||
JGitUtil.getCommitLog(git, "master", path = page + ".md")._1,
|
JGitUtil.getCommitLog(git, "master", path = page + ".md")._1, getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,8 +65,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
|
|
||||||
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
||||||
wiki.html.wikicompare(Some(page),
|
wiki.html.wikicompare(Some(page),
|
||||||
getWikiDiffs(git, commitId(0), commitId(1)),
|
getWikiDiffs(git, commitId(0), commitId(1)), getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,8 +76,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
|
|
||||||
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
||||||
wiki.html.wikicompare(None,
|
wiki.html.wikicompare(None,
|
||||||
getWikiDiffs(git, commitId(0), commitId(1)),
|
getWikiDiffs(git, commitId(0), commitId(1)), getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,8 +86,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val page = params("page")
|
val page = params("page")
|
||||||
|
|
||||||
wiki.html.wikiedit(page,
|
wiki.html.wikiedit(page,
|
||||||
getWikiPage(owner, repository, page),
|
getWikiPage(owner, repository, page), getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
post("/:owner/:repository/wiki/_edit", editForm){ form =>
|
post("/:owner/:repository/wiki/_edit", editForm){ form =>
|
||||||
@@ -112,8 +103,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
wiki.html.wikiedit("", None,
|
wiki.html.wikiedit("", None, getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
post("/:owner/:repository/wiki/_new", newForm){ form =>
|
post("/:owner/:repository/wiki/_new", newForm){ form =>
|
||||||
@@ -140,8 +130,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val owner = params("owner")
|
val owner = params("owner")
|
||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
|
|
||||||
wiki.html.wikipages(getWikiPageList(owner, repository),
|
wiki.html.wikipages(getWikiPageList(owner, repository), getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get("/:owner/:repository/wiki/_history"){
|
get("/:owner/:repository/wiki/_history"){
|
||||||
@@ -150,8 +139,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
|
|
||||||
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
JGitUtil.withGit(getWikiRepositoryDir(owner, repository)){ git =>
|
||||||
wiki.html.wikihistory(None,
|
wiki.html.wikihistory(None,
|
||||||
JGitUtil.getCommitLog(git, "master")._1,
|
JGitUtil.getCommitLog(git, "master")._1, getRepository(owner, repository, servletContext).get)
|
||||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +148,7 @@ trait WikiControllerBase extends ControllerBase { self: WikiService =>
|
|||||||
val repository = params("repository")
|
val repository = params("repository")
|
||||||
val content = params("content")
|
val content = params("content")
|
||||||
contentType = "text/html"
|
contentType = "text/html"
|
||||||
view.helpers.markdown(content, JGitUtil.getRepositoryInfo(owner, repository, servletContext), true)
|
view.helpers.markdown(content, getRepository(owner, repository, servletContext).get, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -44,10 +44,19 @@ trait ProjectService { self: AccountService =>
|
|||||||
* @param userName the user name
|
* @param userName the user name
|
||||||
* @return the project list which is sorted in descending order of lastActivityDate.
|
* @return the project list which is sorted in descending order of lastActivityDate.
|
||||||
*/
|
*/
|
||||||
def getProjects(userName: String, servletContext: ServletContext): List[RepositoryInfo] = {
|
def getRepositories(userName: String, servletContext: ServletContext): List[RepositoryInfo] = {
|
||||||
(Query(Projects) filter(_.userId is getUserId(userName).bind) sortBy(_.lastActivityDate desc) list).map { project =>
|
(Query(Projects) filter(_.userId is getUserId(userName).bind) sortBy(_.lastActivityDate desc) list) map { project =>
|
||||||
val repositoryInfo = JGitUtil.getRepositoryInfo(userName, project.projectName, servletContext)
|
val repositoryInfo = JGitUtil.getRepositoryInfo(userName, project.projectName, servletContext)
|
||||||
RepositoryInfo(userName, project.projectName, project, repositoryInfo.branchList, repositoryInfo.tags)
|
RepositoryInfo(userName, project.projectName, repositoryInfo.url, project, repositoryInfo.branchList, repositoryInfo.tags)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def getRepository(userName: String, projectName: String, servletContext: ServletContext): Option[RepositoryInfo] = {
|
||||||
|
(Query(Projects) filter { project =>
|
||||||
|
(project.userId is getUserId(userName).bind) && (project.projectName is projectName.bind)
|
||||||
|
} firstOption) map { project =>
|
||||||
|
val repositoryInfo = JGitUtil.getRepositoryInfo(userName, project.projectName, servletContext)
|
||||||
|
RepositoryInfo(userName, project.projectName, repositoryInfo.url, project, repositoryInfo.branchList, repositoryInfo.tags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,5 +65,5 @@ trait ProjectService { self: AccountService =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
object ProjectService {
|
object ProjectService {
|
||||||
case class RepositoryInfo(owner: String, name: String, project: Project, branchList: List[String], tagInfo: List[util.JGitUtil.TagInfo])
|
case class RepositoryInfo(owner: String, name: String, url: String, project: Project, branchList: List[String], tags: List[util.JGitUtil.TagInfo])
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ object helpers {
|
|||||||
/**
|
/**
|
||||||
* Converts the issue number and the commit id to the link.
|
* Converts the issue number and the commit id to the link.
|
||||||
*/
|
*/
|
||||||
private def markdownFilter(value: String, repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context): String = {
|
private def markdownFilter(value: String, repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context): String = {
|
||||||
value
|
value
|
||||||
.replaceAll("#([0-9]+)", "[$0](%s/%s/%s/issue/$1)".format(context.path, repository.owner, repository.name))
|
.replaceAll("#([0-9]+)", "[$0](%s/%s/%s/issue/$1)".format(context.path, repository.owner, repository.name))
|
||||||
.replaceAll("[0-9a-z]{10,40}", "[$0](%s/%s/%s/commit/$0)".format(context.path, repository.owner, repository.name))
|
.replaceAll("[0-9a-z]{10,40}", "[$0](%s/%s/%s/commit/$0)".format(context.path, repository.owner, repository.name))
|
||||||
@@ -34,7 +34,7 @@ object helpers {
|
|||||||
/**
|
/**
|
||||||
* Converts Markdown of Wiki pages to HTML.
|
* Converts Markdown of Wiki pages to HTML.
|
||||||
*/
|
*/
|
||||||
def markdown(value: String, repository: util.JGitUtil.RepositoryInfo, wikiLink: Boolean)(implicit context: app.Context): twirl.api.Html = {
|
def markdown(value: String, repository: service.ProjectService.RepositoryInfo, wikiLink: Boolean)(implicit context: app.Context): twirl.api.Html = {
|
||||||
import org.pegdown._
|
import org.pegdown._
|
||||||
val html = new PegDownProcessor(Extensions.AUTOLINKS|Extensions.WIKILINKS|Extensions.FENCED_CODE_BLOCKS)
|
val html = new PegDownProcessor(Extensions.AUTOLINKS|Extensions.WIKILINKS|Extensions.FENCED_CODE_BLOCKS)
|
||||||
.markdownToHtml(markdownFilter(value, repository), new LinkRenderer(){
|
.markdownToHtml(markdownFilter(value, repository), new LinkRenderer(){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(diffs: Seq[util.JGitUtil.DiffInfo], repository: util.JGitUtil.RepositoryInfo, commitId: Option[String])(implicit context: app.Context)
|
@(diffs: Seq[util.JGitUtil.DiffInfo], repository: service.ProjectService.RepositoryInfo, commitId: Option[String])(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
||||||
@diffs.zipWithIndex.map { case (diff, i) =>
|
@diffs.zipWithIndex.map { case (diff, i) =>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(active: String, repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(active: String, repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<a href="@path/@repository.owner">@repository.owner</a> / <a href="@path/@repository.owner/@repository.name">@repository.name</a>
|
<a href="@path/@repository.owner">@repository.owner</a> / <a href="@path/@repository.owner/@repository.name">@repository.name</a>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(branch: String, repository: util.JGitUtil.RepositoryInfo, pathList: List[String], content: util.JGitUtil.ContentInfo, latestCommit: util.JGitUtil.CommitInfo)(implicit context: app.Context)
|
@(branch: String, repository: service.ProjectService.RepositoryInfo, pathList: List[String], content: util.JGitUtil.ContentInfo, latestCommit: util.JGitUtil.CommitInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@html.main(repository.owner+"/"+repository.name) {
|
@html.main(repository.owner+"/"+repository.name) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(branch: String, commit: util.JGitUtil.CommitInfo, repository: util.JGitUtil.RepositoryInfo, diffs: Seq[util.JGitUtil.DiffInfo])(implicit context: app.Context)
|
@(branch: String, commit: util.JGitUtil.CommitInfo, repository: service.ProjectService.RepositoryInfo, diffs: Seq[util.JGitUtil.DiffInfo])(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pathList: List[String], branch: String, repository: util.JGitUtil.RepositoryInfo, commits: Seq[Seq[util.JGitUtil.CommitInfo]], page: Int, hasNext: Boolean)(implicit context: app.Context)
|
@(pathList: List[String], branch: String, repository: service.ProjectService.RepositoryInfo, commits: Seq[Seq[util.JGitUtil.CommitInfo]], page: Int, hasNext: Boolean)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@html.main(repository.owner+"/"+repository.name) {
|
@html.main(repository.owner+"/"+repository.name) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(branch: String, repository: util.JGitUtil.RepositoryInfo, pathList: List[String], latestCommit: util.JGitUtil.CommitInfo, files: List[util.JGitUtil.FileInfo], readme: Option[String])(implicit context: app.Context)
|
@(branch: String, repository: service.ProjectService.RepositoryInfo, pathList: List[String], latestCommit: util.JGitUtil.CommitInfo, files: List[util.JGitUtil.FileInfo], readme: Option[String])(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@html.main(repository.owner + "/" + repository.name) {
|
@html.main(repository.owner + "/" + repository.name) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(id: String, repository: util.JGitUtil.RepositoryInfo, active: String)(implicit context: app.Context)
|
@(id: String, repository: service.ProjectService.RepositoryInfo, active: String)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@html.main(repository.owner + "/" + repository.name) {
|
@html.main(repository.owner + "/" + repository.name) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("Settings"){
|
@html.main("Settings"){
|
||||||
@html.header("settings", repository)
|
@html.header("settings", repository)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(active: String, repository: util.JGitUtil.RepositoryInfo)(body: Html)(implicit context: app.Context)
|
@(active: String, repository: service.ProjectService.RepositoryInfo)(body: Html)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("Settings"){
|
@html.main("Settings"){
|
||||||
@html.header("settings", repository)
|
@html.header("settings", repository)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pageName: String, page: service.WikiService.WikiPageInfo, repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(pageName: String, page: service.WikiService.WikiPageInfo, repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import context._
|
@import context._
|
||||||
@html.main(pageName + " - " + repository.owner + "/" + repository.name){
|
@html.main(pageName + " - " + repository.owner + "/" + repository.name){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pageName: Option[String], diffs: Seq[util.JGitUtil.DiffInfo], repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(pageName: Option[String], diffs: Seq[util.JGitUtil.DiffInfo], repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import context._
|
@import context._
|
||||||
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
@import org.eclipse.jgit.diff.DiffEntry.ChangeType
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pageName: String, page: Option[service.WikiService.WikiPageInfo], repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(pageName: String, page: Option[service.WikiService.WikiPageInfo], repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import context._
|
@import context._
|
||||||
@html.main((if(pageName == "") "New Page" else pageName) + " - " + repository.owner + "/" + repository.name){
|
@html.main((if(pageName == "") "New Page" else pageName) + " - " + repository.owner + "/" + repository.name){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pageName: Option[String], commits: List[util.JGitUtil.CommitInfo], repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(pageName: Option[String], commits: List[util.JGitUtil.CommitInfo], repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("History - " + repository.owner + "/" + repository.name){
|
@html.main("History - " + repository.owner + "/" + repository.name){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(pages: List[String], repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(pages: List[String], repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import view.helpers
|
@import view.helpers
|
||||||
@import context._
|
@import context._
|
||||||
@html.main("Pages - " + repository.owner + "/" + repository.name){
|
@html.main("Pages - " + repository.owner + "/" + repository.name){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@(active: String, repository: util.JGitUtil.RepositoryInfo)(implicit context: app.Context)
|
@(active: String, repository: service.ProjectService.RepositoryInfo)(implicit context: app.Context)
|
||||||
@import context._
|
@import context._
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li@if(active == "home"){ class="active"}><a href="@path/@repository.owner/@repository.name/wiki">Home</a></li>
|
<li@if(active == "home"){ class="active"}><a href="@path/@repository.owner/@repository.name/wiki">Home</a></li>
|
||||||
|
|||||||
Reference in New Issue
Block a user