]> source.dussan.org Git - archiva.git/commitdiff
search result add a column with classifier
authorOlivier Lamy <olamy@apache.org>
Mon, 5 Mar 2012 13:54:17 +0000 (13:54 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 5 Mar 2012 13:54:17 +0000 (13:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297057 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

index 72e3e8328f0409e4a4fc1db35eeabd024046f152..f0ed90512d51b23e0f71a7235be6883e7359e867 100644 (file)
@@ -227,7 +227,8 @@ search.artifact.searching=Searching .....
 search.artifact.search.form.btn.search=Search
 search.artifact.search.form.btn.search.filter=Filter Results
 search.artifact.result.size=Artifacts found
-
+search.artifact.results.classifier=Classifier
+search.artifact.search.form.query.classifier=Classifier
 
 #login
 login.username.placehoder=Username
index 17e7057a74f50c1e0b2a6dc32bdc068cd1bf6167..28b210ed6c16797ad6faf9db561eb8d3d6a933a8 100644 (file)
@@ -657,6 +657,8 @@ $(function() {
 
     //private boolean includePomArtifacts = false;
     this.includePomArtifacts=ko.observable(false);
+
+    this.classifier=ko.observable();
   }
 
   applyAutocompleteOnHeader=function(property,resultViewModel){
@@ -665,7 +667,7 @@ $(function() {
                        source: function(request, response){
         var founds=[];
         $(resultViewModel.artifacts()).each(function(idx,artifact){
-          if(artifact[property].startsWith(request.term)){
+          if(artifact[property] && artifact[property].startsWith(request.term)){
             founds.push(artifact[property]);
           }
         });
@@ -675,10 +677,11 @@ $(function() {
         $.log("property:"+property+','+ui.item.value);
         var artifacts=[];
         $(resultViewModel.artifacts()).each(function(idx,artifact){
-          if(artifact[property].startsWith(ui.item.value)){
+          if(artifact[property] && artifact[property].startsWith(ui.item.value)){
             artifacts.push(artifact);
           }
         });
+        $.log("property:"+property+','+ui.item.value+",size:"+artifacts.length);
         resultViewModel.artifacts(artifacts);
         return false;
       }
@@ -706,6 +709,11 @@ $(function() {
           headerText: $.i18n.prop('search.artifact.results.version'),
           rowText: "version",
           id: "version"
+        },
+        {
+          headerText: $.i18n.prop('search.artifact.results.classifier'),
+          rowText: "classifier",
+          id: "classifier"
         }
       ],
       pageSize: 10,
@@ -713,6 +721,7 @@ $(function() {
         applyAutocompleteOnHeader('groupId',self);
         applyAutocompleteOnHeader('artifactId',self);
         applyAutocompleteOnHeader('version',self);
+        applyAutocompleteOnHeader('classifier',self);
       }
     });
   }
index 3ca8e4711ee122ddc756c84758314896c4299605..1f8b9fd964cdd69bfb93429ed76037c7f0af85d3 100644 (file)
                                data-bind="value: searchRequest().version"/>
                       </div>
                     </div>
+                    <div class="control-group">
+                      <label class="control-label" for="artifactId">${$.i18n.prop('search.artifact.search.form.query.classifier')}</label>
+                      <div class="controls">
+                        <input type="text" class="input-medium search-query" id="classifier" name="classifier" size="50"
+                               data-bind="value: searchRequest().classifier"/>
+                      </div>
+                    </div>
                     <div class="control-group">
                       <label class="control-label" for="artifactId">${$.i18n.prop('search.artifact.search.form.query.packaging')}</label>
                       <div class="controls">
                                data-bind="value: searchRequest().className"/>
                       </div>
                     </div>
+
                   </fieldset>
                   <button type="submit" id="btn-advanced-search" class="btn btn-primary"
                           data-bind="click: advancedSearch">${$.i18n.prop('search.artifact.search.form.btn.search')}</button>
         <tr>
           {{each(i, columnDefinition) columns}}
             <th title="${ columnDefinition.title }">
-              <input type="text" class="form-search" id="search-filter-auto-${ columnDefinition.id }" place-holder="filtering"/>
+              <input type="text" class="form-search" id="search-filter-auto-${ columnDefinition.id }" placeholder="filtering"/>
             </th>
           {{/each}}
         </tr>