columns: [
{
headerText: $.i18n.prop('search.artifact.results.groupId'),
- rowText: "groupId"
+ rowText: "groupId",
+ id: "groupId"
},
{
headerText: $.i18n.prop('search.artifact.results.artifactId'),
- rowText: "artifactId"
+ rowText: "artifactId",
+ id: "artifactId"
},
{
headerText: $.i18n.prop('search.artifact.results.version'),
- rowText: "version"
+ rowText: "version",
+ id: "version"
}
],
pageSize: 10,
this.resultViewModel=new ResultViewModel([]);
basicSearch=function(){
var queryTerm=this.searchRequest().queryTerms();
- if (!queryTerm || $.trim(queryTerm).length<1){
- $.log("empty");
+ if ($.trim(queryTerm).length<1){
var errorList=[{
message: $.i18n.prop("search.artifact.search.form.terms.empty"),
element: $("#main-content #search-basic-form #search-terms" ).get(0)
ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
}
activateSearchResultsTab();
+ mainContent.find("#btn-advanced-search-filter" ).show();
}
},
error: function(data) {
}
);
}
+
+ filterResults=function(){
+ var filtered=[];
+ for (var i=0;i<self.resultViewModel.artifacts().length;i++){
+ if (self.resultViewModel.artifacts()[i].groupId==this.searchRequest().groupId()){
+ filtered.push(self.resultViewModel.artifacts()[i]);
+ }
+ }
+ self.resultViewModel.artifacts(filtered);
+ }
}
activateSearchResultsTab=function(){
data-bind="value: searchRequest().queryTerms" placeholder="${$.i18n.prop('search.artifact.search.form.query.terms')}"/>
</div>
</div>
- <button type="submit" id="btn-basic-search" class="btn btn-primary" data-loading-text="${$.i18n.prop('search.artifact.searching')}" data-bind="click: basicSearch">Search</button>
+ <button type="submit" id="btn-basic-search" class="btn btn-primary"
+ data-loading-text="${$.i18n.prop('search.artifact.searching')}" data-bind="click: basicSearch">${$.i18n.prop('search.artifact.search.form.btn.search')}</button>
</fieldset>
</form>
</div>
</div>
</div>
</fieldset>
- <button type="submit" id="btn-advanced-search" class="btn btn-primary" class="btn" data-bind="click: advancedSearch">Search</button>
+ <button type="submit" id="btn-advanced-search" class="btn btn-primary"
+ data-bind="click: advancedSearch">${$.i18n.prop('search.artifact.search.form.btn.search')}</button>
+
+ <button type="submit" id="btn-advanced-search-filter" class="btn btn-success hide"
+ data-bind="click: filterResults">${$.i18n.prop('search.artifact.search.form.btn.search.filter')}</button>
+
</form>
</div>
<div class="pill-pane" id="search-osgi-form-pane">
<th title="${ columnDefinition.title }">${ columnDefinition.headerText }</th>
{{/each}}
</tr>
+ <tr>
+ {{each(i, columnDefinition) columns}}
+ <th title="${ columnDefinition.title }" id="search-filter-auto-${ columnDefinition.id }"><input type="text" place-holder="filter"/></th>
+ {{/each}}
+ </tr>
</thead>
<tbody>
{{each(i, row) itemsOnCurrentPage()}}