Update file browser and commit list UI

This commit is contained in:
Naoki Takezoe
2016-03-22 00:33:07 +09:00
parent e454f78c5a
commit e7a47fe3a4
4 changed files with 45 additions and 42 deletions

View File

@@ -4,21 +4,21 @@
@import context._ @import context._
@import gitbucket.core.view.helpers._ @import gitbucket.core.view.helpers._
@import gitbucket.core.model._ @import gitbucket.core.model._
<table class="table table-bordered">
@commits.map { day => @commits.map { day =>
<div class="muted"> <tr>
<i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime) <th rowspan="@day.size" width="100">@date(day.head.commitTime)</th>
</div> @day.zipWithIndex.map { case (commit, i) =>
<div class="list-group"> @if(i != 0){ <tr> }
@day.map { commit => <td>
<div class="list-group-item"> <div class="pull-right text-right">
<div class="btn-group pull-right"> <a href="@url(repository)/commit/@commit.id" class="monospace commit-message strong"><i class="octicon octicon-diff" style="color: black;"></i>@commit.id.substring(0, 7)</a><br>
<a href="@url(repository)/commit/@commit.id" class="btn btn-default monospace">@commit.id.substring(0, 7)</a> <a href="@url(repository)/tree/@commit.id" class="button-link">Browse files »</a>
<a href="@url(repository)/tree/@commit.id" class="btn btn-default"><i class="octicon octicon-code link"></i></a>
</div> </div>
<div> <div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div> <div class="commit-avatar-image">@avatarLink(commit, 40)</div>
<div> <div>
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a> <a href="@url(repository)/commit/@commit.id" class="commit-message strong">@link(commit.summary, repository)</a>
@if(commit.description.isDefined){ @if(commit.description.isDefined){
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a> <a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
} }
@@ -37,7 +37,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </td>
</tr>
} }
</div>
} }
</table>

View File

@@ -34,21 +34,21 @@
} }
</div> </div>
<table class="table table-bordered">
@commits.map { day => @commits.map { day =>
<div class="muted"> <tr>
<i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime) <th rowspan="@day.size" width="100">@date(day.head.commitTime)</th>
</div> @day.zipWithIndex.map { case (commit, i) =>
<div class="list-group"> @if(i != 0){ <tr> }
@day.map { commit => <td>
<div class="list-group-item"> <div class="pull-right text-right">
<div class="btn-group pull-right"> <a href="@url(repository)/commit/@commit.id" class="monospace commit-message strong"><i class="octicon octicon-diff" style="color: black;"></i>@commit.id.substring(0, 7)</a><br>
<a href="@url(repository)/commit/@commit.id" class="btn btn-default monospace">@commit.id.substring(0, 7)</a> <a href="@url(repository)/tree/@commit.id" class="button-link">Browse files »</a>
<a href="@url(repository)/tree/@commit.id" class="btn btn-default"><i class="octicon octicon-code link"></i></a>
</div> </div>
<div> <div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div> <div class="commit-avatar-image">@avatarLink(commit, 40)</div>
<div> <div>
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a> <a href="@url(repository)/commit/@commit.id" class="commit-message strong">@link(commit.summary, repository)</a>
@if(commit.description.isDefined){ @if(commit.description.isDefined){
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a> <a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
} }
@@ -67,12 +67,13 @@
</div> </div>
</div> </div>
</div> </div>
</div> </td>
</tr>
} }
</div>
} }
</table>
<nav style="text-align: center; margin-top: 30px"> <nav style="text-align: center; margin-top: 20px">
<ul class="pagination"> <ul class="pagination">
@if(page <= 1){ @if(page <= 1){
<li class="disabled"><span>Newer</span></li> <li class="disabled"><span>Newer</span></li>

View File

@@ -23,13 +23,21 @@
}, Some(repository)) { }, Some(repository)) {
@html.menu("code", repository, Some(branch), info, error){ @html.menu("code", repository, Some(branch), info, error){
<div class="head"> <div class="head">
@if(pathList.isEmpty){ <div class="pull-right pc">
<div class="pull-right pc"> <div class="btn-group">
@if(platform != "linux" && platform != null){ <a href="@url(repository)/find/@encodeRefName(branch)" class="btn btn-sm btn-default pc" data-hotkey="t"><i class="octicon octicon-search"></i></a>
<a href="@openRepoUrl(repository.httpUrl)" id="repository-clone-url" class="btn btn-sm btn-default"><i class="octicon octicon-desktop-download"></i></a> <a href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-sm btn-default"><i class="octicon octicon-history"></i></a>
}
<a href="@{url(repository)}/archive/@{encodeRefName(branch)}.zip" class="btn btn-sm btn-default">Download ZIP</a>
</div> </div>
</div>
@if(pathList.isEmpty){
@if(platform != "linux" && platform != null){
<div class="pull-right pc" style="margin-right: 5px;">
<div class="btn-group">
<a href="@openRepoUrl(repository.httpUrl)" id="repository-clone-url" class="btn btn-sm btn-default"><i class="octicon octicon-desktop-download"></i></a>
<a href="@{url(repository)}/archive/@{encodeRefName(branch)}.zip" class="btn btn-sm btn-default"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
</div>
</div>
}
<div class="pull-right pc"> <div class="pull-right pc">
<div style="width: 240px; margin-right: 5px; margin-left: 5px;"> <div style="width: 240px; margin-right: 5px; margin-left: 5px;">
@helper.html.copy("repository-url-copy", repository.httpUrl){ @helper.html.copy("repository-url-copy", repository.httpUrl){
@@ -59,33 +67,26 @@
</div> </div>
</div> </div>
} }
<div class="pull-right">
<div class="btn-group">
<a href="@url(repository)/new/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-sm btn-default pc" title="Create a new file here" @if(!hasWritePermission){disabled}>New file</i></a>
<a href="@url(repository)/find/@encodeRefName(branch)" class="btn btn-sm btn-default pc" data-hotkey="t">Find file</a>
@if(pathList.nonEmpty){
<a href="@url(repository)/commits/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-sm btn-default" data-toggle="tooltip" data-placement="bottom" title="Browse commits for this branch">History</a>
}
</div>
</div>
@helper.html.branchcontrol(branch, repository, hasWritePermission){ @helper.html.branchcontrol(branch, repository, hasWritePermission){
@repository.branchList.map { x => @repository.branchList.map { x =>
<li><a href="@url(repository)/tree/@encodeRefName(x)">@helper.html.checkicon(x == branch) @x</a></li> <li><a href="@url(repository)/tree/@encodeRefName(x)">@helper.html.checkicon(x == branch) @x</a></li>
} }
} }
@if(pathList.isEmpty){ @if(pathList.isEmpty){
@*
@branchPullRequest.map{ case (pullRequest, issue) => @branchPullRequest.map{ case (pullRequest, issue) =>
<a href="@url(repository)/pull/@pullRequest.issueId" class="btn btn-sm btn-pullrequest-branch" title="@issue.title" data-toggle="tooltip">View #@pullRequest.issueId</a> <a href="@url(repository)/pull/@pullRequest.issueId" class="btn btn-sm btn-pullrequest-branch" title="@issue.title" data-toggle="tooltip">View #@pullRequest.issueId</a>
}.getOrElse { }.getOrElse {
<a href="@url(repository)/compare?head=@urlEncode(encodeRefName(branch))" class="btn btn-sm btn-success" @if(loginAccount.isEmpty){disabled}>New pull request</a> <a href="@url(repository)/compare?head=@urlEncode(encodeRefName(branch))" class="btn btn-sm btn-success" @if(loginAccount.isEmpty){disabled}>New pull request</a>
} }
*@
} else { } else {
<a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> / <a href="@url(repository)/tree/@encodeRefName(branch)">@repository.name</a> /
@pathList.zipWithIndex.map { case (section, i) => @pathList.zipWithIndex.map { case (section, i) =>
<a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> / <a href="@url(repository)/tree/@encodeRefName(branch)/@pathList.take(i + 1).mkString("/")">@section</a> /
} }
} }
<a href="@url(repository)/new/@encodeRefName(branch)/@pathList.mkString("/")" class="btn btn-sm btn-default pc" title="Create a new file here" @if(!hasWritePermission){disabled}><i class="octicon octicon-plus"></i></a>
</div> </div>
<table class="table table-hover"> <table class="table table-hover">
@* @*

View File

@@ -487,7 +487,7 @@ div.repository-content {
display: inline-block; display: inline-block;
float: right; float: right;
position: relative; position: relative;
top: -3px; top: -6px;
height: 20px; height: 20px;
} }
.branches .branch-a-b-count{ .branches .branch-a-b-count{