MIFOSX-2040

This commit is contained in:
keshav10 2015-06-08 13:06:28 +05:30
parent d2c4d4d6e8
commit 8fddc79bf6
4 changed files with 51 additions and 4 deletions

View File

@ -433,6 +433,13 @@
"label.input.additionalinformation": "Additional information",
"label.input.changelanguage": "Change language:",
"#Search": "..",
"label.search.all": "Clients/ClientIdentifiers/Groups/Centers/Savings/Loans",
"label.search.clients/clientIdentifiers": "Clients/ClientIdentifiers",
"label.search.groups/centers":"Groups/Centers",
"label.search.savings":"Savings",
"#Buttons": "..",
"label.button.login": "Login",
"label.button.approve": "Approve",
@ -456,7 +463,7 @@
"label.nodata": "No Data",
"label.notactivated":"Not activated",
"label.unassigned":"Unassigned",
"label.searchorpress":"Click to focus or press alt+x to Search",
"label.searchorpress":"Click or press alt+x to Search",
"label.search.query.matched.results.exceeds.max.length":"Searched query resulted more than 200 records, showing first 200 records.",
"#Enumeration & Error Messages": "..",

View File

@ -213,7 +213,25 @@
</li>
</ul>
<form ng-submit="search()" class="navbar-form navbar-right ng-pristine ng-valid">
<input id="search" data-ng-model="search.query" type="text" placeholder="{{ 'label.searchorpress' | translate }}" class="form-control search-query col-md-4" />
<div class="row">
<div class="col-xs-10 col-xs-offset-2">
<div class="input-group">
<div class="input-group-btn search-panel">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span id="search_concept">{{'label.all'|translate}}</span> <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href= "#{{'label.search.all'|translate}}">{{'label.all'|translate}}</a></li>
<li><a href="#{{'label.search.clients/clientIdentifiers'|translate}}">{{'label.anchor.clients'|translate}}</a></li>
<li><a href="#{{'label.search.groups/centers'|translate}}">{{'label.search.groups/centers'|translate}}</a></li>
<li><a href="#{{'label.search.savings'|translate}}">{{'label.search.savings'|translate}}</a></li>
<li><a href="#{{'label.input.adhoc.search.loans'|translate}}">{{'label.input.adhoc.search.loans'|translate}}</a></li>
</ul>
</div>
<input id ="search" type="text" class="form-control" data-ng-model="search.query" placeholder="{{'label.searchorpress'|translate}}">
</div>
</div>
</div>
</form>
</div>
</div>

View File

@ -118,8 +118,30 @@
;
});
$(document).ready(function(e){
$('.search-panel .dropdown-menu').find('a').click(function(e) {
e.preventDefault(e);
scope.param = $(this).attr("href").replace("#","");
var concept = $(this).text();
$('.search-panel span#search_concept').text(concept);
$('.input-group #search_param').val(scope.param);
});
});
scope.search = function () {
location.path('/search/' + scope.search.query);
var resource;
var searchString=scope.search.query;
var exactMatch=false;
if(searchString != null){
searchString = searchString.replace(/(^"|"$)/g, '');
var n = searchString.localeCompare(scope.search.query);
if(n!=0)
{
exactMatch=true;
}
}
location.path('/search/' + searchString).search({exactMatch: exactMatch, resource: scope.param});
};
scope.text = '<span>Mifos X is designed by the <a href="http://www.openmf.org/">Mifos Initiative</a>.' +
'<a href="http://mifos.org/resources/community/"> A global community </a> thats aims to speed the elimination of poverty by enabling Organizations to more effectively and efficiently deliver responsible financial services to the worlds poor and unbanked </span><br/>' +

View File

@ -6,7 +6,7 @@
if (routeParams.query == 'undefined') {
routeParams.query = '';
}
resourceFactory.globalSearch.search({query: routeParams.query}, function (data) {
resourceFactory.globalSearch.search({query: routeParams.query, resource: routeParams.resource, exactMatch: routeParams.exactMatch}, function (data) {
if (data.length > 200) {
scope.searchResults = data.slice(0, 201);
scope.showMsg = true;