Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3 from ixc/master
Browse files Browse the repository at this point in the history
minor bugfixes
  • Loading branch information
Thomas Ashelford committed Jun 8, 2011
2 parents 761de2d + bc0ec66 commit 95f3abb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
v0.0.1, 2010-09-31 -- Initial release.
v0.0.2, 2011-01-05 -- Fixed packaging problems.
v0.0.3, 2011-06-08 -- Fixed javascript bug on multiple sortable inlines
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include adminboost/templates *
recursive-include adminboost/media *
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ Assumptions:
Usage example:
In the change_form.html of our model which has inlines "Feature", "HomeFullWidthFeature" etc.

{% load admin_enhancements_includes %}
{% load adminboost_tags %}

{% block extrahead %}
{{ block.super }}
{% sortable_inlines "Feature" "HomeFullWidthFeature" "HomeHalfFeature" "HomeQuarterFeature" "CollectionFeature" %}
{% sortable_inlines "feature_set" %}
{% sortable_inlines "homefullwidthfeature_set" %}
{% endblock %}

Image preview
Expand Down
6 changes: 3 additions & 3 deletions adminboost/media/adminboost/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ function init_sortable_inlines(inlines) {

$group.inline_type = "tabular";

$group.find("th").filter(function(index) {
return $(this).text().toLowerCase() == order_field
}).remove();
// Hide table header
var field_index = $group.find('.empty-form td.' + order_field).index()
$group.find("th").eq(field_index - 1).remove();

$group.find("th[colspan=2]").removeAttr("colspan");
$group.find("th:first").attr("colspan", "2");
Expand Down
4 changes: 2 additions & 2 deletions adminboost/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def render(self, name, data, attrs={}):
if help_text is not None:
html += '<p class="help">%s</p>' % force_unicode(help_text)
html += '</div>'
return mark_safe(html)
return mark_safe(unicode(html))
else:
return ''
return u''

class PreviewField(forms.Field):
""" Dummy "field" to provide preview thumbnail. """
Expand Down
2 changes: 1 addition & 1 deletion adminboost/templates/adminboost/sortable_inlines.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<script type="text/javascript" src="{{ MEDIA_URL }}adminboost/jquery-ui-1.8.4/jquery-ui-1.8.4.min.js"></script>
<script type="text/javascript" src="{{ MEDIA_URL }}adminboost/scripts.js"></script>
<script type="text/javascript">
var sortable_inlines = [[{% for inline in inlines %}"{{ inline.0 }}",{% if inline.1 %}"{{ inline.1 }}"{% else %}undefined{% endif %}],{% endfor %}];
var sortable_inlines = [{% for inline in inlines %}["{{ inline.0 }}",{% if inline.1 %}"{{ inline.1 }}"{% else %}undefined{% endif %}],{% endfor %}];
init_sortable_inlines(sortable_inlines);
</script>
5 changes: 2 additions & 3 deletions setup.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
name='glamkit-adminboost',
author='Julien Phalip',
author_email='julien@interaction.net.au',
version='0.0.1',
version='0.0.3',
description='Makes the Django admin even more awesomer',
url='http://github.com/glamkit/glamkit-admintools',
packages=find_packages(),
package_data={
},
include_package_data=True,
zip_safe=False,
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 95f3abb

Please sign in to comment.