archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1245788 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva: search.js templates/search.html
Date Fri, 17 Feb 2012 22:50:25 GMT
Author: olamy
Date: Fri Feb 17 22:50:24 2012
New Revision: 1245788

URL: http://svn.apache.org/viewvc?rev=1245788&view=rev
Log:
[MRM-1573] breadcrumbs in repository browsing.

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js?rev=1245788&r1=1245787&r2=1245788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
Fri Feb 17 22:50:24 2012
@@ -41,9 +41,22 @@ $(function() {
         browseRoot();
       }
     }
-  }
 
+    breadCrumbEntries=function(){
+      var curBrowseViewModel=self;
+      var entries=[];
+      do{
+        entries.push(curBrowseViewModel.groupId);
+        curBrowseViewModel=curBrowseViewModel.parentBrowseViewModel;
+        if (!curBrowseViewModel) return entries.reverse();
+      }while(curBrowseViewModel.parentBrowseViewModel)
+      return entries.reverse();
+    }
+  }
 
+  findParentGroupId=function(browseViewModel){
+    return browseViewModel.groupId;
+  }
 
   displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl){
     var mainContent = $("#main-content");

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html?rev=1245788&r1=1245787&r2=1245788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html
Fri Feb 17 22:50:24 2012
@@ -42,11 +42,13 @@
     <ul>
       <!-- if null we are on root level -->
       {{if $root.parentBrowseViewModel}}
-        <li class="browse-list"><a href="#" data-bind="click:function(){displayParentGroupId()}">..</a></li>
+        <li class="browse-list" data-bind="click:function(){displayParentGroupId()}">
+          <a href="#">..</a>
+        </li>
       {{/if}}
       {{each(i,browseResultEntry) browseResultEntries}}
-        <li class="browse-list">
-          <a href="#" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
+        <li class="browse-list" data-bind="click:function(){displayGroupId(browseResultEntry.name)}">
+          <a href="#">
             &nbsp;${browseResultEntry.name} (project: ${browseResultEntry.project})
           </a>
         </li>
@@ -58,6 +60,8 @@
 <script id="browse-breadcrumb-tmpl" type="text/html">
   <ul class="breadcrumb">
     <li><a href="#" data-bind="click: function(){ browseRoot()}"><i class="icon-home"/>&nbsp;</a>&nbsp;<span
class="divider">/</span></li>
-    <li><a href="#">org</a>&nbsp;<span class="divider">/</span></li>
+    {{each(i,breadCrumbEntry) breadCrumbEntries}}
+      <li><a href="#">${breadCrumbEntry}</a>&nbsp;<span class="divider">/</span></li>
+    {{/each}}
   </ul>
 </script>
\ No newline at end of file



Mime
View raw message