Skip to content

Commit

Permalink
[#2684] Show warning when leaving page with modified fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aron committed Jul 17, 2012
1 parent 8836592 commit 9ae7f13
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ckan/public/base/javascript/modules/basic-form.js
@@ -1,7 +1,7 @@
this.ckan.module('basic-form', function (jQuery, _) {
return {
initialize: function () {
var message = _('There are unsaved modifications to this form');
var message = _('There are unsaved modifications to this form').fetch();
this.el.incompleteFormWarning(message);
}
};
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/group/snippets/group_form.html
@@ -1,6 +1,6 @@
{% import 'macros/form.html' as form %}

<form class="dataset-form form-horizontal" method="post">
<form class="dataset-form form-horizontal" method="post" data-module="basic-form">
{% block error_summary %}
{{ form.errors(error_summary) }}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/package_form.html
Expand Up @@ -3,7 +3,7 @@

{# This provides a full page that renders a form for adding a dataset. It can
then itself be extended to add/remove blocks of functionality. #}
<form class="dataset-form form-horizontal" method="post" action="{{ action }}">
<form class="dataset-form form-horizontal" method="post" action="{{ action }}" data-module="basic-form">
{% block stages %}
{{ h.snippet('package/snippets/stages.html', stages=stage) }}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/package_metadata_form.html
Expand Up @@ -3,7 +3,7 @@
{% set data = data or {} %}
{% set errors = errors or {} %}

<form class="dataset-form dataset-resource-form form-horizontal" method="post" >
<form class="dataset-form dataset-resource-form form-horizontal" method="post" data-module="basic-form">
{{ h.snippet('package/snippets/stages.html', stages=['complete', 'complete', 'active'], pkg_name=pkg_name) }}
{{ form.errors(error_summary) }}

Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/related/snippets/related_form.html
@@ -1,6 +1,6 @@
{% import 'macros/form.html' as form %}

<form class="dataset-form form-horizontal" method="post">
<form class="dataset-form form-horizontal" method="post" data-module="basic-form">
{% block error_summary %}
{% if error_summary | count %}
<div class="alert alert-error error-explanation">
Expand Down

0 comments on commit 9ae7f13

Please sign in to comment.