mirror of
https://github.com/eldarion/eldarion-ajax-demo.git
synced 2026-01-08 21:47:56 -05:00
Update demo
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
{% else %}
|
||||
<a href="{% url task_mark_done task.pk %}" class="btn ajax" data-method="post" data-refresh="#done-count" data-replace-closest="tr"><i class="icon-ok"></i></a>
|
||||
{% endif %}
|
||||
<a href="{% url task_delete task.pk %}" class="btn ajax" data-method="post" data-replace-closest="tr" data-refresh="#done-count"><i class="icon-trash"></i></a>
|
||||
<a href="{% url task_delete task.pk %}" class="btn ajax" data-method="post" data-replace-inner="#message" data-remove-closest="tr" data-refresh="#done-count"><i class="icon-trash"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
</div>
|
||||
</form>
|
||||
{% include "_complete_count.html" %}
|
||||
<div id="message"></div>
|
||||
<table class="table table-striped" id="tasks">
|
||||
{% for task in tasks %}
|
||||
{% include "_task.html" %}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block extra_body_base %}
|
||||
<script type="text/javascript" src="https://raw.github.com/eldarion/bootstrap-ajax/e272efd297da2ed140049e420912960b280a066d/js/bootstrap-ajax.js"></script>
|
||||
<script src="https://raw.github.com/eldarion/bootstrap-ajax/master/js/bootstrap-ajax.js"></script>
|
||||
{% analytics %}
|
||||
{% block extra_body %}{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -96,6 +96,6 @@ def delete(request, pk):
|
||||
)
|
||||
task.delete()
|
||||
data = {
|
||||
"html": ""
|
||||
"html": "<div class=\"alert alert-info\">Task #{} deleted!</div>".format(pk)
|
||||
}
|
||||
return HttpResponse(json.dumps(data), mimetype="application/json")
|
||||
|
||||
Reference in New Issue
Block a user