]> source.dussan.org Git - archiva.git/commitdiff
display artifacts number found in the search result
authorOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 22:12:35 +0000 (22:12 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 1 Mar 2012 22:12:35 +0000 (22:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295939 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
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 bc887ea32f28d06f029c54c8211f5190c5749988..d20c4762a3693348e1f15f73c5904115c1daf9cf 100644 (file)
@@ -94,8 +94,9 @@ public class DefaultRemoteRepositoryAdmin
     {
         try
         {
+            List<RemoteRepository> remoteRepositories = getRemoteRepositories();
             // close index on shutdown
-            for ( RemoteRepository remoteRepository : getRemoteRepositories() )
+            for ( RemoteRepository remoteRepository : remoteRepositories )
             {
                 IndexingContext context = indexer.getIndexingContexts().get( remoteRepository.getId() );
                 if ( context != null )
index 3803b1e6cf9ea0b7c881a021f05fd209fa1564ff..7adbee42e3ce988d47e3149b53391e32b9b2cc9a 100644 (file)
@@ -766,6 +766,9 @@ $(function() {
                                  "simpleGrid: gridViewModel,simpleGridTemplate:'search-results-view-grid-tmpl',pageLinksId:'search-results-view-grid-pagination'");
                 ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
                 ko.applyBindings(self,mainContent.find("#remove-filter-id" ).get(0));
+                mainContent.find("#search-result-number-div").attr("data-bind",
+                  "template:{name:'search-result-number-div-tmpl'}");
+                ko.applyBindings(self,mainContent.find("#search-result-number-div" ).get(0));
               }
 
               activateSearchResultsTab();
index 99cda9a87d1f3f13f05202ddc76559f8b19cd55d..acd9c5bf84fee24e94ed3c002ce7115aae3df3aa 100644 (file)
@@ -35,7 +35,6 @@
 
 <script id="browse-groups-div-tmpl" type="text/html">
   <div id="browse-groups-div" data-bind='template:{name:"browse-groups-tmpl"}'>
-
   </div>
 </script>
 
     <div id="search-artifacts-div" data-bind='template:{name:"search-artifacts-form-tmpl"}'>
     </div>
 </script>
+
 <script id="search-artifacts-form-tmpl" type="text/html">
 
   <div class="page-header">
 
 
       <div id="search-results" class="tab-pane">
-        <a href="#" class="btn btn-warning" data-bind="click: removeFilter" id="remove-filter-id">remove filter</a>
+        <div class="row">
+          <div class="span3">
+            <a href="#" class="btn btn-warning" data-bind="click: removeFilter" id="remove-filter-id">remove filter</a>
+          </div>
+          <div class="span4" id="search-result-number-div">
 
+          </div>
+        </div>
         <table class="table table-striped table-bordered" id="search-results-grid">
         </table>
         <div id="search-results-view-grid-pagination"></div>
 
 </script>
 
+<script type="text/html" id="search-result-number-div-tmpl">
+  <blockquote>
+      ${$.i18n.prop('search.artifact.result.size')}:&nbsp;${resultViewModel.artifacts().length}
+  </blockquote>
+
+</script>
+
 <script id="search-results-view-grid-tmpl" type="text/html">
     <thead>
         <tr>