Commit 1bde322c by Őry Máté

webui: use urls in js from dom data attrs 1

parent b50cf907
......@@ -25,7 +25,7 @@ $(function() {
$.ajax({
'type': 'POST',
'data': 'id=' + id,
'url': '/ajax/key/delete/',
'url': $(this).data('url'),
'success': function() {
$('#key-' + id).slideUp(700);
}
......@@ -36,7 +36,7 @@ $(function() {
vm_confirm_popup(gettext('Are you sure about reseting store credentials?<br /> You will lose your access to your store account on your existing virtual machines!'), gettext('Reset'), function() {
$.ajax({
type: 'POST',
url: '/ajax/key/reset/',
url: $(this).data('url'),
success: function() {
window.location.reload();
}
......@@ -85,7 +85,7 @@ $(function() {
type: 'POST',
data: 'name=' + newName,
dataType: 'json',
url: '/ajax/vm/rename/' + id + '/',
url: $(this).data('url'),
success: function(data) {
$('#vm-' + id + '-name-details').removeAttr('style');
$('#vm-' + id + '-name').text(data.name);
......
......@@ -115,7 +115,7 @@
</div>
</li>
<li class="entry small-row key" style="display: none">
<div class="summary" id="reset-key">
<div class="summary" id="reset-key" data-url="{% url one.views.key_ajax_reset %}">
<div class="name">{% trans "Reset key" %}</div>
<div class="clear"></div>
</div>
......
......@@ -15,7 +15,7 @@
{{key}}
</div>
<div class="actions">
<a href="#" class="remove delete-key" data-id="{{key.id}}">
<a href="#" class="remove delete-key" data-url="{% url one.views.key_ajax_delete %}" data-id="{{key.id}}">
<img src="{% static "icons/minus-circle.png" %}" alt="{% trans 'Remove' %}" />
</a>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment