Newer
Older
gitbucket_jkp / src / main / twirl / dashboard / header.scala.html
@Naoki Takezoe Naoki Takezoe on 2 Nov 2014 3 KB (refs #529)Organization filter
@(openCount: Int,
  closedCount: Int,
  condition: service.IssuesService.IssueSearchCondition,
  groups: List[String])(implicit context: app.Context)
@import context._
@import view.helpers._
<span class="small">
  <a class="button-link@if(condition.state == "open"){ selected}" href="@condition.copy(state = "open").toURL">
    <img src="@assets/common/images/status-open@(if(condition.state == "open"){"-active"}).png"/>
    @openCount Open
  </a>&nbsp;&nbsp;
  <a class="button-link@if(condition.state == "closed"){ selected}" href="@condition.copy(state = "closed").toURL">
    <img src="@assets/common/images/status-closed@(if(condition.state == "closed"){"-active"}).png"/>
    @closedCount Closed
  </a>
</span>
<div class="pull-right" id="table-issues-control">
  @helper.html.dropdown("Visibility", flat = true){
    <li>
      <a href="@(condition.copy(visibility = (if(condition.visibility == Some("private")) None else Some("private"))).toURL)">
        @helper.html.checkicon(condition.visibility == Some("private"))
        Private repository only
      </a>
    </li>
    <li>
      <a href="@(condition.copy(visibility = (if(condition.visibility == Some("public")) None else Some("public"))).toURL)">
        @helper.html.checkicon(condition.visibility == Some("public"))
        Public repository only
      </a>
    </li>
  }
  @helper.html.dropdown("Organization", flat = true){
    @groups.map { group =>
      <li>
        <a href="@((if(condition.groups.contains(group)) condition.copy(groups = condition.groups - group) else condition.copy(groups = condition.groups + group)).toURL)">
          @helper.html.checkicon(condition.groups.contains(group))
          @avatar(group, 20) @group
        </a>
      </li>
    }
  }
  @helper.html.dropdown("Sort", flat = true){
    <li>
      <a href="@condition.copy(sort="created",  direction="desc").toURL">
        @helper.html.checkicon(condition.sort == "created"  && condition.direction == "desc") Newest
      </a>
    </li>
    <li>
      <a href="@condition.copy(sort="created",  direction="asc" ).toURL">
        @helper.html.checkicon(condition.sort == "created"  && condition.direction == "asc") Oldest
      </a>
    </li>
    <li>
      <a href="@condition.copy(sort="comments", direction="desc").toURL">
       @helper.html.checkicon(condition.sort == "comments"  && condition.direction == "desc") Most commented
      </a>
    </li>
    <li>
      <a href="@condition.copy(sort="comments", direction="asc" ).toURL">
        @helper.html.checkicon(condition.sort == "comments"  && condition.direction == "asc") Least commented
      </a>
    </li>
    <li>
      <a href="@condition.copy(sort="updated",  direction="desc").toURL">
        @helper.html.checkicon(condition.sort == "updated"  && condition.direction == "desc") Recently updated
      </a>
    </li>
    <li>
      <a href="@condition.copy(sort="updated",  direction="asc" ).toURL">
        @helper.html.checkicon(condition.sort == "updated"  && condition.direction == "asc") Least recently updated
      </a>
    </li>
  }
</div>