Newer
Older
gitbucket_jkp / src / main / twirl / dashboard / pullslist.scala.html
@(issues: List[service.IssuesService.IssueInfo],
  page: Int,
  openCount: Int,
  closedCount: Int,
  condition: service.IssuesService.IssueSearchCondition,
  filter: String,
  groups: List[String])(implicit context: app.Context)
@import context._
@import view.helpers._
@import service.IssuesService.IssueInfo
@*
<ul class="nav nav-pills-group pull-left fill-width">
  <li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/pulls/created_by@condition.toURL">Created</a></li>
  <li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/pulls/assigned@condition.toURL">Assigned</a></li>
  <li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/pulls/mentioned@condition.toURL">Mentioned</a></li>
  <li class="pull-right">
    <div class="input-prepend" style="margin-bottom: 0px;">
      <div class="btn-group">
        <button type="button" class="btn dropdown-toggle" data-toggle="dropdown" style="height: 34px;">
          Filter
          <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
          <li><a href="?q=is:open">Open issues and pull requests</a></li>
          <li><a href="?q=is:open+is:issue+author:@urlEncode(loginAccount.get.userName)">Your issues</a></li>
          <li><a href="?q=is:open+is:pr+author:@urlEncode(loginAccount.get.userName)">Your pull requests</a></li>
          <li><a href="?q=is:open+assignee:@urlEncode(loginAccount.get.userName)">Everything assigned to you</a></li>
          <li><a href="?q=is:open+mentions:@urlEncode(loginAccount.get.userName)">Everything mentioning you</a></li>
        </ul>
      </div>
      <input type="text" id="search-filter-box" class="input-xlarge" name="q" style="height: 24px;" value="is:@{if(active == "issues") "issue" else "pr"} @condition.toFilterString"/>
    </div>
  </li>
</ul>
*@
<table class="table table-bordered table-hover table-issues">
  <tr>
    <th style="background-color: #eee;">
      @dashboard.html.header(openCount, closedCount, condition, groups)
    </th>
  </tr>
  @issues.map { case IssueInfo(issue, labels, milestone, commentCount) =>
  <tr>
    <td>
      <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>
      <span class="pull-right muted">#@issue.issueId</span>
        <div style="margin-left: 20px;">
          @issue.content.map { content =>
            @cut(content, 90)
          }.getOrElse {
            <span class="muted">No description available</span>
          }
        </div>
      <div class="small muted" style="margin-left: 20px;">
        @avatarLink(issue.openedUserName, 20) by @user(issue.openedUserName, styleClass="username") @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>
  </tr>
  }
</table>
<div class="pull-right">
  @helper.html.paginator(page, (if(condition.state == "open") openCount else closedCount), service.PullRequestService.PullRequestLimit, 10, condition.toURL)
</div>