Simplify commit list

This commit is contained in:
Naoki Takezoe
2016-03-16 16:07:33 +09:00
parent 1d085d52bb
commit 376b109602
7 changed files with 71 additions and 99 deletions

View File

@@ -9,7 +9,7 @@
@html.menu("issues", repository){ @html.menu("issues", repository){
<form action="@url(repository)/issues/new" method="POST" validate="true" class="form-group"> <form action="@url(repository)/issues/new" method="POST" validate="true" class="form-group">
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-9">
<div class="issue-avatar-image">@avatarLink(loginAccount.get.userName, 48)</div> <div class="issue-avatar-image">@avatarLink(loginAccount.get.userName, 48)</div>
<div class="panel panel-default issue-box"> <div class="panel panel-default issue-box">
<div class="panel-body"> <div class="panel-body">
@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="col-md-3">
@issueinfo(None, Nil, Nil, collaborators, milestones.map(x => (x, 0, 0)), labels, hasWritePermission, repository) @issueinfo(None, Nil, Nil, collaborators, milestones.map(x => (x, 0, 0)), labels, hasWritePermission, repository)
</div> </div>
</div> </div>

View File

@@ -47,11 +47,11 @@
</div> </div>
<hr> <hr>
<div class="row" style="margin-top: 15px;"> <div class="row" style="margin-top: 15px;">
<div class="col-md-10"> <div class="col-md-9">
@commentlist(Some(issue), comments, hasWritePermission, repository) @commentlist(Some(issue), comments, hasWritePermission, repository)
@commentform(issue, true, hasWritePermission, repository) @commentform(issue, true, hasWritePermission, repository)
</div> </div>
<div class="col-md-2"> <div class="col-md-3">
@issueinfo(Some(issue), comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository) @issueinfo(Some(issue), comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository)
</div> </div>
</div> </div>

View File

@@ -4,42 +4,40 @@
@import context._ @import context._
@import gitbucket.core.view.helpers._ @import gitbucket.core.view.helpers._
@import gitbucket.core.model._ @import gitbucket.core.model._
<div class="commit-list"> @commits.map { day =>
@commits.map { day => <div class="muted">
<div class="muted" style="background-color: white;"> <i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime)
<i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime) </div>
</div> <div class="list-group">
<div class="list-group box-commits"> @day.map { commit =>
@day.map { commit => <div class="list-group-item">
<div class="list-group-item"> <div class="btn-group pull-right">
<ul class="nav nav-pills pull-right"> <a href="@url(repository)/commit/@commit.id" class="btn btn-default monospace">@commit.id.substring(0, 7)</a>
<li><a href="@url(repository)/commit/@commit.id" class="link monospace" style="line-height: 16px;">@commit.id.substring(0, 7)</a></li> <a href="@url(repository)/tree/@commit.id" class="btn btn-default"><i class="octicon octicon-code link"></i></a>
<li><a href="@url(repository)/tree/@commit.id" style="line-height: 16px;"><i class="octicon octicon-code link"></i></a></li> </div>
</ul> <div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div>
<div> <div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div> <a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a>
@if(commit.description.isDefined){
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
}
<br>
@if(commit.description.isDefined){
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
}
<div> <div>
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a> @user(commit.authorName, commit.authorEmailAddress, "username")
@if(commit.description.isDefined){ <span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a> @if(commit.isDifferentFromAuthor) {
<span class="octicon octicon-arrow-right" style="margin-top : -2px;"></span>
@user(commit.committerName, commit.committerEmailAddress, "username")
<span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
} }
<br>
@if(commit.description.isDefined){
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
}
<div style="margin-top: 2px;">
@user(commit.authorName, commit.authorEmailAddress, "username")
<span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
@if(commit.isDifferentFromAuthor) {
<span class="octicon octicon-arrow-right" style="margin-top : -2px;"></span>
@user(commit.committerName, commit.committerEmailAddress, "username")
<span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
}
</div>
</div> </div>
</div> </div>
</div> </div>
} </div>
</div> }
} </div>
</div> }

View File

@@ -12,7 +12,7 @@
@import gitbucket.core.model._ @import gitbucket.core.model._
<div class="row"> <div class="row">
<div class="col-md-10"> <div class="col-md-9">
<div id="comment-list"> <div id="comment-list">
@issues.html.commentlist(Some(issue), comments, hasWritePermission, repository, Some(pullreq)) @issues.html.commentlist(Some(issue), comments, hasWritePermission, repository, Some(pullreq))
</div> </div>
@@ -44,7 +44,7 @@
@issues.html.commentform(issue, !merged, hasWritePermission, repository) @issues.html.commentform(issue, !merged, hasWritePermission, repository)
} }
</div> </div>
<div class="col-md-2"> <div class="col-md-3">
@issues.html.issueinfo(Some(issue), comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository) @issues.html.issueinfo(Some(issue), comments, issueLabels, collaborators, milestones, labels, hasWritePermission, repository)
</div> </div>
</div> </div>

View File

@@ -66,7 +66,7 @@
</span> </span>
} }
</div> </div>
<ul class="nav nav-tabs fill-width pull-left" id="pullreq-tab"> <ul class="nav nav-tabs fill-width" id="pullreq-tab">
<li><a href="#conversation">Conversation <span class="badge">@comments.flatMap @{ <li><a href="#conversation">Conversation <span class="badge">@comments.flatMap @{
case comment: IssueComment => Some(comment) case comment: IssueComment => Some(comment)
case _: CommitComment => None case _: CommitComment => None
@@ -74,7 +74,7 @@
<li><a href="#commits">Commits <span class="badge">@commits.size</span></a></li> <li><a href="#commits">Commits <span class="badge">@commits.size</span></a></li>
<li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li> <li><a href="#files">Files Changed <span class="badge">@diffs.size</span></a></li>
</ul> </ul>
<div class="tab-content fill-width pull-left"> <div class="tab-content fill-width" style="padding-top: 20px;">
<div class="tab-pane" id="conversation"> <div class="tab-pane" id="conversation">
@flash.get("error").map{ error => @flash.get("error").map{ error =>
<div class="alert alert-error">@error</div> <div class="alert alert-error">@error</div>

View File

@@ -33,45 +33,44 @@
} }
} }
</div> </div>
<div class="commit-list">
@commits.map { day => @commits.map { day =>
<div class="muted" style="background-color: white;"> <div class="muted">
<i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime) <i class="octicon octicon-git-commit"></i> Commits on @date(day.head.commitTime)
</div> </div>
<div class="list-group box-commits"> <div class="list-group">
@day.map { commit => @day.map { commit =>
<div class="list-group-item"> <div class="list-group-item">
<ul class="nav nav-pills pull-right"> <div class="btn-group pull-right">
<li><a href="@url(repository)/commit/@commit.id" class="link monospace" style="line-height: 16px;">@commit.id.substring(0, 7)</a></li> <a href="@url(repository)/commit/@commit.id" class="btn btn-default monospace">@commit.id.substring(0, 7)</a>
<li><a href="@url(repository)/tree/@commit.id" style="line-height: 16px;"><i class="octicon octicon-code link"></i></a></li> <a href="@url(repository)/tree/@commit.id" class="btn btn-default"><i class="octicon octicon-code link"></i></a>
</ul> </div>
<div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div>
<div> <div>
<div class="commit-avatar-image">@avatarLink(commit, 40)</div> <a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a>
@if(commit.description.isDefined){
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a>
}
<br>
@if(commit.description.isDefined){
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
}
<div> <div>
<a href="@url(repository)/commit/@commit.id" class="commit-message" style="font-weight: bold;">@link(commit.summary, repository)</a> @user(commit.authorName, commit.authorEmailAddress, "username")
@if(commit.description.isDefined){ <span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
<a href="javascript:void(0)" onclick="$('#description-@commit.id').toggle();" class="omit">...</a> @if(commit.isDifferentFromAuthor) {
<span class="octicon octicon-arrow-right" style="margin-top : -2px;"></span>
@user(commit.committerName, commit.committerEmailAddress, "username")
<span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
} }
<br>
@if(commit.description.isDefined){
<pre id="description-@commit.id" style="display: none;" class="commit-description">@link(commit.description.get, repository)</pre>
}
<div style="margin-top: 2px;">
@user(commit.authorName, commit.authorEmailAddress, "username")
<span class="muted">authored @helper.html.datetimeago(commit.authorTime)</span>
@if(commit.isDifferentFromAuthor) {
<span class="octicon octicon-arrow-right" style="margin-top : -2px;"></span>
@user(commit.committerName, commit.committerEmailAddress, "username")
<span class="muted">committed @helper.html.datetimeago(commit.authorTime)</span>
}
</div>
</div> </div>
</div> </div>
</div> </div>
} </div>
</div> }
} </div>
</div> }
<nav style="text-align: center; margin-top: 30px"> <nav style="text-align: center; margin-top: 30px">
<ul class="pagination"> <ul class="pagination">

View File

@@ -285,22 +285,6 @@ div.box-header {
margin-bottom: 0px; margin-bottom: 0px;
} }
.commit-list {
position: relative;
}
.commit-list::before {
position: absolute;
top: 0;
bottom: 0;
left: 6px;
z-index: -1;
display: block;
width: 2px;
content: "";
background-color: #f3f3f3;
}
ul.nav-pills .link { ul.nav-pills .link {
color: #4078c0; color: #4078c0;
} }
@@ -310,15 +294,6 @@ ul.nav-pills i.link {
height: 0; height: 0;
} }
div.box-commits {
background-color: white;
padding-left: 0px;
padding-right: 0px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 20px;
}
div.box-content { div.box-content {
background-color: white; background-color: white;
border: 1px solid #d8d8d8; border: 1px solid #d8d8d8;