mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-24 01:50:25 +00:00
merge
This commit is contained in:
commit
4d5b170e10
4 changed files with 23 additions and 5 deletions
13
djadmin2/static/themes/bootstrap/js/base.js
Normal file
13
djadmin2/static/themes/bootstrap/js/base.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
/**
|
||||
* Dynamicaly adds button to each input element
|
||||
* Required by filter section to allow form to be submitted
|
||||
*/
|
||||
$("#filter_form").find('input').each(function(){
|
||||
var input_field = $(this);
|
||||
|
||||
var btn = input_field.after('<button>Go</button>');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
@ -78,6 +78,7 @@
|
|||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
|
||||
<script>window.jQuery || document.write('<script src="{{ STATIC_URL }}themes/bootstrap/js/jquery.min.js">\x3C/script>')</script>
|
||||
<script src="{{ STATIC_URL }}themes/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}themes/bootstrap/js/base.js"></script>
|
||||
{% endblock javascript %}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -105,12 +105,16 @@
|
|||
|
||||
|
||||
{% block filters %}
|
||||
{% if list_filter %}
|
||||
<div id="list_filter_container" class="well span4">
|
||||
<h4>{# Translators : action verb #}{% trans "Filter" %}</h4>
|
||||
{{ list_filter.form.as_p }}
|
||||
{% if list_filter %}
|
||||
<h4>{# Translators : action verb #}{% trans "Filter" %}</h4>
|
||||
<form id='filter_form'>
|
||||
{{ list_filter.form.as_p }}
|
||||
</form>
|
||||
{% else %}
|
||||
<a href='./'>Reset Filter</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock filters %}
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class PostAdmin(djadmin2.ModelAdmin2):
|
|||
list_actions = [DeleteSelectedAction, CustomPublishAction, unpublish_items]
|
||||
inlines = [CommentInline]
|
||||
search_fields = ('title', '^body')
|
||||
list_filter = ['published', ]
|
||||
list_filter = ['published', 'title']
|
||||
|
||||
|
||||
class CommentAdmin(djadmin2.ModelAdmin2):
|
||||
|
|
|
|||
Loading…
Reference in a new issue