Skip to content

Commit

Permalink
Merge pull request #9 from BRaimbault/v0.8-dev
Browse files Browse the repository at this point in the history
V0.8 dev - search: paging + fuzzy all: translation
  • Loading branch information
BRaimbault authored Aug 30, 2016
2 parents c15be24 + 6707d7e commit 44b880b
Show file tree
Hide file tree
Showing 14 changed files with 791 additions and 92 deletions.
2 changes: 1 addition & 1 deletion app/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

var dossiersEditorModule = angular.module('dossiersEditorModule', ['ui.tinymce']);
var dossiersReaderModule = angular.module('dossiersReaderModule', []);
var searchModule = angular.module('searchModule', []);
var searchModule = angular.module('searchModule', ['angularUtils.directives.dirPagination','angular.filter']);
var dossiersModule = angular.module('dossiersModule', ['dossiersEditorModule','dossiersReaderModule']);

var appModule = angular.module('appModule', ['ui.router', 'd2Menu', 'ngSanitize', 'pascalprecht.translate', 'ngResource', 'dossiersModule', 'searchModule']);
Expand Down
10 changes: 5 additions & 5 deletions app/dossiers/dossiers.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div ng-controller="dossiersMainController" id="DossierPanel" class="row">
<div id="headerDossierPanel" class="col-md-12 headerPanel">
<h1>{{'Health Services' | translate}}</h1>
<h1>{{'Services' | translate}}</h1>
<p>{{'Number of Services' | translate}}: {{services.organisationUnitGroups.length}}</p>
<p>{{'Number of DataSets in Service' | translate}}: {{serviceDataSets.dataSets.length}}</p>
<p>{{'Number of IndicatorGroups in Service' | translate}}: {{indicatorGroups.indicatorGroups.length}}</p>
Expand All @@ -18,7 +18,7 @@ <h1>{{'Health Services' | translate}}</h1>
<h1 class="col-md-12">{{selectedService.displayName}}</h1>

<div id="tocContainer" class="col-md-11">
<h3 ng-if="selectedService" style="text-decoration: underline;">{{'Table Of Content'| translate}}</h3>
<h3 ng-if="selectedService" style="text-decoration: underline;">{{'Table of Content'| translate}}</h3>
<ul ng-repeat="i in toc.entries | orderBy:'parent.displayName'">
<li><a href="" class="pageref" ng-click="scrollTo(i.parent.id)" target="_self">{{i.parent.displayName}}</a>
<ul ng-repeat="j in i.children">
Expand All @@ -38,7 +38,7 @@ <h2 class="dataset" id="{{selectedSet.id}}">{{selectedSet.displayName}}</h2>

<div class="col-md-12" ng-repeat="section in sections.sections">
<h3 class="section" id="{{section.id}}">{{section.displayName}}</h3>
<p>{{'Number of elements in section'| translate}}: {{section.dataElements.length}}</p>
<p>{{'Number of Elements in Section'| translate}}: {{section.dataElements.length}}</p>
<table ng-controller="dossiersElementsTableController" ng-init="getElementsInSection(section)" class="sectionElementsTable table table-striped">
<thead>
<tr>
Expand All @@ -61,11 +61,11 @@ <h3 class="section" id="{{section.id}}">{{section.displayName}}</h3>
<div class="col-md-12" id="IndicatorGroupsContainer" ng-repeat="selectedGrp in indicatorGroups.indicatorGroups | orderBy: 'displayName'">
<h3 class="indicatorGroup" id="{{selectedGrp.id}}">{{'Indicator Group' | translate}}: {{selectedGrp.displayName}}</h3>
<div ng-controller="dossiersIndicatorController" class="col-md-12">
<p>{{'Number of indicators in group' | translate}}: {{indicatorGroup.indicators.length}}</p>
<p>{{'Number of Indicators in Group' | translate}}: {{indicatorGroup.indicators.length}}</p>
<table class="indicatorTable table table-striped">
<thead>
<tr>
<th>{{'Nameindicator' | translate}}</th>
<th>{{'NameIndicator' | translate}}</th>
<th>{{'DescriptionIndicator' | translate}}</th>
<th>{{'NumeratorIndicator' | translate}}</th>
<th>{{'DenominatorIndicator' | translate}}</th>
Expand Down
4 changes: 4 additions & 0 deletions app/search/search.css.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
.highlighted {
color: red;
}

td {
height: 50px;
}
2 changes: 1 addition & 1 deletion app/search/search.filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
searchModule.filter('highlight', function($sce) {
return function(text, phrase) {
if (phrase && text) {
text = text.replace(new RegExp('(' + phrase + ')', 'gi'), '<span class="highlighted">$1</span>');
text = text.replace(new RegExp('[' + phrase + ']+', 'gi'), '<span class="highlighted">$&</span>');
}
return $sce.trustAsHtml(text);
}
Expand Down
19 changes: 10 additions & 9 deletions app/search/search.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ <h1>{{'Search' | translate}}</h1>
<div class="col-md-3">
<input type="text" class="form-control ng-valid ng-dirty" ng-model="search.text" title="Type text to search here">
</div>
<div class="col-md-6 btn-group" role="group" data-toggle="buttons" aria-label="...">
<div class="col-md-5 btn-group" role="group" data-toggle="buttons" aria-label="...">
<label class="btn btn-default active" ng-click="getAllObjects()">
<input type="radio" name="options" id="option1" autocomplete="off" checked> All
<input type="radio" name="options" id="option1" autocomplete="off" checked> {{'All' | translate}}
</label>
<label class="btn btn-default" ng-click="getAllDataElements()">
<input type="radio" name="options" id="option2" autocomplete="off"> Data Elements
<input type="radio" name="options" id="option2" autocomplete="off"> {{'DataElements' | translate}}
</label>
<label class="btn btn-default" ng-click="getAllIndicators()">
<input type="radio" name="options" id="option4" autocomplete="off"> Indicators
<input type="radio" name="options" id="option4" autocomplete="off"> {{'Indicators' | translate}}
</label>
</div>
<div class="col-md-12"><br></div>
Expand All @@ -34,13 +34,14 @@ <h1>{{'Search' | translate}}</h1>
</tr>
</thead>
<tbody>
<tr ng-repeat="oneObject in allObjects | filter:search.text | orderBy: 'type + displayName'">
<td><span ng-bind-html='oneObject.type | highlight:search.text'></span></td>
<tr dir-paginate="oneObject in allObjects | fuzzyBy: 'displayName': search.text | orderBy: 'type + displayName' | itemsPerPage: 10">
<td><span ng-bind-html='oneObject.type'></span></td>
<td><span ng-bind-html='oneObject.displayName | highlight:search.text'></span></td>
<td><span ng-bind-html='getDescription(oneObject) | highlight:search.text'></span></td>
<td><span ng-bind-html='getParents(oneObject) | highlight:search.text'></span></td>
<td><span ng-bind-html='getDescription(oneObject)'></span></td>
<td><span ng-bind-html='getParents(oneObject)'></span></td>
</tr>
</tbody>
</table>
</div>
<dir-pagination-controls boundary-links="true"></dir-pagination-controls>
</div>
</div>
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"angular-ui-router": "0.2.18",
"angular-ui-tinymce": "0.0.16",
"bootstrap": "3.3.6",
"bootstrap-ui": "2.1.3",
"bootstrap-vertical-tabs": "1.2.1",
"jquery": "2.2.0",
"tinymce": "4.4.1"
Expand Down
6 changes: 6 additions & 0 deletions bower_components/angular-filter/angular-filter.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 44b880b

Please sign in to comment.