Remove django_js_reverse functionality
This is the first step to completely remove the current UI
This commit is contained in:
parent
908e74d974
commit
8f9a126924
@ -21,46 +21,3 @@
|
||||
<br class="clear">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block endscript %}
|
||||
$('.complist-button').click(function() {
|
||||
duck_id = $(this).attr('id').replace(/^duck-complist-/, '');
|
||||
|
||||
if (isNaN(duck_id) || (duck_id.trim() == '')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var url = Urls['api:complist'](duck_id);
|
||||
var dialog = $('<div style="display: none;"></div>').appendTo('body');
|
||||
|
||||
$.getJSON(url, function(data) {
|
||||
var items = [];
|
||||
|
||||
$.each(data, function(key, item) {
|
||||
items.push('<li class="competence-' + item.level + '">' + item.name + ' (' + item.level + ')</li>');
|
||||
});
|
||||
|
||||
$('<ul/>', {
|
||||
'class': 'complist',
|
||||
'html': items.join('')
|
||||
}).appendTo(dialog);
|
||||
|
||||
dialog.dialog({
|
||||
title: 'Competence list',
|
||||
dialogClass: 'no-close',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Close',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
],
|
||||
close: function(event, ui) {
|
||||
dialog.remove();
|
||||
},
|
||||
modal: true
|
||||
});
|
||||
});
|
||||
});
|
||||
{% endblock %}
|
||||
|
@ -7,7 +7,6 @@
|
||||
<link rel="stylesheet" type="text/css" href="{% static 'booking.css' %}">
|
||||
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.11.2/themes/ui-lightness/jquery-ui.css">
|
||||
|
||||
<script src="{% url 'js_reverse' %}" type="text/javascript"></script>
|
||||
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
|
||||
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
|
||||
</head>
|
||||
|
@ -297,11 +297,3 @@ class BookingTest(TestCase):
|
||||
|
||||
def test_unbooked_duck(self):
|
||||
self.assertEqual(self.unbooked_duck.booked_by(), None)
|
||||
|
||||
class ReverseTest(TestCase):
|
||||
def setUp(self):
|
||||
self.client = Client()
|
||||
|
||||
def test_reverse_js(self):
|
||||
response = self.client.get(reverse('js_reverse'))
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
@ -36,7 +36,6 @@ INSTALLED_APPS = (
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django_js_reverse',
|
||||
'rest_framework',
|
||||
'accounts',
|
||||
'booking',
|
||||
|
Loading…
Reference in New Issue
Block a user