(refs #488) WIP: Fixing the screen layout for the issue detail.

This commit is contained in:
shimamoto
2014-09-25 04:48:39 +09:00
parent 4dfa1fb0f8
commit 30994d0465
6 changed files with 63 additions and 25 deletions

View File

@@ -5,6 +5,7 @@
@import context._ @import context._
@import view.helpers._ @import view.helpers._
@if(loginAccount.isDefined){ @if(loginAccount.isDefined){
<hr/><br/>
<form method="POST" validate="true"> <form method="POST" validate="true">
<div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div> <div class="issue-avatar-image">@avatar(loginAccount.get.userName, 48)</div>
<div class="box issue-comment-box"> <div class="box issue-comment-box">

View File

@@ -5,20 +5,36 @@
pullreq: Option[model.PullRequest] = None)(implicit context: app.Context) pullreq: Option[model.PullRequest] = None)(implicit context: app.Context)
@import context._ @import context._
@import view.helpers._ @import view.helpers._
<div class="issue-avatar-image">@avatar(issue.openedUserName, 48)</div>
<div class="box issue-comment-box">
<div class="box-header-small">
@user(issue.openedUserName, styleClass="username strong") <span class="muted">commented on @datetime(issue.registeredDate)</span>
<span class="pull-right">
@if(hasWritePermission || loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
<a href="#"><i class="icon-pencil"></i></a>
}
</span>
</div>
<div class="box-content issue-content">
@markdown(issue.content getOrElse "No description provided.", repository, false, true)
</div>
</div>
@comments.map { comment => @comments.map { comment =>
@if(comment.action != "close" && comment.action != "reopen" && comment.action != "delete_branch"){ @if(comment.action != "close" && comment.action != "reopen" && comment.action != "delete_branch"){
<div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div> <div class="issue-avatar-image">@avatar(comment.commentedUserName, 48)</div>
<div class="box issue-comment-box" id="comment-@comment.commentId"> <div class="box issue-comment-box" id="comment-@comment.commentId">
<div class="box-header-small"> <div class="box-header-small">
<i class="icon-comment"></i>
@user(comment.commentedUserName, styleClass="username strong") @user(comment.commentedUserName, styleClass="username strong")
<span class="muted">
@if(comment.action == "comment"){ @if(comment.action == "comment"){
commented commented
} else { } else {
@if(pullreq.isEmpty){ referenced the issue } else { referenced the pull request } @if(pullreq.isEmpty){ referenced the issue } else { referenced the pull request }
} }
on @datetime(comment.registeredDate)
</span>
<span class="pull-right"> <span class="pull-right">
@datetime(comment.registeredDate)
@if(comment.action != "commit" && comment.action != "merge" && comment.action != "refer" && @if(comment.action != "commit" && comment.action != "merge" && comment.action != "refer" &&
(hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){ (hasWritePermission || loginAccount.map(_.userName == comment.commentedUserName).getOrElse(false))){
<a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>&nbsp; <a href="#" data-comment-id="@comment.commentId"><i class="icon-pencil"></i></a>&nbsp;

View File

@@ -10,30 +10,41 @@
@import view.helpers._ @import view.helpers._
@html.main(s"${issue.title} - Issue #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){ @html.main(s"${issue.title} - Issue #${issue.issueId} - ${repository.owner}/${repository.name}", Some(repository)){
@html.menu("issues", repository){ @html.menu("issues", repository){
@tab("issues", true, repository)
<ul class="nav nav-tabs pull-left fill-width"> <ul class="nav nav-tabs pull-left fill-width">
<li class="pull-left"><a href="@url(repository)/issues"><i class="icon-arrow-left"></i> Back to issue list</a></li> <li class="pull-left">
<li class="pull-right">Issue #@issue.issueId</li> <h1>@issue.title <span class="muted">#@issue.issueId</span></h1>
</ul>
<div class="row-fluid">
<div class="span10">
@issuedetail(issue, comments, collaborators, milestones, hasWritePermission, repository)
@commentlist(issue, comments, hasWritePermission, repository)
@commentform(issue, true, hasWritePermission, repository)
</div>
<div class="span2">
@if(issue.closed) { @if(issue.closed) {
<span class="label label-important issue-status">Closed</span> <span class="label label-important issue-status">Closed</span>
} else { } else {
<span class="label label-success issue-status">Open</span> <span class="label label-success issue-status">Open</span>
} }
<div class="small" style="text-align: center;"> <span class="muted">
@defining(comments.filter( _.action.contains("comment") ).size){ count => @user(issue.openedUserName, styleClass="username strong") opened this issue on @datetime(issue.registeredDate) - @defining(
<span class="strong">@count</span> @plural(count, "comment") comments.filter( _.action.contains("comment") ).size
){ count =>
@count @plural(count, "comment")
} }
</span>
<br/><br/>
</li>
<li class="pull-right">
<div>
@if(hasWritePermission || loginAccount.map(_.userName == issue.openedUserName).getOrElse(false)){
<a class="btn btn-small" href="#" id="edit">Edit</a>
}
<a class="btn btn-small btn-success" href="@url(repository)/issues/new">New issue</a>
</div> </div>
</li>
</ul>
<div class="row-fluid">
<div class="span10">
@commentlist(issue, comments, hasWritePermission, repository)
@commentform(issue, true, hasWritePermission, repository)
</div>
<div class="span2">
@issueinfo(issue, issueLabels, labels, hasWritePermission, repository)
<hr/> <hr/>
@issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository)
</div> </div>
</div> </div>
} }

View File

@@ -5,7 +5,7 @@
repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context) repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context)
@import view.helpers._ @import view.helpers._
<div style="margin-bottom: 8px;"> <div style="margin-bottom: 8px;">
<span class="strong">Labels</span> <span class="muted small strong">Labels</span>
@if(hasWritePermission){ @if(hasWritePermission){
<div class="pull-right"> <div class="pull-right">
@helper.html.dropdown(right = true) { @helper.html.dropdown(right = true) {
@@ -25,6 +25,17 @@
<ul class="label-list nav nav-pills nav-stacked"> <ul class="label-list nav nav-pills nav-stacked">
@labellist(issueLabels) @labellist(issueLabels)
</ul> </ul>
<hr/>
<div style="margin-bottom: 8px;">
<span class="muted small strong">Milestone</span>
</div>
<hr/>
<div style="margin-bottom: 8px;">
<span class="muted small strong">Assignee</span>
</div>
<script> <script>
$(function(){ $(function(){
$('a.toggle-label').click(function(){ $('a.toggle-label').click(function(){

View File

@@ -67,7 +67,7 @@
</div> </div>
} }
<hr/> <hr/>
@issues.html.labels(issue, issueLabels, labels, hasWritePermission, repository) @issues.html.issueinfo(issue, issueLabels, labels, hasWritePermission, repository)
</div> </div>
</div> </div>
<script> <script>

View File

@@ -638,7 +638,6 @@ a.selected {
} }
span.issue-status { span.issue-status {
display: block;
font-size: large; font-size: large;
text-align: center; text-align: center;
padding: 8px; padding: 8px;