Improve repository presentation.

This commit is contained in:
takezoe
2013-06-18 19:59:03 +09:00
parent 3fc468bd33
commit b72bbb6dcd
4 changed files with 52 additions and 35 deletions

View File

@@ -39,9 +39,10 @@ object JGitUtil {
* @param name the file (or directory) name
* @param time the last modified time
* @param message the last commit message
* @param commitId the last commit id
* @param committer the last committer name
*/
case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, time: Date, message: String, committer: String)
case class FileInfo(id: ObjectId, isDirectory: Boolean, name: String, time: Date, message: String, commitId: String, committer: String)
/**
* The commit data.
@@ -184,6 +185,7 @@ object JGitUtil {
name,
commits(path).getCommitterIdent.getWhen,
commits(path).getShortMessage,
commits(path).getName,
commits(path).getCommitterIdent.getName)
}.sortWith { (file1, file2) =>
(file1.isDirectory, file2.isDirectory) match {

View File

@@ -21,7 +21,7 @@
<div class="pull-left">
<a href="@path/@latestCommit.committer">@latestCommit.committer</a>
<span class="description">@helpers.datetime(latestCommit.time)</span>
@helpers.cut(latestCommit.message, 100)<br>
<a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id" class="commit-message">@helpers.cut(latestCommit.message, 100)</a>
</div>
<div class="btn-group pull-right">
<a class="btn btn-mini" href="?raw=true">Raw</a>

View File

@@ -10,53 +10,55 @@
<a href="@path/@repository.owner/@repository.name/tree/@branch/@pathList.take(i + 1).mkString("/")">@section</a> /
}
</div>
<table class="table table-file-list">
<tr>
<th colspan="4" style="font-weight: normal;">
<div>
<strong><a href="">@latestCommit.committer</a></strong>
@helpers.cut(latestCommit.message, 100)
<div class="box">
<table class="table table-file-list" style="border: 1px solid silver;">
<tr>
<th colspan="4" style="font-weight: normal;">
<div>
<strong><a href="@path/@repository.owner/@repository.name/@latestCommit.committer">@latestCommit.committer</a></strong>
<a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id" class="commit-message">@helpers.cut(latestCommit.message, 100)</a>
<div class="pull-right align-right">
@helpers.datetime(latestCommit.time)
<a href="@path/@repository.owner/@repository.name/commit/@latestCommit.id">@latestCommit.id.substring(0, 10)</a>
</div>
</div>
</th>
</tr>
@if(pathList.size > 0){
<tr>
<td width="16"></td>
<td><a href="@path/@repository.owner/@repository.name@if(pathList.size > 1){/tree/@branch/@pathList.init.mkString("/")}">..</a></td>
<td></td>
<td></td>
</tr>
}
@files.map { file =>
<tr>
<td width="16">
</div>
</th>
</tr>
@if(pathList.size > 0){
<tr>
<td width="16"></td>
<td><a href="@path/@repository.owner/@repository.name@if(pathList.size > 1){/tree/@branch/@pathList.init.mkString("/")}">..</a></td>
<td></td>
<td></td>
</tr>
}
@files.map { file =>
<tr>
<td width="16">
@if(file.isDirectory){
<img src="@path/assets/common/images/folder.png"/>
} else {
<img src="@path/assets/common/images/file.png"/>
}
</td>
<td>
</td>
<td>
@if(file.isDirectory){
<a href="@path/@repository.owner/@repository.name/tree@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
} else {
<a href="@path/@repository.owner/@repository.name/blob@{(branch :: pathList).mkString("/", "/", "/")}@file.name">@file.name</a>
}
</td>
<td>@helpers.datetime(file.time)</td>
<td>@helpers.cut(file.message, 60) [<a href="@path/@file.committer">@file.committer</a>]</td>
</tr>
}
</table>
</td>
<td>@helpers.datetime(file.time)</td>
<td><a href="@path/@repository.owner/@repository.name/commit/@file.commitId" class="commit-message">@helpers.cut(file.message, 60)</a> [<a href="@path/@file.committer">@file.committer</a>]</td>
</tr>
}
</table>
</div>
@readme.map { content =>
<table class="table table-bordered">
<tr>
<td>@helpers.markdown(content, repository, false, true, true)</td>
</tr>
</table>
<div class="box">
<div class="box-header">README.md</div>
<div class="box-content">@helpers.markdown(content, repository, false, true, true)</div>
</div>
}
}

View File

@@ -45,6 +45,15 @@ span.error {
font-size: small;
}
a.commit-message {
color: #333333;
}
a.commit-message:hover {
color: #333333;
}
.monospace {
font-family: monospace;
}
@@ -59,6 +68,10 @@ span.description {
color: gray;
}
table.table-file-list {
margin-bottom: 0px;
}
table.table th {
background-color: #d9edf7;
}