From afe6644321dbac7567c64e5c361a184e1a5859a5 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 17 Jul 2015 19:52:17 -0400 Subject: [PATCH] Use shorter confirmation messages. --- mayan/apps/checkouts/views.py | 4 +-- mayan/apps/django_gpg/views.py | 4 +-- mayan/apps/document_comments/views.py | 4 +-- mayan/apps/document_indexing/views.py | 2 +- mayan/apps/document_signatures/views.py | 2 +- mayan/apps/documents/views.py | 12 ++++----- mayan/apps/folders/views.py | 6 ++--- mayan/apps/linking/views.py | 4 +-- mayan/apps/ocr/views.py | 34 +++++-------------------- mayan/apps/tags/views.py | 12 ++++----- mayan/apps/user_management/views.py | 8 +++--- 11 files changed, 36 insertions(+), 56 deletions(-) diff --git a/mayan/apps/checkouts/views.py b/mayan/apps/checkouts/views.py index 4aa2e91c73..f3d1f9583b 100644 --- a/mayan/apps/checkouts/views.py +++ b/mayan/apps/checkouts/views.py @@ -147,9 +147,9 @@ def checkin_document(request, document_pk): } if document.checkout_info().user != request.user: - context['title'] = _('You didn\'t originally checked out this document. Are you sure you wish to forcefully check in document: %s?') % document + context['title'] = _('You didn\'t originally checked out this document. Forcefully check in the document: %s?') % document else: - context['title'] = _('Are you sure you wish to check in document: %s?') % document + context['title'] = _('Check in the document: %s?') % document return render_to_response('appearance/generic_confirm.html', context, context_instance=RequestContext(request)) diff --git a/mayan/apps/django_gpg/views.py b/mayan/apps/django_gpg/views.py index 472730c9a6..4bebecc53f 100644 --- a/mayan/apps/django_gpg/views.py +++ b/mayan/apps/django_gpg/views.py @@ -56,7 +56,7 @@ def key_receive(request, key_id): return render_to_response('appearance/generic_confirm.html', { 'title': _('Import key'), - 'message': _('Are you sure you wish to import key id: %s?') % key_id, + 'message': _('Import key ID: %s?') % key_id, 'previous': previous, 'submit_method': 'GET', @@ -112,7 +112,7 @@ def key_delete(request, fingerprint, key_type): return render_to_response('appearance/generic_confirm.html', { 'title': _('Delete key'), 'delete_view': True, - 'message': _('Are you sure you wish to delete key: %s? If you try to delete a public key that is part of a public/private pair the private key will be deleted as well.') % key, + 'message': _('Delete key %s? If you delete a public key that is part of a public/private pair the private key will be deleted as well.') % key, 'next': next, 'previous': previous, }, context_instance=RequestContext(request)) diff --git a/mayan/apps/document_comments/views.py b/mayan/apps/document_comments/views.py index 37451bb95b..b1f1c6b2d9 100644 --- a/mayan/apps/document_comments/views.py +++ b/mayan/apps/document_comments/views.py @@ -62,9 +62,9 @@ def comment_delete(request, comment_id=None, comment_id_list=None): } if len(comments) == 1: context['object'] = comments[0].content_object - context['title'] = _('Are you sure you wish to delete the comment: %s?') % ', '.join([unicode(d) for d in comments]) + context['title'] = _('Delete comment?') elif len(comments) > 1: - context['title'] = _('Are you sure you wish to delete the comments: %s?') % ', '.join([unicode(d) for d in comments]) + context['title'] = _('Delete comments?') return render_to_response('appearance/generic_confirm.html', context, context_instance=RequestContext(request)) diff --git a/mayan/apps/document_indexing/views.py b/mayan/apps/document_indexing/views.py index 67149a783c..de01bb6e1f 100644 --- a/mayan/apps/document_indexing/views.py +++ b/mayan/apps/document_indexing/views.py @@ -222,7 +222,7 @@ def template_node_delete(request, node_pk): 'navigation_object_list': ['index', 'node'], 'next': next, 'node': node, - 'title': _('Are you sure you with to delete the index template node: %s?') % node, + 'title': _('Delete the index template node: %s?') % node, 'previous': previous, } diff --git a/mayan/apps/document_signatures/views.py b/mayan/apps/document_signatures/views.py index 86f0af235c..ed5ffcfee4 100644 --- a/mayan/apps/document_signatures/views.py +++ b/mayan/apps/document_signatures/views.py @@ -160,7 +160,7 @@ def document_signature_delete(request, document_pk): return HttpResponseRedirect(previous) return render_to_response('appearance/generic_confirm.html', { - 'title': _('Are you sure you wish to delete the detached signature from document: %s?') % document, + 'title': _('Delete the detached signature from document: %s?') % document, 'next': next, 'previous': previous, 'object': document, diff --git a/mayan/apps/documents/views.py b/mayan/apps/documents/views.py index 9f71510bcf..6d48a85760 100644 --- a/mayan/apps/documents/views.py +++ b/mayan/apps/documents/views.py @@ -605,8 +605,8 @@ def document_update_page_count(request, document_id=None, document_id_list=None) context = { 'previous': previous, 'title': ungettext( - 'Are you sure you wish to reset the page count of the selected document?', - 'Are you sure you wish to reset the page count of the selected documents?', + 'Reset the page count of the selected document?', + 'Reset the page count of the selected documents?', len(documents) ) } @@ -659,8 +659,8 @@ def document_clear_transformations(request, document_id=None, document_id_list=N 'next': next, 'previous': previous, 'title': ungettext( - 'Are you sure you wish to clear all the page transformations for the selected document?', - 'Are you sure you wish to clear all the page transformations for the selected documents?', + 'Clear all the page transformations for the selected document?', + 'Clear all the page transformations for the selected documents?', len(documents) ) } @@ -1013,7 +1013,7 @@ def document_type_filename_delete(request, document_type_filename_id): 'previous': previous, 'navigation_object_list': ['document_type', 'filename'], 'next': next, - 'title': _('Are you sure you wish to delete the filename: %(filename)s, from document type "%(document_type)s"?') % { + 'title': _('Delete the filename: %(filename)s, from document type "%(document_type)s"?') % { 'document_type': document_type_filename.document_type, 'filename': document_type_filename }, } @@ -1132,6 +1132,6 @@ def document_version_revert(request, document_version_pk): return render_to_response('appearance/generic_confirm.html', { 'previous': previous, 'object': document_version.document, - 'title': _('Are you sure you wish to revert to this version?'), + 'title': _('Revert to this version?'), 'message': _('All later version after this one will be deleted too.'), }, context_instance=RequestContext(request)) diff --git a/mayan/apps/folders/views.py b/mayan/apps/folders/views.py index d11c6dc3c1..0f3af173ea 100644 --- a/mayan/apps/folders/views.py +++ b/mayan/apps/folders/views.py @@ -127,7 +127,7 @@ def folder_delete(request, folder_id): 'previous': previous, 'next': next, 'object': folder, - 'title': _('Are you sure you with to delete the folder: %s?') % folder, + 'title': _('Delete the folder: %s?') % folder, } return render_to_response('appearance/generic_confirm.html', context, @@ -276,8 +276,8 @@ def folder_document_remove(request, folder_id, document_id=None, document_id_lis 'object': folder, 'previous': previous, 'title': ungettext( - 'Are you sure you wish to remove the selected document from the folder: %(folder)s?', - 'Are you sure you wish to remove the selected documents from the folder: %(folder)s?', + 'Remove the selected document from the folder: %(folder)s?', + 'Remove the selected documents from the folder: %(folder)s?', len(folder_documents) ) % {'folder': folder} } diff --git a/mayan/apps/linking/views.py b/mayan/apps/linking/views.py index 0048b38ff3..169d956675 100644 --- a/mayan/apps/linking/views.py +++ b/mayan/apps/linking/views.py @@ -215,7 +215,7 @@ def smart_link_delete(request, smart_link_pk): return render_to_response('appearance/generic_confirm.html', { 'delete_view': True, 'object': smart_link, - 'title': _('Are you sure you wish to delete smart link: %s?') % smart_link, + 'title': _('Delete smart link: %s?') % smart_link, 'next': next, 'previous': previous, }, context_instance=RequestContext(request)) @@ -326,5 +326,5 @@ def smart_link_condition_delete(request, smart_link_condition_pk): 'next': next, 'object': smart_link_condition.smart_link, 'previous': previous, - 'title': _('Are you sure you wish to delete smart link condition: "%s"?') % smart_link_condition, + 'title': _('Delete smart link condition: "%s"?') % smart_link_condition, }, context_instance=RequestContext(request)) diff --git a/mayan/apps/ocr/views.py b/mayan/apps/ocr/views.py index 3da5fb4929..e6efc229ec 100644 --- a/mayan/apps/ocr/views.py +++ b/mayan/apps/ocr/views.py @@ -23,16 +23,7 @@ from .permissions import ( class DocumentSubmitView(ConfirmView): - def get_context_data(self, **kwargs): - context = super(DocumentSubmitView, self).get_context_data(**kwargs) - - context.update( - { - 'title': _('Are you sure you wish to submit the selected document for OCR?') - } - ) - - return context + extra_context = {'title': _('Submit the selected document for OCR?')} def object_action(self, request, obj): document = obj @@ -55,9 +46,7 @@ class DocumentSubmitView(ConfirmView): class DocumentAllSubmitView(ConfirmView): - extra_context = { - 'title': _('Submit all documents for OCR?') - } + extra_context = {'title': _('Submit all documents for OCR?')} def post(self, request, *args, **kwargs): count = 0 @@ -71,16 +60,7 @@ class DocumentAllSubmitView(ConfirmView): class DocumentManySubmitView(DocumentSubmitView): - def get_context_data(self, **kwargs): - context = super(DocumentManySubmitView, self).get_context_data(**kwargs) - - context.update( - { - 'title': _('Are you sure you wish to submit the selected documents for OCR?') - } - ) - - return context + extra_context = {'title': _('Submit the selected documents for OCR?')} def post(self, request, *args, **kwargs): for pk in request.GET.get('id_list', '').split(','): @@ -183,8 +163,8 @@ def entry_delete(request, pk=None, pk_list=None): context['object'] = entries[0] context['title'] = ungettext( - 'Are you sure you wish to delete the selected entry?', - 'Are you sure you wish to delete the selected entries?', + 'Delete the selected entry?', + 'Delete the selected entries?', len(entries) ) @@ -233,8 +213,8 @@ def entry_re_queue(request, pk=None, pk_list=None): context['object'] = entries[0] context['title'] = ungettext( - 'Are you sure you wish to re-queue the selected entry?', - 'Are you sure you wish to re-queue the selected entries?', + 'Re-queue the selected entry?', + 'Re-queue the selected entries?', len(entries) ) diff --git a/mayan/apps/tags/views.py b/mayan/apps/tags/views.py index cc0bf4a6ad..683b2b6257 100644 --- a/mayan/apps/tags/views.py +++ b/mayan/apps/tags/views.py @@ -170,8 +170,8 @@ def tag_delete(request, tag_id=None, tag_id_list=None): 'message': _('Will be removed from all documents.'), 'next': next, 'title': ungettext( - 'Are you sure you wish to delete the selected tag?', - 'Are you sure you wish to delete the selected tags?', + 'Delete the selected tag?', + 'Delete the selected tags?', len(tags) ) } @@ -294,18 +294,18 @@ def tag_remove(request, document_id=None, document_id_list=None, tag_id=None, ta if len(tags) == 1: if len(documents) == 1: context['object'] = documents[0] - context['title'] = _('Are you sure you wish to remove the tag "%(tag)s" from the document: %(document)s?') % { + context['title'] = _('Remove the tag "%(tag)s" from the document: %(document)s?') % { 'tag': ', '.join([unicode(d) for d in tags]), 'document': ', '.join([unicode(d) for d in documents])} else: - context['title'] = _('Are you sure you wish to remove the tag "%(tag)s" from the documents: %(documents)s?') % { + context['title'] = _('Remove the tag "%(tag)s" from the documents: %(documents)s?') % { 'tag': ', '.join([unicode(d) for d in tags]), 'documents': ', '.join([unicode(d) for d in documents])} elif len(tags) > 1: if len(documents) == 1: context['object'] = documents[0] - context['title'] = _('Are you sure you wish to remove the tags: %(tags)s from the document: %(document)s?') % { + context['title'] = _('Remove the tags: %(tags)s from the document: %(document)s?') % { 'tags': ', '.join([unicode(d) for d in tags]), 'document': ', '.join([unicode(d) for d in documents])} else: - context['title'] = _('Are you sure you wish to remove the tags %(tags)s from the documents: %(documents)s?') % { + context['title'] = _('Remove the tags %(tags)s from the documents: %(documents)s?') % { 'tags': ', '.join([unicode(d) for d in tags]), 'documents': ', '.join([unicode(d) for d in documents])} if request.method == 'POST': diff --git a/mayan/apps/user_management/views.py b/mayan/apps/user_management/views.py index 651448cd00..585544bbfc 100644 --- a/mayan/apps/user_management/views.py +++ b/mayan/apps/user_management/views.py @@ -144,9 +144,9 @@ def user_delete(request, user_id=None, user_id_list=None): } if len(users) == 1: context['object'] = users[0] - context['title'] = _('Are you sure you wish to delete the user: %s?') % ', '.join([unicode(d) for d in users]) + context['title'] = _('Delete the user: %s?') % ', '.join([unicode(d) for d in users]) elif len(users) > 1: - context['title'] = _('Are you sure you wish to delete the users: %s?') % ', '.join([unicode(d) for d in users]) + context['title'] = _('Delete the users: %s?') % ', '.join([unicode(d) for d in users]) return render_to_response('appearance/generic_confirm.html', context, context_instance=RequestContext(request)) @@ -330,9 +330,9 @@ def group_delete(request, group_id=None, group_id_list=None): } if len(groups) == 1: context['object'] = groups[0] - context['title'] = _('Are you sure you wish to delete the group: %s?') % ', '.join([unicode(d) for d in groups]) + context['title'] = _('Delete the group: %s?') % ', '.join([unicode(d) for d in groups]) elif len(groups) > 1: - context['title'] = _('Are you sure you wish to delete the groups: %s?') % ', '.join([unicode(d) for d in groups]) + context['title'] = _('Delete the groups: %s?') % ', '.join([unicode(d) for d in groups]) return render_to_response('appearance/generic_confirm.html', context, context_instance=RequestContext(request))