]> source.dussan.org Git - archiva.git/commitdiff
do not show del link if user do not have karma
authorOlivier Lamy <olamy@apache.org>
Tue, 5 Jun 2012 23:17:37 +0000 (23:17 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 5 Jun 2012 23:17:37 +0000 (23:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1346652 13f79535-47bb-0310-9956-ffa450edef68

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/templates/archiva/search.html

index 13d048086349b597cc370043bdb64f297110080e..cf0c0da0c61a8e463572eadd1d1cd11fab166b58 100644 (file)
@@ -409,6 +409,9 @@ define("search",["jquery","i18n","jquery.tmpl","choosen","order!knockout","knock
       });
 
     }
+
+    this.deleteKarma = hasKarma('archiva-delete-artifact');
+
   }
 
   displayArtifactFilesContent=function(self){
index 35a0bf1ca9b5ff7f318ecacd526e78e9cb4f5cfe..c82be8893a1f28e23f6b427193b750714baadf1f 100644 (file)
     <ul id="artifact-download-list-files">
     {{each(i, row) artifacts()}}
       <li>
-        <a href="#" data-bind="click: function(){deleteArtifact(row)}">del</a>:<a href="${row.url}">${row.packaging}:${row.version}&nbsp;-&nbsp;${row.size}</a>
+        {{if deleteKarma}}
+          <a href="#" data-bind="click: function(){deleteArtifact(row)}">del</a>:<a href="${row.url}">${row.packaging}:${row.version}&nbsp;-&nbsp;${row.size}</a>
+        {{else}}
+          <a href="${row.url}">${row.packaging}:${row.version}&nbsp;-&nbsp;${row.size}</a>
+        {{/if}}
       </li>
     {{/each}}
     </ul>