diff --git a/src/main/scala/app/RepositoryViewerController.scala b/src/main/scala/app/RepositoryViewerController.scala index 6b8d2ad..3addf62 100644 --- a/src/main/scala/app/RepositoryViewerController.scala +++ b/src/main/scala/app/RepositoryViewerController.scala @@ -117,7 +117,7 @@ val (logs, hasNext) = JGitUtil.getCommitLog(Git.open(getRepositoryDir(owner, repository)), branchName, page, 30) - html.commits(Nil, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext), + repo.html.commits(Nil, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext), logs.splitWith{ (commit1, commit2) => view.helpers.date(commit1.time) == view.helpers.date(commit2.time) }, page, hasNext) @@ -135,7 +135,7 @@ val (logs, hasNext) = JGitUtil.getCommitLog(Git.open(getRepositoryDir(owner, repository)), branchName, page, 30, path) - html.commits(path.split("/").toList, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext), + repo.html.commits(path.split("/").toList, branchName, JGitUtil.getRepositoryInfo(owner, repository, servletContext), logs.splitWith{ (commit1, commit2) => view.helpers.date(commit1.time) == view.helpers.date(commit2.time) }, page, hasNext) @@ -183,7 +183,7 @@ val viewer = if(FileTypeUtil.isImage(path)) "image" else if(large) "large" else "text" val content = ContentInfo(viewer, if(viewer == "text") JGitUtil.getContent(git, objectId, false).map(new String(_, "UTF-8")) else None) - html.blob(id, repositoryInfo, path.split("/").toList, content, new CommitInfo(revCommit)) + repo.html.blob(id, repositoryInfo, path.split("/").toList, content, new CommitInfo(revCommit)) } } @@ -202,7 +202,7 @@ val revCommit = revWalk.parseCommit(objectId) revWalk.dispose - html.commit(id, new CommitInfo(revCommit), JGitUtil.getRepositoryInfo(owner, repository, servletContext), JGitUtil.getDiffs(git, id)) + repo.html.commit(id, new CommitInfo(revCommit), JGitUtil.getRepositoryInfo(owner, repository, servletContext), JGitUtil.getDiffs(git, id)) } /** @@ -236,7 +236,7 @@ new String(JGitUtil.getContent(Git.open(getRepositoryDir(owner, repository)), file.id, true).get, "UTF-8") } - html.files( + repo.html.files( // current branch revision, // repository diff --git a/src/main/twirl/blob.scala.html b/src/main/twirl/blob.scala.html deleted file mode 100644 index e197112..0000000 --- a/src/main/twirl/blob.scala.html +++ /dev/null @@ -1,71 +0,0 @@ -@(branch: String, repository: app.RepositoryInfo, pathList: List[String], content: app.ContentInfo, latestCommit: app.CommitInfo)(implicit context: app.Context) -@import context._ -@import view.helpers -@main(repository.owner+"/"+repository.name) { - @header("code", repository) - @navtab(branch, repository, "files") -
- @repository.name / - @pathList.zipWithIndex.map { case (path, i) => - @if(i == pathList.length - 1){ - @path - } else { - @path / - } - } -
- - - - - - - - -
-
- @latestCommit.committer - @helpers.datetime(latestCommit.time) - @helpers.cut(latestCommit.message, 100)
-
-
- Raw - History -
-
- @if(content.viewType == "text"){ -
@content.content.get
- } - @if(content.viewType == "image"){ - - } - @if(content.viewType == "large"){ -
- View Raw
- (Sorry about that, but we can't show files that are this big right now) -
- } -
- - - - - -} diff --git a/src/main/twirl/commit.scala.html b/src/main/twirl/commit.scala.html deleted file mode 100644 index b845598..0000000 --- a/src/main/twirl/commit.scala.html +++ /dev/null @@ -1,25 +0,0 @@ -@(branch: String, commit: app.CommitInfo, repository: app.RepositoryInfo, diffs: Seq[app.DiffInfo])(implicit context: app.Context) -@import context._ -@import view.helpers -@import org.eclipse.jgit.diff.DiffEntry.ChangeType -@main(helpers.cut(commit.message, 20)){ - @header("code", repository) - @navtab(branch, repository, "commits") - - - - - - - -
-
@helpers.format(commit.message)
-
@branch
-
- @commit.committer @helpers.datetime(commit.time) -
- commit @commit.id -
-
- @diff(diffs, repository, Some(commit.id)) -} diff --git a/src/main/twirl/commits.scala.html b/src/main/twirl/commits.scala.html deleted file mode 100644 index 9fe246f..0000000 --- a/src/main/twirl/commits.scala.html +++ /dev/null @@ -1,52 +0,0 @@ -@(pathList: List[String], branch: String, repository: app.RepositoryInfo, commits: Seq[Seq[app.CommitInfo]], page: Int, hasNext: Boolean)(implicit context: app.Context) -@import context._ -@import view.helpers -@main(repository.owner+"/"+repository.name) { - @header("code", repository) - @navtab(branch, repository, if(pathList.isEmpty) "commits" else "files") -
- @if(pathList.isEmpty){ - @repository.name / Commit History - } - @if(pathList.nonEmpty){ - History for - @repository.name / - @pathList.zipWithIndex.map { case (section, i) => - @if(i == pathList.length - 1){ - @section - } else { - @section / - } - } - } -
- - @commits.map { date => - - - - - @date.map { commit => - - - - } -
@helpers.date(date.head.time)
-
- @helpers.cut(commit.message, 100)
-
- @commit.committer - @helpers.datetime(commit.time) -
-
- -
- } -
- - -
-} \ No newline at end of file diff --git a/src/main/twirl/files.scala.html b/src/main/twirl/files.scala.html deleted file mode 100644 index e6d661e..0000000 --- a/src/main/twirl/files.scala.html +++ /dev/null @@ -1,62 +0,0 @@ -@(branch: String, repository: app.RepositoryInfo, pathList: List[String], latestCommit: app.CommitInfo, files: List[app.FileInfo], readme: Option[String])(implicit context: app.Context) -@import context._ -@import view.helpers -@main(repository.owner + "/" + repository.name) { - @header("code", repository) - @navtab(branch, repository, "files") -
- @repository.name / - @pathList.zipWithIndex.map { case (section, i) => - @section / - } -
- - - - - @if(pathList.size > 0){ - - - - - - - } - @files.map { file => - - - - - - - } -
-
- @latestCommit.committer - @helpers.cut(latestCommit.message, 100) -
- @helpers.datetime(latestCommit.time) - @latestCommit.id.substring(0, 10) -
-
-
..
- @if(file.isDirectory){ - - } else { - - } - - @if(file.isDirectory){ - @file.name - } else { - @file.name - } - @helpers.datetime(file.time)@helpers.cut(file.message, 60) [@file.committer]
- @readme.map { content => - - - - -
@helpers.markdown(content)
- } -} \ No newline at end of file diff --git a/src/main/twirl/navtab.scala.html b/src/main/twirl/navtab.scala.html deleted file mode 100644 index 4c4689c..0000000 --- a/src/main/twirl/navtab.scala.html +++ /dev/null @@ -1,30 +0,0 @@ -@(id: String, repository: app.RepositoryInfo, active: String)(implicit context: app.Context) -@import context._ - diff --git a/src/main/twirl/repo/blob.scala.html b/src/main/twirl/repo/blob.scala.html new file mode 100644 index 0000000..29cc66a --- /dev/null +++ b/src/main/twirl/repo/blob.scala.html @@ -0,0 +1,71 @@ +@(branch: String, repository: app.RepositoryInfo, pathList: List[String], content: app.ContentInfo, latestCommit: app.CommitInfo)(implicit context: app.Context) +@import context._ +@import view.helpers +@html.main(repository.owner+"/"+repository.name) { + @html.header("code", repository) + @navtab(branch, repository, "files") +
+ @repository.name / + @pathList.zipWithIndex.map { case (path, i) => + @if(i == pathList.length - 1){ + @path + } else { + @path / + } + } +
+ + + + + + + + +
+
+ @latestCommit.committer + @helpers.datetime(latestCommit.time) + @helpers.cut(latestCommit.message, 100)
+
+
+ Raw + History +
+
+ @if(content.viewType == "text"){ +
@content.content.get
+ } + @if(content.viewType == "image"){ + + } + @if(content.viewType == "large"){ +
+ View Raw
+ (Sorry about that, but we can't show files that are this big right now) +
+ } +
+ + + + + +} diff --git a/src/main/twirl/repo/commit.scala.html b/src/main/twirl/repo/commit.scala.html new file mode 100644 index 0000000..d52be85 --- /dev/null +++ b/src/main/twirl/repo/commit.scala.html @@ -0,0 +1,25 @@ +@(branch: String, commit: app.CommitInfo, repository: app.RepositoryInfo, diffs: Seq[app.DiffInfo])(implicit context: app.Context) +@import context._ +@import view.helpers +@import org.eclipse.jgit.diff.DiffEntry.ChangeType +@html.main(helpers.cut(commit.message, 20)){ + @html.header("code", repository) + @navtab(branch, repository, "commits") + + + + + + + +
+
@helpers.format(commit.message)
+
@branch
+
+ @commit.committer @helpers.datetime(commit.time) +
+ commit @commit.id +
+
+ @html.diff(diffs, repository, Some(commit.id)) +} diff --git a/src/main/twirl/repo/commits.scala.html b/src/main/twirl/repo/commits.scala.html new file mode 100644 index 0000000..61b870a --- /dev/null +++ b/src/main/twirl/repo/commits.scala.html @@ -0,0 +1,52 @@ +@(pathList: List[String], branch: String, repository: app.RepositoryInfo, commits: Seq[Seq[app.CommitInfo]], page: Int, hasNext: Boolean)(implicit context: app.Context) +@import context._ +@import view.helpers +@html.main(repository.owner+"/"+repository.name) { + @html.header("code", repository) + @navtab(branch, repository, if(pathList.isEmpty) "commits" else "files") +
+ @if(pathList.isEmpty){ + @repository.name / Commit History + } + @if(pathList.nonEmpty){ + History for + @repository.name / + @pathList.zipWithIndex.map { case (section, i) => + @if(i == pathList.length - 1){ + @section + } else { + @section / + } + } + } +
+ + @commits.map { date => + + + + + @date.map { commit => + + + + } +
@helpers.date(date.head.time)
+
+ @helpers.cut(commit.message, 100)
+
+ @commit.committer + @helpers.datetime(commit.time) +
+
+ +
+ } +
+ + +
+} \ No newline at end of file diff --git a/src/main/twirl/repo/files.scala.html b/src/main/twirl/repo/files.scala.html new file mode 100644 index 0000000..5d0fe92 --- /dev/null +++ b/src/main/twirl/repo/files.scala.html @@ -0,0 +1,62 @@ +@(branch: String, repository: app.RepositoryInfo, pathList: List[String], latestCommit: app.CommitInfo, files: List[app.FileInfo], readme: Option[String])(implicit context: app.Context) +@import context._ +@import view.helpers +@html.main(repository.owner + "/" + repository.name) { + @html.header("code", repository) + @navtab(branch, repository, "files") +
+ @repository.name / + @pathList.zipWithIndex.map { case (section, i) => + @section / + } +
+ + + + + @if(pathList.size > 0){ + + + + + + + } + @files.map { file => + + + + + + + } +
+
+ @latestCommit.committer + @helpers.cut(latestCommit.message, 100) +
+ @helpers.datetime(latestCommit.time) + @latestCommit.id.substring(0, 10) +
+
+
..
+ @if(file.isDirectory){ + + } else { + + } + + @if(file.isDirectory){ + @file.name + } else { + @file.name + } + @helpers.datetime(file.time)@helpers.cut(file.message, 60) [@file.committer]
+ @readme.map { content => + + + + +
@helpers.markdown(content)
+ } +} \ No newline at end of file diff --git a/src/main/twirl/repo/navtab.scala.html b/src/main/twirl/repo/navtab.scala.html new file mode 100644 index 0000000..4c4689c --- /dev/null +++ b/src/main/twirl/repo/navtab.scala.html @@ -0,0 +1,30 @@ +@(id: String, repository: app.RepositoryInfo, active: String)(implicit context: app.Context) +@import context._ +