(refs #2)Add issue and pull request icon.

This commit is contained in:
takezoe
2013-08-05 14:40:06 +09:00
parent 4ea23a96ae
commit b58c19b88b
7 changed files with 25 additions and 22 deletions

View File

@@ -51,6 +51,13 @@ object helpers extends AvatarImageProvider with LinkConverter with RequestCache
def link(value: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context): Html = def link(value: String, repository: service.RepositoryService.RepositoryInfo)(implicit context: app.Context): Html =
Html(convertRefsLinks(value, repository)) Html(convertRefsLinks(value, repository))
def cut(value: String, length: Int): String =
if(value.length > length){
value.substring(0, length) + "..."
} else {
value
}
def activityMessage(message: String)(implicit context: app.Context): Html = def activityMessage(message: String)(implicit context: app.Context): Html =
Html(message Html(message
.replaceAll("\\[issue:([^\\s]+?)/([^\\s]+?)#((\\d+))\\]" , s"""<a href="${context.path}/$$1/$$2/issues/$$3">$$1/$$2#$$3</a>""") .replaceAll("\\[issue:([^\\s]+?)/([^\\s]+?)#((\\d+))\\]" , s"""<a href="${context.path}/$$1/$$2/issues/$$3">$$1/$$2#$$3</a>""")

View File

@@ -149,8 +149,10 @@
<a href="@path/@issue.userName/@issue.repositoryName">@issue.repositoryName</a>&nbsp;&#xFF65; <a href="@path/@issue.userName/@issue.repositoryName">@issue.repositoryName</a>&nbsp;&#xFF65;
} }
@if(issue.isPullRequest){ @if(issue.isPullRequest){
<img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
<a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a> <a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
} else { } else {
<img src="@assets/common/images/issue-@(if(issue.closed) "closed" else "open").png"/>
<a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a> <a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-title">@issue.title</a>
} }
@labels.map { label => @labels.map { label =>
@@ -162,7 +164,7 @@
} }
#@issue.issueId #@issue.issueId
</span> </span>
<div class="small muted"> <div class="small muted" style="margin-left: 20px;">
Opened by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)&nbsp; Opened by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)&nbsp;
@if(commentCount > 0){ @if(commentCount > 0){
<i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a> <i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a>

View File

@@ -32,6 +32,7 @@
<div class="span9"> <div class="span9">
@if(hasWritePermission){ @if(hasWritePermission){
<div class="pull-right"> <div class="pull-right">
@helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.IssuesService.IssueLimit, 7, condition.toURL)
<a href="@url(repository)/compare" class="btn btn-success">New pull request</a> <a href="@url(repository)/compare" class="btn btn-success">New pull request</a>
</div> </div>
} }
@@ -96,29 +97,22 @@
@issues.map { case (issue, labels, commentCount) => @issues.map { case (issue, labels, commentCount) =>
<tr> <tr>
<td> <td>
@if(hasWritePermission){ <img src="@assets/common/images/pullreq-@(if(issue.closed) "closed" else "open").png"/>
<label class="checkbox" style="cursor: default;"> <a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a>
<input type="checkbox" value="@issue.issueId"/> <span class="pull-right muted">#@issue.issueId</span>
} <div style="margin-left: 20px;">
<a href="@path/@issue.userName/@issue.repositoryName/pull/@issue.issueId" class="issue-title">@issue.title</a> @issue.content.map { content =>
@labels.map { label => @cut(content, 90)
<span class="label-color small" style="background-color: #@label.color; color: #@label.fontColor; padding-left: 4px; padding-right: 4px">@label.labelName</span> }.getOrElse {
} <span class="muted">No description available</span>
<span class="pull-right muted">
@issue.assignedUserName.map { userName =>
@avatar(userName, 20, tooltip = true)
}
#@issue.issueId
</span>
<div class="small muted">
Opened by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)&nbsp;
@if(commentCount > 0){
<i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a>
} }
</div> </div>
@if(hasWritePermission){ <div class="small muted" style="margin-left: 20px;">
</label> @avatar(issue.openedUserName, 20) by <a href="@url(issue.openedUserName)" class="username">@issue.openedUserName</a> @datetime(issue.registeredDate)&nbsp;
} @if(commentCount > 0){
<i class="icon-comment"></i><a href="@path/@issue.userName/@issue.repositoryName/issues/@issue.issueId" class="issue-comment-count">@commentCount @plural(commentCount, "comment")</a>
}
</div>
</td> </td>
</tr> </tr>
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B