mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 14:07:55 +01:00
Closes #158: advanced search form
This commit is contained in:
parent
23660961bd
commit
00452cc505
@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* Document controller.
|
* Document controller.
|
||||||
*/
|
*/
|
||||||
angular.module('docs').controller('Document', function ($scope, $rootScope, $timeout, $state, Restangular, $q) {
|
angular.module('docs').controller('Document', function ($scope, $rootScope, $timeout, $state, Restangular, $q, $filter) {
|
||||||
/**
|
/**
|
||||||
* Scope variables.
|
* Scope variables.
|
||||||
*/
|
*/
|
||||||
@ -189,11 +189,15 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
|
|||||||
if (!_.isEmpty($scope.advsearch.language)) {
|
if (!_.isEmpty($scope.advsearch.language)) {
|
||||||
search += 'lang:' + $scope.advsearch.language + ' ';
|
search += 'lang:' + $scope.advsearch.language + ' ';
|
||||||
}
|
}
|
||||||
$scope.advsearch.after_date;
|
if (!_.isUndefined($scope.advsearch.after_date)) {
|
||||||
$scope.advsearch.before_date;
|
search += 'after:' + $filter('date')($scope.advsearch.after_date, 'yyyy-MM-dd') + ' ';
|
||||||
|
}
|
||||||
|
if (!_.isUndefined($scope.advsearch.before_date)) {
|
||||||
|
search += 'before:' + $filter('date')($scope.advsearch.before_date, 'yyyy-MM-dd') + ' ';
|
||||||
|
}
|
||||||
if (!_.isEmpty($scope.advsearch.tags)) {
|
if (!_.isEmpty($scope.advsearch.tags)) {
|
||||||
search += _.reduce($scope.advsearch.tags, function(s, t) {
|
search += _.reduce($scope.advsearch.tags, function(s, t) {
|
||||||
return s + 'tag:' + t + ' ';
|
return s + 'tag:' + t.name + ' ';
|
||||||
}, '');
|
}, '');
|
||||||
}
|
}
|
||||||
$scope.search = search;
|
$scope.search = search;
|
||||||
|
@ -22,6 +22,15 @@
|
|||||||
"logout": "Déconnexion"
|
"logout": "Déconnexion"
|
||||||
},
|
},
|
||||||
"document": {
|
"document": {
|
||||||
|
"search_simple": "Recherche simple",
|
||||||
|
"search_fulltext": "Recherche texte intégral",
|
||||||
|
"search_creator": "Créateur",
|
||||||
|
"search_language": "Langue",
|
||||||
|
"search_before_date": "Avant cette date",
|
||||||
|
"search_after_date": "Après cette date",
|
||||||
|
"search_tags": "Tags",
|
||||||
|
"search_clear": "Réinitialiser",
|
||||||
|
"any_language": "Toutes les langues",
|
||||||
"add_document": "Ajouter un document",
|
"add_document": "Ajouter un document",
|
||||||
"tags": "Tags",
|
"tags": "Tags",
|
||||||
"no_tags": "Aucun tag",
|
"no_tags": "Aucun tag",
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
datepicker-append-to-body="true"
|
datepicker-append-to-body="true"
|
||||||
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
|
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
|
||||||
ng-model="advsearch.after_date" datepicker-options="{ startingDay:1, showWeeks: false }"
|
ng-model="advsearch.after_date" datepicker-options="{ startingDay:1, showWeeks: false }"
|
||||||
ng-click="datepickerAfterOpened = true" is-open="datepickerAfterOpened" />
|
ng-click="datepickerAfterOpened = !datepickerAfterOpened" is-open="datepickerAfterOpened" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -87,7 +87,7 @@
|
|||||||
datepicker-append-to-body="true"
|
datepicker-append-to-body="true"
|
||||||
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
|
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
|
||||||
ng-model="advsearch.before_date" datepicker-options="{ startingDay:1, showWeeks: false }"
|
ng-model="advsearch.before_date" datepicker-options="{ startingDay:1, showWeeks: false }"
|
||||||
ng-click="datepickerBeforeOpened = true" is-open="datepickerBeforeOpened" />
|
ng-click="datepickerBeforeOpened = !datepickerBeforeOpened" is-open="datepickerBeforeOpened" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -113,7 +113,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{advsearch}}
|
{{advsearch.before_date | date: 'yyyy-MM-dd'}}
|
||||||
|
|
||||||
<table class="row table table-hover table-documents">
|
<table class="row table table-hover table-documents">
|
||||||
<thead>
|
<thead>
|
||||||
|
Loading…
Reference in New Issue
Block a user