This repository has been archived by the owner on Jul 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(search): UI updates for search summary views.
- Creates reusable directive. - Adds Project/Primary Site counts/tables. Closes #687
- Loading branch information
Matthew Schranz
committed
Apr 21, 2015
1 parent
19008f9
commit f5e29d1
Showing
5 changed files
with
107 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module ngApp.search.directives { | ||
|
||
function SummaryTable(FacetService): ng.IDirective { | ||
return { | ||
restrict: "AE", | ||
templateUrl: "search/templates/search.summary.table.html", | ||
scope: { | ||
facet: "@", | ||
buckets: "=", | ||
title: "@", | ||
id: "@" | ||
}, | ||
controller: function($element, $scope) { | ||
$scope.FacetService = FacetService; | ||
|
||
$scope.toggleTableExpand = function() { | ||
$scope.expanded = !$scope.expanded; | ||
}; | ||
}, | ||
replace: true | ||
} | ||
} | ||
|
||
angular | ||
.module("search.directives", ["facets.services"]) | ||
.directive("summaryTable", SummaryTable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h4 class="panel-title">{{ title | translate }}</h4> | ||
</div> | ||
<table id="{{ id }}" class="table table-striped table-hover table-bordered" | ||
data-ng-class="{ 'summary-table': buckets.length > 5 }"> | ||
<thead> | ||
<tr> | ||
<th>{{ title | translate }}</th> | ||
<th># <span data-translate>Files</span></th> | ||
<th data-translate>File Size</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr data-ng-repeat='type in buckets' | ||
data-ng-hide="!expanded && $index > 5 && buckets.length > 5"> | ||
<th scope="row">{{type.key | translate | humanify: true:true }}</th> | ||
<td data-ng-click="FacetService.addTerm(facet, type.key)" class="text-right"> | ||
<a href="">{{ type.doc_count | number }}</a> | ||
</td> | ||
<td class="text-right">{{ type.file_size.value | size}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<a class="summary-toggle" data-ng-click="toggleTableExpand()" | ||
data-ng-if="buckets.length > 5"> | ||
<span data-ng-show="!expanded"> | ||
<span data-translate>Show</span> | ||
{{ buckets.length - 5}} | ||
<span data-translate>more</span> | ||
</span> | ||
<span data-ng-show="expanded" data-translate>Show Less</span> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters