Newer
Older
GitBucket / src / main / twirl / gitbucket / core / dashboard / header.scala.html
@Naoki Takezoe Naoki Takezoe on 24 Mar 2016 2 KB Update dropdown UI
@(openCount: Int,
  closedCount: Int,
  condition: gitbucket.core.service.IssuesService.IssueSearchCondition,
  groups: List[String])(implicit context: gitbucket.core.controller.Context)
@import context._
@import gitbucket.core.view.helpers._
<div id="table-issues-control">
  @helper.html.dropdown("Visibility"){
    <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"){
    @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"){
    <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>