Issue #39, Finish capitalizing source text messages
This commit is contained in:
@@ -23,7 +23,7 @@ class AccessEntry(models.Model):
|
|||||||
"""
|
"""
|
||||||
Model that hold the permission, object, actor relationship
|
Model that hold the permission, object, actor relationship
|
||||||
"""
|
"""
|
||||||
permission = models.ForeignKey(StoredPermission, verbose_name=_(u'permission'))
|
permission = models.ForeignKey(StoredPermission, verbose_name=_(u'Permission'))
|
||||||
|
|
||||||
holder_type = models.ForeignKey(
|
holder_type = models.ForeignKey(
|
||||||
ContentType,
|
ContentType,
|
||||||
@@ -65,7 +65,7 @@ class DefaultAccessEntry(models.Model):
|
|||||||
def get_classes(cls):
|
def get_classes(cls):
|
||||||
return [AccessObjectClass.encapsulate(cls) for cls in get_classes()]
|
return [AccessObjectClass.encapsulate(cls) for cls in get_classes()]
|
||||||
|
|
||||||
permission = models.ForeignKey(StoredPermission, verbose_name=_(u'permission'))
|
permission = models.ForeignKey(StoredPermission, verbose_name=_(u'Permission'))
|
||||||
|
|
||||||
holder_type = models.ForeignKey(
|
holder_type = models.ForeignKey(
|
||||||
ContentType,
|
ContentType,
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ STATE_ICONS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
STATE_LABELS = {
|
STATE_LABELS = {
|
||||||
STATE_CHECKED_OUT: _(u'checked out'),
|
STATE_CHECKED_OUT: _(u'Checked out'),
|
||||||
STATE_CHECKED_IN: _(u'checked in/available'),
|
STATE_CHECKED_IN: _(u'Checked in/available'),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,14 +21,14 @@ class DocumentCheckout(models.Model):
|
|||||||
"""
|
"""
|
||||||
Model to store the state and information of a document checkout
|
Model to store the state and information of a document checkout
|
||||||
"""
|
"""
|
||||||
document = models.ForeignKey(Document, verbose_name=_(u'document'), unique=True)
|
document = models.ForeignKey(Document, verbose_name=_(u'Document'), unique=True)
|
||||||
checkout_datetime = models.DateTimeField(verbose_name=_(u'check out date and time'), blank=True, null=True)
|
checkout_datetime = models.DateTimeField(verbose_name=_(u'Check out date and time'), blank=True, null=True)
|
||||||
expiration_datetime = models.DateTimeField(verbose_name=_(u'check out expiration date and time'), help_text=_(u'Amount of time to hold the document checked out in minutes.'))
|
expiration_datetime = models.DateTimeField(verbose_name=_(u'Check out expiration date and time'), help_text=_(u'Amount of time to hold the document checked out in minutes.'))
|
||||||
user_content_type = models.ForeignKey(ContentType, null=True, blank=True) # blank and null added for ease of db migration
|
user_content_type = models.ForeignKey(ContentType, null=True, blank=True) # blank and null added for ease of db migration
|
||||||
user_object_id = models.PositiveIntegerField(null=True, blank=True)
|
user_object_id = models.PositiveIntegerField(null=True, blank=True)
|
||||||
user_object = generic.GenericForeignKey(ct_field='user_content_type', fk_field='user_object_id')
|
user_object = generic.GenericForeignKey(ct_field='user_content_type', fk_field='user_object_id')
|
||||||
|
|
||||||
block_new_version = models.BooleanField(default=True, verbose_name=_(u'block new version upload'), help_text=_(u'Do not allow new version of this document to be uploaded.'))
|
block_new_version = models.BooleanField(default=True, verbose_name=_(u'Block new version upload'), help_text=_(u'Do not allow new version of this document to be uploaded.'))
|
||||||
|
|
||||||
# block_metadata
|
# block_metadata
|
||||||
# block_editing
|
# block_editing
|
||||||
@@ -51,5 +51,5 @@ class DocumentCheckout(models.Model):
|
|||||||
return ('checkout:checkout_info', [self.document.pk])
|
return ('checkout:checkout_info', [self.document.pk])
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _(u'document checkout')
|
verbose_name = _(u'Document checkout')
|
||||||
verbose_name_plural = _(u'document checkouts')
|
verbose_name_plural = _(u'Document checkouts')
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def checkout_info(request, document_pk):
|
|||||||
paragraphs.append(_(u'User: %s') % get_object_name(checkout_info.user_object, display_object_type=False))
|
paragraphs.append(_(u'User: %s') % get_object_name(checkout_info.user_object, display_object_type=False))
|
||||||
paragraphs.append(_(u'Check out time: %s') % checkout_info.checkout_datetime)
|
paragraphs.append(_(u'Check out time: %s') % checkout_info.checkout_datetime)
|
||||||
paragraphs.append(_(u'Check out expiration: %s') % checkout_info.expiration_datetime)
|
paragraphs.append(_(u'Check out expiration: %s') % checkout_info.expiration_datetime)
|
||||||
paragraphs.append(_(u'New versions allowed: %s') % (_(u'yes') if not checkout_info.block_new_version else _(u'no')))
|
paragraphs.append(_(u'New versions allowed: %s') % (_(u'Yes') if not checkout_info.block_new_version else _(u'No')))
|
||||||
|
|
||||||
return render_to_response('main/generic_template.html', {
|
return render_to_response('main/generic_template.html', {
|
||||||
'paragraphs': paragraphs,
|
'paragraphs': paragraphs,
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ def pretty_size_10(size):
|
|||||||
|
|
||||||
def return_type(value):
|
def return_type(value):
|
||||||
if isinstance(value, types.FunctionType):
|
if isinstance(value, types.FunctionType):
|
||||||
return value.__doc__ if value.__doc__ else _(u'function found')
|
return value.__doc__ if value.__doc__ else _(u'Function found')
|
||||||
elif isinstance(value, types.ClassType):
|
elif isinstance(value, types.ClassType):
|
||||||
return u'%s.%s' % (value.__class__.__module__, value.__class__.__name__)
|
return u'%s.%s' % (value.__class__.__module__, value.__class__.__name__)
|
||||||
elif isinstance(value, types.TypeType):
|
elif isinstance(value, types.TypeType):
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
|
||||||
|
|
||||||
|
|
||||||
def is_superuser(context):
|
|
||||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
|
||||||
|
|
||||||
|
|
||||||
formats_list = {'text': _('file formats'), 'view': 'converter:formats_list', 'famfam': 'pictures', 'icon': 'pictures.png', 'condition': is_superuser, 'children_view_regex': [r'formats_list']}
|
|
||||||
@@ -19,30 +19,30 @@ TRANSFORMATION_CHOICES = {
|
|||||||
'label': _(u'Resize'),
|
'label': _(u'Resize'),
|
||||||
'description': _(u'Resize.'),
|
'description': _(u'Resize.'),
|
||||||
'arguments': [
|
'arguments': [
|
||||||
{'name': 'width', 'label': _(u'width'), 'required': True},
|
{'name': 'width', 'label': _(u'Width'), 'required': True},
|
||||||
{'name': 'height', 'label': _(u'height'), 'required': False},
|
{'name': 'height', 'label': _(u'Height'), 'required': False},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
TRANSFORMATION_ROTATE: {
|
TRANSFORMATION_ROTATE: {
|
||||||
'label': _(u'Rotate'),
|
'label': _(u'Rotate'),
|
||||||
'description': _(u'Rotate by n degress.'),
|
'description': _(u'Rotate by n degress.'),
|
||||||
'arguments': [
|
'arguments': [
|
||||||
{'name': 'degrees', 'label': _(u'degrees'), 'required': True}
|
{'name': 'degrees', 'label': _(u'Degrees'), 'required': True}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
TRANSFORMATION_DENSITY: {
|
TRANSFORMATION_DENSITY: {
|
||||||
'label': _(u'Density'),
|
'label': _(u'Density'),
|
||||||
'description': _(u'Change the resolution (ie: DPI) without resizing.'),
|
'description': _(u'Change the resolution (ie: DPI) without resizing.'),
|
||||||
'arguments': [
|
'arguments': [
|
||||||
{'name': 'width', 'label': _(u'width'), 'required': True},
|
{'name': 'width', 'label': _(u'Width'), 'required': True},
|
||||||
{'name': 'height', 'label': _(u'height'), 'required': False},
|
{'name': 'height', 'label': _(u'Height'), 'required': False},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
TRANSFORMATION_ZOOM: {
|
TRANSFORMATION_ZOOM: {
|
||||||
'label': _(u'Zoom'),
|
'label': _(u'Zoom'),
|
||||||
'description': _(u'Zoom by n percent.'),
|
'description': _(u'Zoom by n percent.'),
|
||||||
'arguments': [
|
'arguments': [
|
||||||
{'name': 'percent', 'label': _(u'percent'), 'required': True}
|
{'name': 'percent', 'label': _(u'Percent'), 'required': True}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,10 +64,10 @@ def key_list(request, secret=True):
|
|||||||
|
|
||||||
if secret:
|
if secret:
|
||||||
object_list = Key.get_all(gpg, secret=True)
|
object_list = Key.get_all(gpg, secret=True)
|
||||||
title = _(u'private keys')
|
title = _(u'Private keys')
|
||||||
else:
|
else:
|
||||||
object_list = Key.get_all(gpg)
|
object_list = Key.get_all(gpg)
|
||||||
title = _(u'public keys')
|
title = _(u'Public keys')
|
||||||
|
|
||||||
return render_to_response('main/generic_list.html', {
|
return render_to_response('main/generic_list.html', {
|
||||||
'object_list': object_list,
|
'object_list': object_list,
|
||||||
@@ -148,31 +148,31 @@ def key_query(request):
|
|||||||
'attribute': 'keyid',
|
'attribute': 'keyid',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'type'),
|
'name': _(u'Type'),
|
||||||
'attribute': 'algo',
|
'attribute': 'algo',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'creation date'),
|
'name': _(u'Creation date'),
|
||||||
'attribute': 'creation_date',
|
'attribute': 'creation_date',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'disabled'),
|
'name': _(u'Disabled'),
|
||||||
'attribute': 'disabled',
|
'attribute': 'disabled',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'expiration date'),
|
'name': _(u'Expiration date'),
|
||||||
'attribute': 'expiration_date',
|
'attribute': 'expiration_date',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'expired'),
|
'name': _(u'Expired'),
|
||||||
'attribute': 'expired',
|
'attribute': 'expired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'length'),
|
'name': _(u'Length'),
|
||||||
'attribute': 'key_length',
|
'attribute': 'key_length',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'revoked'),
|
'name': _(u'Revoked'),
|
||||||
'attribute': 'revoked',
|
'attribute': 'revoked',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,15 @@ class_permissions(Document, [PERMISSION_COMMENT_CREATE,
|
|||||||
|
|
||||||
register_model_list_columns(Comment, [
|
register_model_list_columns(Comment, [
|
||||||
{
|
{
|
||||||
'name': _(u'date'),
|
'name': _(u'Date'),
|
||||||
'attribute': 'submit_date'
|
'attribute': 'submit_date'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'user'),
|
'name': _(u'User'),
|
||||||
'attribute': encapsulate(lambda x: x.user.get_full_name() if x.user.get_full_name() else x.user)
|
'attribute': encapsulate(lambda x: x.user.get_full_name() if x.user.get_full_name() else x.user)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': _(u'comment'),
|
'name': _(u'Comment'),
|
||||||
'attribute': 'comment'
|
'attribute': 'comment'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ def comments_for_document(request, document_id):
|
|||||||
return render_to_response('main/generic_list.html', {
|
return render_to_response('main/generic_list.html', {
|
||||||
'object': document,
|
'object': document,
|
||||||
'access_object': document,
|
'access_object': document,
|
||||||
'title': _(u'comments: %s') % document,
|
'title': _(u'Comments for document: %s') % document,
|
||||||
'object_list': Comment.objects.for_model(document).order_by('-submit_date'),
|
'object_list': Comment.objects.for_model(document).order_by('-submit_date'),
|
||||||
'hide_link': True,
|
'hide_link': True,
|
||||||
'hide_object': True,
|
'hide_object': True,
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ def get_document_indexing_subtemplate(document):
|
|||||||
return {
|
return {
|
||||||
'name': 'main/generic_list_subtemplate.html',
|
'name': 'main/generic_list_subtemplate.html',
|
||||||
'context': {
|
'context': {
|
||||||
'title': _(u'document indexes'),
|
'title': _(u'Document indexes'),
|
||||||
'object_list': object_list,
|
'object_list': object_list,
|
||||||
'hide_link': True
|
'hide_link': True
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ register_links('documents:document_page_transformation_create', [document_page_t
|
|||||||
register_links(['documents:document_page_transformation_edit', 'documents:document_page_transformation_delete'], [document_page_transformation_create], menu_name='sidebar')
|
register_links(['documents:document_page_transformation_edit', 'documents:document_page_transformation_delete'], [document_page_transformation_create], menu_name='sidebar')
|
||||||
|
|
||||||
register_diagnostic('documents', _(u'Documents'), document_missing_list)
|
register_diagnostic('documents', _(u'Documents'), document_missing_list)
|
||||||
register_maintenance_links([document_find_all_duplicates, document_update_page_count, document_clear_image_cache], namespace='documents', title=_(u'documents'))
|
register_maintenance_links([document_find_all_duplicates, document_update_page_count, document_clear_image_cache], namespace='documents', title=_(u'Documents'))
|
||||||
register_model_list_columns(Document, [
|
register_model_list_columns(Document, [
|
||||||
{
|
{
|
||||||
'name': _(u'Thumbnail'), 'attribute':
|
'name': _(u'Thumbnail'), 'attribute':
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ class DocumentVersion(models.Model):
|
|||||||
major = models.PositiveIntegerField(verbose_name=_(u'Mayor'), default=1)
|
major = models.PositiveIntegerField(verbose_name=_(u'Mayor'), default=1)
|
||||||
minor = models.PositiveIntegerField(verbose_name=_(u'Minor'), default=0)
|
minor = models.PositiveIntegerField(verbose_name=_(u'Minor'), default=0)
|
||||||
micro = models.PositiveIntegerField(verbose_name=_(u'Micro'), default=0)
|
micro = models.PositiveIntegerField(verbose_name=_(u'Micro'), default=0)
|
||||||
release_level = models.PositiveIntegerField(choices=RELEASE_LEVEL_CHOICES, default=RELEASE_LEVEL_FINAL, verbose_name=_(u'release level'))
|
release_level = models.PositiveIntegerField(choices=RELEASE_LEVEL_CHOICES, default=RELEASE_LEVEL_FINAL, verbose_name=_(u'Release level'))
|
||||||
serial = models.PositiveIntegerField(verbose_name=_(u'Serial'), default=0)
|
serial = models.PositiveIntegerField(verbose_name=_(u'Serial'), default=0)
|
||||||
timestamp = models.DateTimeField(verbose_name=_(u'Timestamp'), editable=False, db_index=True)
|
timestamp = models.DateTimeField(verbose_name=_(u'Timestamp'), editable=False, db_index=True)
|
||||||
comment = models.TextField(blank=True, verbose_name=_(u'Comment'))
|
comment = models.TextField(blank=True, verbose_name=_(u'Comment'))
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def results(request, extra_context=None):
|
|||||||
'result_count': result_count}
|
'result_count': result_count}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
title = _(u'results')
|
title = _(u'Results')
|
||||||
|
|
||||||
# Update the context with the search results
|
# Update the context with the search results
|
||||||
context.update({
|
context.update({
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class MetadataForm(forms.Form):
|
|||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
self.fields['value'].initial = exception
|
self.fields['value'].initial = exception
|
||||||
|
|
||||||
id = forms.CharField(label=_(u'id'), widget=forms.HiddenInput)
|
id = forms.CharField(label=_(u'ID'), widget=forms.HiddenInput)
|
||||||
|
|
||||||
name = forms.CharField(label=_(u'Name'), required=False, widget=forms.TextInput(attrs={'readonly': 'readonly'}))
|
name = forms.CharField(label=_(u'Name'), required=False, widget=forms.TextInput(attrs={'readonly': 'readonly'}))
|
||||||
value = forms.CharField(label=_(u'Value'), required=False)
|
value = forms.CharField(label=_(u'Value'), required=False)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ def is_superuser(context):
|
|||||||
return context['request'].user.is_staff or context['request'].user.is_superuser
|
return context['request'].user.is_staff or context['request'].user.is_superuser
|
||||||
|
|
||||||
|
|
||||||
link_execute = {'text': _(u'execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser}
|
link_execute = {'text': _(u'Execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser}
|
||||||
link_namespace_details = {'text': _(u'details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser}
|
link_namespace_details = {'text': _(u'Details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser}
|
||||||
link_namespace_list = {'text': _(u'namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
|
link_namespace_list = {'text': _(u'Namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
|
||||||
link_statistics = {'text': _(u'Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
|
link_statistics = {'text': _(u'Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ def namespace_details(request, namespace_id):
|
|||||||
'object_list': namespace.statistics,
|
'object_list': namespace.statistics,
|
||||||
'hide_link': True,
|
'hide_link': True,
|
||||||
'title': _(u'Namespace details for: %s') % namespace,
|
'title': _(u'Namespace details for: %s') % namespace,
|
||||||
'object_name': _(u'namespace'),
|
'object_name': _(u'Namespace'),
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
||||||
@@ -46,8 +46,8 @@ def execute(request, statistic_id):
|
|||||||
'object': statictic,
|
'object': statictic,
|
||||||
'namespace': statictic.namespace,
|
'namespace': statictic.namespace,
|
||||||
'navigation_object_list': [
|
'navigation_object_list': [
|
||||||
{'object': 'namespace', 'name': _(u'namespace')},
|
{'object': 'namespace', 'name': _(u'Namespace')},
|
||||||
{'object': 'object', 'name': _(u'statistic')},
|
{'object': 'object', 'name': _(u'Statistic')},
|
||||||
],
|
],
|
||||||
'object_list': statictic.get_results(),
|
'object_list': statictic.get_results(),
|
||||||
'hide_link': True,
|
'hide_link': True,
|
||||||
|
|||||||
Reference in New Issue
Block a user