# HG changeset patch # User gibus # Date 1357209766 -3600 # Node ID b9b8022611095901985a8463be74008a8398637d # Parent 49a1afacaea081f5df40e579535ed588f9c1e171 Replace pre_edit stage by an input checkbox to increase performances (compute_new_comment_positions run once). diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/bg/LC_MESSAGES/django.mo Binary file src/cm/locale/bg/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/bg/LC_MESSAGES/django.po --- a/src/cm/locale/bg/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/bg/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1903,6 +1903,16 @@ msgid "Keep comments (if not affected by the edit)" msgstr "Запазете коментарите (ако не са засегнати от редактирането)" +#: views/texts.py:614 +#, fuzzy +msgid "Detach comments (optional)" +msgstr "Откъснете коментарите (по избор)" + +#: views/texts.py:617 +#, fuzzy +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Ако някои коментари бяха прикрепени на chunck на текст, който се променя, проверете тази опция, за да се запазят тези коментари няма възможност. Оставете тази опция без отметка, ако искате, че такива коментари се заличават. Тази опция се игнорира, ако предишния 'Запазете коментарите' опция не е маркирана." + #: views/texts.py:723 msgid "Name (optional)" msgstr "Име (по избор)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/en/LC_MESSAGES/django.po --- a/src/cm/locale/en/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/en/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1839,6 +1839,14 @@ msgid "Keep comments (if not affected by the edit)" msgstr "" +#: views/texts.py:614 +msgid "Detach comments (optional)" +msgstr "" + +#: views/texts.py:617 +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "" + #: views/texts.py:723 msgid "Name (optional)" msgstr "" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/es/LC_MESSAGES/django.mo Binary file src/cm/locale/es/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/es/LC_MESSAGES/django.po --- a/src/cm/locale/es/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/es/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1989,10 +1989,20 @@ msgid "Keep comments (optional)" msgstr "Mantener los comentarios (opcional)" -#: views/texts.py:657 +#: views/texts.py:617 msgid "Keep comments (if not affected by the edit)" msgstr "Mantener los comentarios (si no son afectados por la edición)" +#: views/texts.py:614 +#, fuzzy +msgid "Detach comments (optional)" +msgstr "Separe los comentarios (opcional)" + +#: views/texts.py:657 +#, fuzzy +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Si algunos comentarios se adjunta a un chunck de texto que se modifica, marque esta opción para mantener estos comentarios sin alcance. Deje esta opción sin marcar si desea que esos comentarios serán eliminados. Esta opción se ignora si el anterior 'Mantener los comentarios' opción no está seleccionada." + #: views/texts.py:723 msgid "Name (optional)" msgstr "Nombre (opcional)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/fr/LC_MESSAGES/django.mo Binary file src/cm/locale/fr/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/fr/LC_MESSAGES/django.po --- a/src/cm/locale/fr/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/fr/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1997,8 +1997,15 @@ #: views/texts.py:657 msgid "Keep comments (if not affected by the edit)" -msgstr "" -"Conserver les commentaires dont la portée n'a pas été affectée par l'édition" +msgstr "Conserver les commentaires dont la portée n'a pas été affectée par l'édition" + +#: views/texts.py:614 +msgid "Detach comments (optional)" +msgstr "Détacher les commentaires (facultatif)" + +#: views/texts.py:617 +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Si certains commentaires étaient attachés à une portion de texte qui a été modifiée, cochez cette option pour conserver ces commentaires sans portée. Laissez cette option décochée si vous souhaitez que ces commentaires soient supprimés. Cette option est ignorée si la précédente option 'Conserver les commentaires' n'est pas cochée." #: views/texts.py:723 msgid "Name (optional)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/it/LC_MESSAGES/django.mo Binary file src/cm/locale/it/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/it/LC_MESSAGES/django.po --- a/src/cm/locale/it/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/it/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -2072,6 +2072,16 @@ msgid "Keep comments (if not affected by the edit)" msgstr "Tieni i commenti (se non interessati dalle modifiche)" +#: views/texts.py:614 +#, fuzzy +msgid "Detach comments (optional)" +msgstr "Staccare i commenti (opzionale)" + +#: views/texts.py:617 +#, fuzzy +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Se alcuni commenti sono stati attaccati ad un chunck di testo che viene modificato, selezionare questa opzione per mantenere questi commenti senza ambito. Lasciate questa opzione deselezionata se si vuole che tali osservazioni è soppresso. Questa opzione viene ignorata se il precedente 'Tieni i commenti' opzione non è selezionata." + #: views/texts.py:677 msgid "Name (optional)" msgstr "Nome (opzionale)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/no/LC_MESSAGES/django.mo Binary file src/cm/locale/no/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/no/LC_MESSAGES/django.po --- a/src/cm/locale/no/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/no/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1883,6 +1883,16 @@ msgid "Keep comments (if not affected by the edit)" msgstr "Behold merknadene (dersom de ikke er påvirket av endringene i teksten)" +#: views/texts.py:614 +#, fuzzy +msgid "Detach comments (optional)" +msgstr "Løsne merknader (valgfritt)" + +#: views/texts.py:617 +#, fuzzy +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Hvis noen kommentarer var knyttet til en chunck av tekst som er endret, sjekk dette alternativet for å holde disse kommentarene uten omfang. La dette alternativet hvis du vil at slike kommentarer blir slettet. Dette alternativet blir ignorert hvis den forrige 'Behold merknader' alternativet er avmerket." + #: views/texts.py:723 msgid "Name (optional)" msgstr "Navn (valgfritt)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/pt_BR/LC_MESSAGES/django.mo Binary file src/cm/locale/pt_BR/LC_MESSAGES/django.mo has changed diff -r 49a1afacaea0 -r b9b802261109 src/cm/locale/pt_BR/LC_MESSAGES/django.po --- a/src/cm/locale/pt_BR/LC_MESSAGES/django.po Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/locale/pt_BR/LC_MESSAGES/django.po Thu Jan 03 11:42:46 2013 +0100 @@ -1892,6 +1892,16 @@ msgid "Keep comments (if not affected by the edit)" msgstr "Manter comentários (se não afetados pela edição)" +#: views/texts.py:614 +#, fuzzy +msgid "Detach comments (optional)" +msgstr "Retire comentários (opcional)" + +#: views/texts.py:617 +#, fuzzy +msgid "If some comments were attached to a chunck of text that is modified, check this option to keep these comments with no scope. Leave this option unchecked if you want that such comments be deleted. This option is ignored if the previous 'Keep comment' option is unchecked." +msgstr "Se alguns comentários foram anexados a um chunck de texto que é modificado, marque esta opção para manter esses comentários sem escopo. Deixe essa opção desmarcada se desejar que esses comentários sejam excluídos. Esta opção é ignorada se o anterior 'Manter comentários' opção está desmarcada." + #: views/texts.py:723 msgid "Name (optional)" msgstr "Nome (opcional)" diff -r 49a1afacaea0 -r b9b802261109 src/cm/media/js/site/text_edit.js --- a/src/cm/media/js/site/text_edit.js Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/media/js/site/text_edit.js Thu Jan 03 11:42:46 2013 +0100 @@ -1,79 +1,22 @@ function check_save(){ - var newVersion = $('#id_new_version').attr('checked') ; - var commentsKept = $('#id_keep_comments').attr('checked') ; - - var new_content = $('#id_content').val() ; - - var o=CKEDITOR.instances['id_content']; - if (o) new_content=o.getData(); - - var new_format = $('#id_format').val() ; - var mess = gettext( 'Should these comments be detached (i.e. kept with no scope) or removed from new version?') ; + var newVersion = $('#id_new_version').attr('checked') ; + var commentsKept = $('#id_keep_comments').attr('checked') ; - if (commentsKept) { - var pre_edit_url = tb_conf['pre_edit_url'] ; - $.ajax({ - url: pre_edit_url, - type:'POST', - dataType:"json", - data: { "new_content": new_content, "new_format": new_format}, - success: function(obj){ - nb_removed = obj['nb_removed']; - if (newVersion) { - if (nb_removed == 0) { - submit_edit_form(); - } - else { - var message = ngettext( - '%(nb_comments)s comment applies to text that was modified.', - '%(nb_comments)s comments apply to text that was modified.', - nb_removed) ; - message += '
' ; - message += mess ; - message = interpolate(message,{'nb_comments':nb_removed}, true) ; - - $('#remove_scope_choice_dlg').html(message) ; - $('#remove_scope_choice_dlg').dialog('open') ; - } - } - else { - if (nb_removed == 0) { - submit_edit_form(); - } - else { - var message = ngettext( - '%(nb_comments)s comment applies to text that was modified.', - '%(nb_comments)s comments apply to text that was modified.', - nb_removed) ; - message += '
' ; - message += gettext( '(We suggest you create a new version)') ; - message += '
' ; - message += mess ; - message = interpolate(message,{'nb_comments':nb_removed}, true) ; - - $('#remove_scope_choice_dlg').html(message) ; - $('#remove_scope_choice_dlg').dialog('open') ; - } - } - }, - error: function(msg){ - alert("error: " + msg); - } - }); + if (commentsKept) { + submit_edit_form(); + } + else { + if (!newVersion) { + var message = gettext("You chose not to create a new version all comments will be deleted") ; + message += '
' ; + message += gettext( 'Do you want to continue?') ; + $('#confirm_all_removed_dlg').html(message) ; + $('#confirm_all_removed_dlg').dialog('open') ; } else { - if (!newVersion) { - - var message = gettext("You chose not to create a new version all comments will be deleted") ; - message += '
' ; - message += gettext( 'Do you want to continue?') ; - $('#confirm_all_removed_dlg').html(message) ; - $('#confirm_all_removed_dlg').dialog('open') ; - } - else { - submit_edit_form() ; - } + submit_edit_form() ; } + } } function submit_edit_form() { @@ -90,26 +33,13 @@ $(this).dialog('close');submit_edit_form(); } ; - $('#confirm_all_removed_dlg').dialog({ - bgiframe: true, - autoOpen: false, - title :gettext('Warning'), - modal: true, - buttons:buttons - }) ; - - var buttons0 = {}; - buttons0[gettext('Detach')] = function() {$(this).dialog('close');$('#cancel_modified_scopes').val("1");submit_edit_form();} ; - buttons0[gettext('Remove')] = function() {$(this).dialog('close');$('#cancel_modified_scopes').val("0");submit_edit_form();} ; - buttons0[gettext('Cancel')] = function() {$(this).dialog('close');} ; + $('#confirm_all_removed_dlg').dialog({ + bgiframe: true, + autoOpen: false, + title :gettext('Warning'), + modal: true, + buttons:buttons + }) ; - $('#remove_scope_choice_dlg').dialog({ - bgiframe: true, - autoOpen: false, - title :gettext('Warning'), - modal: true, - buttons:buttons0 - }) ; - - $("#save").click(function() { check_save() ;}) ; + $("#save").click(function() { check_save() ;}) ; }) ; diff -r 49a1afacaea0 -r b9b802261109 src/cm/templates/site/text_view_comments.html --- a/src/cm/templates/site/text_view_comments.html Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/templates/site/text_view_comments.html Thu Jan 03 11:42:46 2013 +0100 @@ -110,7 +110,7 @@ {% else %} - + {% endif %} diff -r 49a1afacaea0 -r b9b802261109 src/cm/templates/site/text_view_frame.html --- a/src/cm/templates/site/text_view_frame.html Thu Jan 03 11:07:33 2013 +0100 +++ b/src/cm/templates/site/text_view_frame.html Thu Jan 03 11:42:46 2013 +0100 @@ -37,7 +37,7 @@ {% else %} - + {% endif %}