Commit 1bde322c by Őry Máté

webui: use urls in js from dom data attrs 1

parent b50cf907
...@@ -25,7 +25,7 @@ $(function() { ...@@ -25,7 +25,7 @@ $(function() {
$.ajax({ $.ajax({
'type': 'POST', 'type': 'POST',
'data': 'id=' + id, 'data': 'id=' + id,
'url': '/ajax/key/delete/', 'url': $(this).data('url'),
'success': function() { 'success': function() {
$('#key-' + id).slideUp(700); $('#key-' + id).slideUp(700);
} }
...@@ -36,7 +36,7 @@ $(function() { ...@@ -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() { 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({ $.ajax({
type: 'POST', type: 'POST',
url: '/ajax/key/reset/', url: $(this).data('url'),
success: function() { success: function() {
window.location.reload(); window.location.reload();
} }
...@@ -85,7 +85,7 @@ $(function() { ...@@ -85,7 +85,7 @@ $(function() {
type: 'POST', type: 'POST',
data: 'name=' + newName, data: 'name=' + newName,
dataType: 'json', dataType: 'json',
url: '/ajax/vm/rename/' + id + '/', url: $(this).data('url'),
success: function(data) { success: function(data) {
$('#vm-' + id + '-name-details').removeAttr('style'); $('#vm-' + id + '-name-details').removeAttr('style');
$('#vm-' + id + '-name').text(data.name); $('#vm-' + id + '-name').text(data.name);
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</div> </div>
</li> </li>
<li class="entry small-row key" style="display: none"> <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="name">{% trans "Reset key" %}</div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
{{key}} {{key}}
</div> </div>
<div class="actions"> <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' %}" /> <img src="{% static "icons/minus-circle.png" %}" alt="{% trans 'Remove' %}" />
</a> </a>
</div> </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