# --------------------------------------------------------------------
# Archiva webapp i18n default en file
# --------------------------------------------------------------------
+
+#default common
+id=id
+warning.not.undone.operation=WARNING: This operation can not be undone.
+
+# managed repositories screen
+managedrepository.delete.confirm=Delete Managed Repository
+managedrepository.delete.warning.message=Are you sure you want to delete the following managed repository?
+managedrepository.deleted=Managed Repository " {0} " deleted.
\ No newline at end of file
//private boolean stageRepoNeeded;
this.stageRepoNeeded=ko.observable(stageRepoNeeded);
+
+
}
ManagedRepositoryViewModel=function(managedRepository, update, managedRepositoriesViewModel){
activateManagedRepositoryFormValidation();
}
+ removeManagedRepository=function(managedRepository){
+ clearUserMessages();
+ openDialogConfirm(
+ function(){
+ var url = "restServices/archivaServices/managedRepositoriesService/deleteManagedRepository?";
+ url += "repositoryId="+encodeURIComponent(managedRepository.id());
+ url += "&deleteContent=false";
+ $.ajax(url,
+ {
+ type: "GET",
+ success: function(data) {
+ self.managedRepositories.remove(managedRepository);
+ displaySuccessMessage($.i18n.prop("managedrepository.deleted",managedRepository.name()));
+
+ },
+ error: function(data) {
+ var res = $.parseJSON(data.responseText);
+ displayRestError(res);
+ },
+ complete: function(){
+ closeDialogConfirm();
+ }
+ }
+ );
+
+ },
+ $.i18n.prop("ok"),
+ $.i18n.prop("cancel"),
+ $.i18n.prop("managedrepository.delete.confirm",managedRepository.name()),
+ $("#managed-repository-delete-warning-tmpl").tmpl(managedRepository));
+ }
+
+
+
}
activateManagedRepositoriesGridTab=function(){
<th>${$.i18n.prop('release.included')}</th>
<th>${$.i18n.prop('snapshots.included')}</th>
<th>${$.i18n.prop('edit')}</th>
-
+ <th>${$.i18n.prop('delete')}</th>
</tr>
</thead>
<tbody>
<img src="images/dialog-error.png"/>
{{/if}}
</td>
- <td><a href="#" data-bind="click: function(){ editManagedRepository(row) }">Edit</a></td>
+ <td><a href="#" data-bind="click: function(){ editManagedRepository(row) }">${$.i18n.prop('edit')}</a></td>
+ <td><a href="#" data-bind="click: function(){ removeManagedRepository(row) }">${$.i18n.prop('delete')}</a></td>
</tr>
{{/each}}
</tbody>
<button data-bind="click: save" class="btn">${$.i18n.prop('save')}</button>
<button data-bind="click: displayGrid" class="btn">${$.i18n.prop('cancel')}</button>
</form>
+</script>
+
+<script id="managed-repository-delete-warning-tmpl" type='text/x-jquery-tmpl'>
+ <div>
+ <a class="close" href="#">×</a>
+ <div class="alert-message warning">
+ <p>
+ <strong>${$.i18n.prop('warning.not.undone.operation')}</strong>
+ </p>
+ </div>
+ <div>
+ <span><strong>${$.i18n.prop('managedrepository.delete.warning.message')}</strong>.</span>
+ <div>${$.i18n.prop('id')}: ${id()}</div>
+ <div>${$.i18n.prop('name')}: ${name()}</div>
+ </div>
+ </div>
</script>
\ No newline at end of file