# HG changeset patch # User cavaliet # Date 1379684651 -7200 # Node ID ba6056f585163a65f3c26f7eee90720d792b41d4 # Parent e2ecb345b58f55f9df6b96ae120c49e2f32717e0 error handled on save diff -r e2ecb345b58f -r ba6056f58516 src/p4l/locale/en/LC_MESSAGES/django.po --- a/src/p4l/locale/en/LC_MESSAGES/django.po Fri Sep 20 12:54:55 2013 +0200 +++ b/src/p4l/locale/en/LC_MESSAGES/django.po Fri Sep 20 15:44:11 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-20 04:40-0500\n" +"POT-Creation-Date: 2013-09-20 08:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -405,6 +405,10 @@ msgid "name" msgstr "name" +#: templates/p4l/translations.html:22 +msgid "An error occured. Somes datas may be incorrect or incomplete." +msgstr "" + #: templates/registration/login.html:8 msgid "Sorry, that's not a valid username or password." msgstr "Sorry, that's not a valid username or password." diff -r e2ecb345b58f -r ba6056f58516 src/p4l/locale/es/LC_MESSAGES/django.po --- a/src/p4l/locale/es/LC_MESSAGES/django.po Fri Sep 20 12:54:55 2013 +0200 +++ b/src/p4l/locale/es/LC_MESSAGES/django.po Fri Sep 20 15:44:11 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-20 04:40-0500\n" +"POT-Creation-Date: 2013-09-20 08:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -406,6 +406,10 @@ msgid "name" msgstr "name" +#: templates/p4l/translations.html:22 +msgid "An error occured. Somes datas may be incorrect or incomplete." +msgstr "" + #: templates/registration/login.html:8 msgid "Sorry, that's not a valid username or password." msgstr "Sorry, that's not a valid username or password." diff -r e2ecb345b58f -r ba6056f58516 src/p4l/locale/fr/LC_MESSAGES/django.mo Binary file src/p4l/locale/fr/LC_MESSAGES/django.mo has changed diff -r e2ecb345b58f -r ba6056f58516 src/p4l/locale/fr/LC_MESSAGES/django.po --- a/src/p4l/locale/fr/LC_MESSAGES/django.po Fri Sep 20 12:54:55 2013 +0200 +++ b/src/p4l/locale/fr/LC_MESSAGES/django.po Fri Sep 20 15:44:11 2013 +0200 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-09-20 04:40-0500\n" +"POT-Creation-Date: 2013-09-20 08:37-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -415,6 +415,10 @@ msgid "name" msgstr "Nom" +#: templates/p4l/translations.html:22 +msgid "An error occured. Somes datas may be incorrect or incomplete." +msgstr "Une erreur est survenue. Certaines données sont incorrectes ou incomplètes." + #: templates/registration/login.html:8 msgid "Sorry, that's not a valid username or password." msgstr "Désolé, utilisateur ou mot de passe invalide" diff -r e2ecb345b58f -r ba6056f58516 src/p4l/static/p4l/js/p4l.js --- a/src/p4l/static/p4l/js/p4l.js Fri Sep 20 12:54:55 2013 +0200 +++ b/src/p4l/static/p4l/js/p4l.js Fri Sep 20 15:44:11 2013 +0200 @@ -284,7 +284,7 @@ }; }); -app.controller("RecordCtrl", function($scope, RecordModel, context){ +app.controller("RecordCtrl", function($translate, $scope, RecordModel, context){ $scope.record = RecordModel.record; $scope.uriLabels = RecordModel.uriLabels; @@ -293,7 +293,15 @@ $scope.submitRecord = function() { $scope.saving = true; - $scope.record.$save({recordId: context.record_id}) + $scope.record.$save( + { recordId: context.record_id }, + function(){ + //console.log("SUCCESS"); + }, + function(){ + alert($translate("An error occured. Somes datas may be incorrect or incomplete.")); + $scope.saving=false; + }) .then(function(response) { $scope.saving=false; }); diff -r e2ecb345b58f -r ba6056f58516 src/p4l/templates/p4l/translations.html --- a/src/p4l/templates/p4l/translations.html Fri Sep 20 12:54:55 2013 +0200 +++ b/src/p4l/templates/p4l/translations.html Fri Sep 20 15:44:11 2013 +0200 @@ -18,4 +18,5 @@ {% trans 'label' %} {% trans 'name' %} {% trans 'View the record' %} -{% trans 'Edit the record' %} \ No newline at end of file +{% trans 'Edit the record' %} +{% trans 'An error occured. Somes datas may be incorrect or incomplete.' %} \ No newline at end of file