More friendly filter

This commit is contained in:
Šesták Vít
2017-03-16 17:24:54 +01:00
parent d45c84b690
commit 81e757d04d
4 changed files with 15 additions and 9 deletions

View File

@@ -32,7 +32,7 @@
padding-top: 10px;
}
#project-selector button{
max-width: 200px;
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -40,8 +40,9 @@
max-height: 300px;
overflow: auto;
}
#project-selector .base-project a{
font-weight: bolder;
#project-selector .subproject a{
margin-left: 5px;
font-size: smaller;
}
h3.library-identification{

View File

@@ -97,7 +97,7 @@ final case class TeamFilter(team: Team) extends Filter{
object NoFilter extends Filter{
override def filters: Boolean = false
override val descriptionHtml: Html = views.html.filters.all()
override def descriptionText: String = "all projects"
override def descriptionText: String = "no filter selected"
override def subReports(r: Result): Option[Result] = Some(r)
override def selector: Option[String] = None
}

View File

@@ -1 +1 @@
<b>all</b>
<b>filter by team or project</b>

View File

@@ -55,17 +55,22 @@
@for((ProjectsWithSelection(filter, projects, teams), link) <- projectsOption){
<div id="project-selector">
<div class="dropdown">
<button class="btn @if(filter.filters){btn-warning}else{btn-primary} dropdown-toggle" type="button" data-toggle="dropdown">@filter.descriptionHtml
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<span class="glyphicon glyphicon-filter" aria-hidden="true"></span>
@filter.descriptionHtml
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="@link(None)"><i>all projects</i></a></li>
<li class="base-project"><a href="#">Teams</a></li>
<li><a href="@link(None)"><i>(no filter)</i></a></li>
<li class="divider"></li>
<li class="dropdown-header">Filter by team</li>
@for(team <- teams.toIndexedSeq.sortBy(_.name.toLowerCase)){
<li><a href="@link(Some("team:"+team.id))" title="team leader: @team.leader">@team.name</a></li>
}
<li class="divider"></li>
<li class="dropdown-header">Filter by project</li>
@for(report <- projects.sortedReportsInfo){
<li@if(report.subprojectNameOption.isEmpty){ class="base-project"}><a href="@link(Some("project:"+report.fullId))">@friendlyProjectName(report)</a></li>
<li@if(report.subprojectNameOption.nonEmpty){ class="subproject"}><a href="@link(Some("project:"+report.fullId))">@friendlyProjectName(report)</a></li>
}
</ul>
</div>