# HG changeset patch # User ymh # Date 1378999575 -7200 # Node ID ad7d84868c9865587270ed1266c73ea492a34703 # Parent d1b1768855152642fae4a81f789873a4fc19c0e9 add back buttopn on edit diff -r d1b176885515 -r ad7d84868c98 src/p4l/settings.py --- a/src/p4l/settings.py Thu Sep 12 11:42:29 2013 +0200 +++ b/src/p4l/settings.py Thu Sep 12 17:26:15 2013 +0200 @@ -141,6 +141,7 @@ TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( 'django.core.context_processors.i18n', + 'django.core.context_processors.request', ) # A sample logging configuration. The only tangible logging diff -r d1b176885515 -r ad7d84868c98 src/p4l/static/p4l/js/p4l.js --- a/src/p4l/static/p4l/js/p4l.js Thu Sep 12 11:42:29 2013 +0200 +++ b/src/p4l/static/p4l/js/p4l.js Thu Sep 12 17:26:15 2013 +0200 @@ -241,9 +241,15 @@ $scope.submitRecord = function() { $scope.saving = true; - $scope.record.$save({recordId: context.record_id}).then(function(response) { $scope.saving=false;}); + $scope.record.$save({recordId: context.record_id}) + .then(function(response) { + $scope.saving=false; + }); } + $scope.getPreviousUrl = function() { + return context.urls.previous || context.urls.home; + } }); diff -r d1b176885515 -r ad7d84868c98 src/p4l/templates/p4l/p4l_home.html --- a/src/p4l/templates/p4l/p4l_home.html Thu Sep 12 11:42:29 2013 +0200 +++ b/src/p4l/templates/p4l/p4l_home.html Thu Sep 12 17:26:15 2013 +0200 @@ -48,7 +48,7 @@   - + {% empty %} diff -r d1b176885515 -r ad7d84868c98 src/p4l/templates/p4l/record_update_form.html --- a/src/p4l/templates/p4l/record_update_form.html Thu Sep 12 11:42:29 2013 +0200 +++ b/src/p4l/templates/p4l/record_update_form.html Thu Sep 12 17:26:15 2013 +0200 @@ -28,7 +28,9 @@ csrf_token: "{{ csrf_token }}", urls: { base_static: "{% get_static_prefix %}", - record_api: "{% url 'record-detail' identifier=':recordId' %}".replace("\%3A",":"), + record_api: "{% url 'record-detail' identifier=':recordId' %}".replace("\%3A",":"), + previous: "{{request.GET.previous}}", + home: "{% url 'p4l_home' %}" }, query_dicts: angular.fromJson('{{ query_dicts | safe | addslashes}}'), languages_list: angular.fromJson('{{ languages_list | safe | addslashes}}'), @@ -43,6 +45,7 @@ {% block content %} {% verbatim %}
+
@@ -178,10 +181,15 @@
{{'property' | translate}}{{'value' | translate }}
- + + + {{ 'Cancel' | translate }} + +
{% endverbatim %} {% endblock %} \ No newline at end of file diff -r d1b176885515 -r ad7d84868c98 src/p4l/views.py --- a/src/p4l/views.py Thu Sep 12 11:42:29 2013 +0200 +++ b/src/p4l/views.py Thu Sep 12 17:26:15 2013 +0200 @@ -6,7 +6,6 @@ ''' from django.conf import settings -from django.utils.decorators import method_decorator from django.views.generic import ListView, DetailView from p4l.forms import RecordFilterForm from p4l.models import Record @@ -182,7 +181,7 @@ # Languages list used in drop down list context['languages_list'] = json.dumps(settings.LANGUAGES_LIST) - + return context \ No newline at end of file