mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
Add wiki history page.
This commit is contained in:
@@ -2,6 +2,7 @@ package app
|
||||
|
||||
import util.{WikiUtil, JGitUtil}
|
||||
import jp.sf.amateras.scalatra.forms._
|
||||
import org.eclipse.jgit.api.Git
|
||||
|
||||
class WikiController extends ControllerBase {
|
||||
|
||||
@@ -68,4 +69,12 @@ class WikiController extends ControllerBase {
|
||||
html.wikipages(WikiUtil.getPageList(owner, repository),
|
||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
||||
}
|
||||
|
||||
get("/:owner/:repository/wiki/_history"){
|
||||
val owner = params("owner")
|
||||
val repository = params("repository")
|
||||
|
||||
html.wikihistory(JGitUtil.getCommitLog(Git.open(WikiUtil.getWikiRepositoryDir(owner, repository)), "master", 100)._1,
|
||||
JGitUtil.getRepositoryInfo(owner, repository, servletContext))
|
||||
}
|
||||
}
|
||||
33
src/main/twirl/wikihistory.scala.html
Normal file
33
src/main/twirl/wikihistory.scala.html
Normal file
@@ -0,0 +1,33 @@
|
||||
@(commits: List[app.CommitInfo], repository: app.RepositoryInfo)(implicit context: app.Context)
|
||||
@import view.helpers
|
||||
@import context._
|
||||
@main("History - " + repository.owner + "/" + repository.name){
|
||||
@header("wiki", repository)
|
||||
@wikitab("history", repository)
|
||||
<ul class="nav nav-tabs">
|
||||
<li>
|
||||
<h1 class="wiki-title"><span class="description">Pages</span></h1>
|
||||
</li>
|
||||
<li class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a class="btn" href="@path/@repository.owner/@repository.name/wiki/_new">New Page</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<input type="button" value="Compare Revisions" class="btn"/>
|
||||
<table class="table table-bordered">
|
||||
@commits.map { commit =>
|
||||
<tr>
|
||||
<td width="0%"><input type="checkbox"></td>
|
||||
<td><a href="@path/@commit.committer">@commit.committer</a></td>
|
||||
<td width="80%">
|
||||
<span class="description">@helpers.datetime(commit.time):</span>
|
||||
@commit.message
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
</table>
|
||||
<input type="button" value="Compare Revisions" class="btn"/>
|
||||
<input type="button" value="Back to Top" class="btn"/>
|
||||
}
|
||||
@@ -3,6 +3,6 @@
|
||||
<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 == "pages"){ class="active"}><a href="@path/@repository.owner/@repository.name/wiki/_pages">Pages</a></li>
|
||||
<li@if(active == "history"){ class="active"}><a href="">Wiki History</a></li>
|
||||
<li@if(active == "history"){ class="active"}><a href="@path/@repository.owner/@repository.name/wiki/_history">Wiki History</a></li>
|
||||
<li@if(active == "git"){ class="active"}><a href="">Git Access</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user