(refs #437)Show author at repo file list view

This commit is contained in:
Tomofumi Tanaka
2014-07-29 00:55:26 +09:00
parent 2bb1f6168a
commit 51a56356cb
3 changed files with 11 additions and 11 deletions

View File

@@ -64,7 +64,7 @@ trait WikiService {
if(!JGitUtil.isEmpty(git)){ if(!JGitUtil.isEmpty(git)){
JGitUtil.getFileList(git, "master", ".").find(_.name == pageName + ".md").map { file => JGitUtil.getFileList(git, "master", ".").find(_.name == pageName + ".md").map { file =>
WikiPageInfo(file.name, StringUtil.convertFromByteArray(git.getRepository.open(file.id).getBytes), WikiPageInfo(file.name, StringUtil.convertFromByteArray(git.getRepository.open(file.id).getBytes),
file.committer, file.time, file.commitId) file.author, file.time, file.commitId)
} }
} else None } else None
} }

View File

@@ -47,15 +47,15 @@ object JGitUtil {
* @param id the object id * @param id the object id
* @param isDirectory whether is it directory * @param isDirectory whether is it directory
* @param name the file (or directory) name * @param name the file (or directory) name
* @param time the last modified time
* @param message the last commit message * @param message the last commit message
* @param commitId the last commit id * @param commitId the last commit id
* @param committer the last committer name * @param time the last modified time
* @param author the last committer name
* @param mailAddress the committer's mail address * @param mailAddress the committer's mail address
* @param linkUrl the url of submodule * @param linkUrl the url of submodule
*/ */
case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, time: Date, message: String, commitId: String, case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, message: String, commitId: String,
committer: String, mailAddress: String, linkUrl: Option[String]) time: Date, author: String, mailAddress: String, linkUrl: Option[String])
/** /**
* The commit data. * The commit data.
@@ -240,11 +240,11 @@ object JGitUtil {
objectId, objectId,
fileMode == FileMode.TREE || fileMode == FileMode.GITLINK, fileMode == FileMode.TREE || fileMode == FileMode.GITLINK,
name, name,
commit.getCommitterIdent.getWhen,
getSummaryMessage(commit.getFullMessage, commit.getShortMessage), getSummaryMessage(commit.getFullMessage, commit.getShortMessage),
commit.getName, commit.getName,
commit.getCommitterIdent.getName, commit.getAuthorIdent.getWhen,
commit.getCommitterIdent.getEmailAddress, commit.getAuthorIdent.getName,
commit.getAuthorIdent.getEmailAddress,
linkUrl) linkUrl)
} }
}.sortWith { (file1, file2) => }.sortWith { (file1, file2) =>

View File

@@ -41,8 +41,8 @@
<td colspan="4" class="latest-commit"> <td colspan="4" class="latest-commit">
<div> <div>
@avatar(latestCommit, 20) @avatar(latestCommit, 20)
@user(latestCommit.committerName, latestCommit.committerEmailAddress, "username strong") @user(latestCommit.authorName, latestCommit.authorEmailAddress, "username strong")
<span class="muted">@datetime(latestCommit.commitTime)</span> <span class="muted">@datetime(latestCommit.authorTime)</span>
<div class="pull-right align-right monospace" style="line-height: 18px;"> <div class="pull-right align-right monospace" style="line-height: 18px;">
<a href="@url(repository)/commit/@latestCommit.id" class="commit-id"><span class="muted">latest commit</span> @latestCommit.id.substring(0, 10)</a> <a href="@url(repository)/commit/@latestCommit.id" class="commit-id"><span class="muted">latest commit</span> @latestCommit.id.substring(0, 10)</a>
</div> </div>
@@ -83,7 +83,7 @@
</td> </td>
<td class="mute"> <td class="mute">
<a href="@url(repository)/commit/@file.commitId" class="commit-message">@link(file.message, repository)</a> <a href="@url(repository)/commit/@file.commitId" class="commit-message">@link(file.message, repository)</a>
[@user(file.committer, file.mailAddress)] [@user(file.author, file.mailAddress)]
</td> </td>
<td style="text-align: right;">@datetime(file.time)</td> <td style="text-align: right;">@datetime(file.time)</td>
</tr> </tr>