Use shorter confirmation messages.

This commit is contained in:
Roberto Rosario
2015-07-17 19:52:17 -04:00
parent 9288f3c903
commit afe6644321
11 changed files with 36 additions and 56 deletions

View File

@@ -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))

View File

@@ -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))

View File

@@ -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))

View File

@@ -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,
}

View File

@@ -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,

View File

@@ -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))

View File

@@ -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}
}

View File

@@ -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))

View File

@@ -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)
)

View File

@@ -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':

View File

@@ -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))