This repository has been archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
change_list.html
35 lines (33 loc) · 1.55 KB
/
change_list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{% extends "admin/change_list.html" %}{% load extra_urls i18n admin_static admin_list admin_urls %}{% load url from future %}
{% block object-tools %}
<div class="object-tools">
{% block object-tools-items %}
{% if has_add_permission %}
<a href="{% url cl.opts|admin_urlname:'add' %}{% if is_popup %}?_popup=1{% endif %}"
class="btn btn-success">
<i class="icon-plus-sign icon-white"></i>
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
{% endif %}
{% for method_name,urlattrs in cl.model_admin.extra_buttons %}
{% has_permission urlattrs.perm as authorized %}
{% if authorized and urlattrs.visible %}
{% spaceless %}
<a id="btn-{{method_name}}" href="{% url cl.opts|admin_urlname:method_name %}{% if is_popup %}?_popup=1{% endif %}"
class="extra-link {{urlattrs.css_class}} {{method_name}}">{% if urlattrs.icon %}<i class="{{ urlattrs.icon }} icon-white"></i> {% endif %}{{ urlattrs.label }}
</a>
{% endspaceless %}
{% endif %}
{% endfor %}
{% endblock %}
</div>
<script>
$('.btn').click(function(e) {
if ($(this).hasClass( "disabled" )){
e.preventDefault();
}else{
$(this).removeClass('btn-success').addClass('disabled');
}
});
</script>
{% endblock %}