archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1389170 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js: archiva/search.js templates/archiva/search.html
Date Sun, 23 Sep 2012 23:22:43 GMT
Author: olamy
Date: Sun Sep 23 23:22:43 2012
New Revision: 1389170

URL: http://svn.apache.org/viewvc?rev=1389170&view=rev
Log:
rss link when browsing an artifact

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/templates/archiva/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=1389170&r1=1389169&r2=1389170&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
Sun Sep 23 23:22:43 2012
@@ -23,12 +23,13 @@ define("archiva.search",["jquery","i18n"
   // browse part
   //-----------------------------------------
 
-  BrowseViewModel=function(browseResultEntries,parentBrowseViewModel,groupId,repositoryId){
+  BrowseViewModel=function(browseResultEntries,parentBrowseViewModel,groupId,repositoryId,feedsUrl){
     var self=this;
     this.browseResultEntries=browseResultEntries;
     this.parentBrowseViewModel=parentBrowseViewModel;
     this.groupId=groupId;
     this.repositoryId=repositoryId;
+    this.feedsUrl=feedsUrl;
     displayGroupId=function(groupId){
       $.log("BrowseViewModel#displayGroupId,self.repositoryId:"+self.repositoryId);
       if(self.repositoryId){
@@ -143,7 +144,7 @@ define("archiva.search",["jquery","i18n"
     return breadCrumbEntries;
   }
 
-  displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl,repositoryId){
+  displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl,repositoryId,feedsUrl){
     var mainContent = $("#main-content");
     mainContent.find("#browse_artifact_detail").hide();
     var browseResult=mainContent.find("#browse_result");
@@ -171,7 +172,7 @@ define("archiva.search",["jquery","i18n"
             dataType: 'json',
             success: function(data) {
               var browseResultEntries = mapBrowseResultEntries(data);
-              var browseViewModel = new BrowseViewModel(browseResultEntries,parentBrowseViewModel,groupId,repositoryId);
+              var browseViewModel = new BrowseViewModel(browseResultEntries,parentBrowseViewModel,groupId,repositoryId,feedsUrl);
               ko.applyBindings(browseViewModel,browseBreadCrumb.get(0));
               ko.applyBindings(browseViewModel,browseResult.get(0));
               enableAutocompleBrowse(groupId);
@@ -799,17 +800,19 @@ define("archiva.search",["jquery","i18n"
                 mainContent.find("#browse_result").html(mediumSpinnerImg());
                 var parentBrowseViewModel=new BrowseViewModel(null,null,null,repositoryId);
                 var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
+                var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/");
                 if (repositoryId){
                   url+="?repositoryId="+repositoryId;
                   // we are browsing a groupId so 2 substringBeforeLast
-                  var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/");
+
                   feedsUrl+="/feeds/"+repositoryId;
                   mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl"
)
                                                                      .tmpl({repositories:data,selected:repositoryId,feedsUrl:feedsUrl}));
                 }else{
-                  mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl"
).tmpl({repositories:data,selected:""}));
+                  mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl"
)
+                                                                     .tmpl({repositories:data,selected:"",feedsUrl:null}));
                 }
-                displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId);
+                displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId,feedsUrl);
 
               }
           });

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html?rev=1389170&r1=1389169&r2=1389170&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
Sun Sep 23 23:22:43 2012
@@ -42,6 +42,7 @@
 <script id="browse-groups-tmpl" type="text/html">
   <div>
     <ul>
+
       <!-- if null we are on root level -->
       {{if $root.parentBrowseViewModel}}
         <li class="browse-list" data-bind="click:function(){displayParentGroupId()}">
@@ -58,6 +59,7 @@
           {{else}}
             <li class="browse-list-project">
               <a href="#" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
+              <a href="${$root.feedsUrl}/${$root.groupId}/${browseResultEntry.name}"><img
src="images/atom.gif"></img></a>
             </li>
           {{/if}}
         {{else}}



Mime
View raw message