mirror of https://github.com/apache/archiva.git
take of karma for adding/deleting artifact custom properties
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1305327 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
81f3e02bfb
commit
9d23364206
|
@ -321,6 +321,14 @@ $(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasSavePropertyKarma=function(){
|
||||||
|
return hasKarma("archiva-add-metadata");
|
||||||
|
}
|
||||||
|
|
||||||
|
hasDeletePropertyKarma=function(){
|
||||||
|
return hasKarma("archiva-delete-metadata");
|
||||||
|
}
|
||||||
|
|
||||||
saveProperty=function(entry){
|
saveProperty=function(entry){
|
||||||
if($.trim(entry.key() ).length<1){
|
if($.trim(entry.key() ).length<1){
|
||||||
clearUserMessages();
|
clearUserMessages();
|
||||||
|
|
|
@ -687,7 +687,9 @@
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
<div id="artifactMetadata_Pagination"></div>
|
<div id="artifactMetadata_Pagination"></div>
|
||||||
<a href="#" class="btn btn-primary" data-bind="click: addProperty">${$.i18n.prop('browse.artifact.metadatas.add')}</a>
|
{{if hasSavePropertyKarma()}}
|
||||||
|
<a href="#" class="btn btn-primary" data-bind="click: addProperty">${$.i18n.prop('browse.artifact.metadatas.add')}</a>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -755,15 +757,25 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{{each(i, row) itemsOnCurrentPage()}}
|
{{each(i, row) itemsOnCurrentPage()}}
|
||||||
<tr>
|
<tr>
|
||||||
{{if row.editable}}
|
{{if row.editable && hasSavePropertyKarma()}}
|
||||||
<td><input type="text" data-bind="value: row.key"/></td>
|
<td><input type="text" data-bind="value: row.key"/></td>
|
||||||
{{else}}
|
{{else}}
|
||||||
<td>${row.key}</td>
|
<td>${row.key}</td>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<td><input type="text" data-bind="value: row.value"/></td>
|
|
||||||
<td><a href="#" class="btn btn-danger" data-bind="click: function(){deleteProperty(row)}">${$.i18n.prop('browse.artifact.metadatas.delete')}</a></td>
|
|
||||||
<td>
|
<td>
|
||||||
{{if row.modified}}
|
{{if hasSavePropertyKarma()}}
|
||||||
|
<input type="text" data-bind="value: row.value"/>
|
||||||
|
{{else}}
|
||||||
|
${row.value}
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{if hasDeletePropertyKarma()}}
|
||||||
|
<a href="#" class="btn btn-danger" data-bind="click: function(){deleteProperty(row)}">${$.i18n.prop('browse.artifact.metadatas.delete')}</a>
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{if row.modified && hasSavePropertyKarma()}}
|
||||||
<a href="#" class="btn btn-warning" data-bind="click: function(){saveProperty(row)}">${$.i18n.prop('browse.artifact.metadatas.save')}</a>
|
<a href="#" class="btn btn-warning" data-bind="click: function(){saveProperty(row)}">${$.i18n.prop('browse.artifact.metadatas.save')}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue