Skip to content

Commit

Permalink
Fixes Django1.7+ opts.module_name to opts.model_name transition. Fixe…
Browse files Browse the repository at this point in the history
…s unsaved confirmation. Fixes #405
  • Loading branch information
darklow committed Jul 23, 2015
1 parent 372e3e8 commit 7730e62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion suit/templates/admin/auth/user/change_password.html
Expand Up @@ -36,7 +36,7 @@

{% block content %}
<div id="content-main">
<form action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form" class="form-horizontal">
<form action="{{ form_url }}" method="post" id="{% firstof opts.model_name opts.module_name %}_form" class="form-horizontal">
{% csrf_token %}{% block form_top %}{% endblock %}
<div>
{% if is_popup %}
Expand Down
6 changes: 3 additions & 3 deletions suit/templates/admin/change_form.html
Expand Up @@ -18,7 +18,7 @@
<!-- Warn on leaving unsaved form -->
<script src="{% static 'suit/js/suit-form-confirm.js' %}"></script>
<script type="text/javascript">
confirmExitIfModified('{{ opts.module_name }}_form', '{% trans 'You have unsaved changes' %}.');
confirmExitIfModified('{% firstof opts.model_name opts.module_name %}_form', '{% trans 'You have unsaved changes' %}.');
</script>
{% endif %}

Expand Down Expand Up @@ -83,7 +83,7 @@
<div id="content-main" class="inner-two-columns">

<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post"
id="{{ opts.module_name }}_form" class="form-horizontal">
id="{% firstof opts.model_name opts.module_name %}_form" class="form-horizontal">

<div class="inner-right-column">

Expand Down Expand Up @@ -182,7 +182,7 @@ <h4 class="italic-title">{% trans 'tools'|capfirst %}</h4>
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input[type!=button][type!=submit]:visible:enabled:first').focus()
$('form#{% firstof opts.model_name opts.module_name %}_form :input[type!=button][type!=submit]:visible:enabled:first').focus()
{% endif %}
});
})(django.jQuery);
Expand Down
2 changes: 1 addition & 1 deletion suit/templates/admin/import_export/import.html
Expand Up @@ -9,7 +9,7 @@
{% block content %}

{% if not confirm_form %}
<form action="{{ form_url }}" method="POST" id="{{ opts.module_name }}_form" enctype="multipart/form-data" class="form-horizontal">
<form action="{{ form_url }}" method="POST" id="{% firstof opts.model_name opts.module_name %}_form" enctype="multipart/form-data" class="form-horizontal">
{% csrf_token %}


Expand Down

0 comments on commit 7730e62

Please sign in to comment.