mirror of
https://github.com/DMOJ/online-judge.git
synced 2024-11-25 16:32:37 +08:00
Use consistent capitals for admin column descriptions
This commit is contained in:
parent
98c755706a
commit
d6dd630b3e
@ -51,7 +51,7 @@ class CommentAdmin(VersionAdmin):
|
||||
'%d comments successfully unhidden.',
|
||||
count) % count)
|
||||
|
||||
@admin.display(description=_('Associated page'), ordering='page')
|
||||
@admin.display(description=_('associated page'), ordering='page')
|
||||
def linked_page(self, obj):
|
||||
link = obj.link
|
||||
if link is not None:
|
||||
|
@ -174,7 +174,7 @@ class ProblemAdmin(NoBatchDeleteMixin, VersionAdmin):
|
||||
fields += ('description',)
|
||||
return fields
|
||||
|
||||
@admin.display(description=_('Authors'))
|
||||
@admin.display(description=_('authors'))
|
||||
def show_authors(self, obj):
|
||||
return ', '.join(map(attrgetter('user.username'), obj.authors.all()))
|
||||
|
||||
|
@ -92,15 +92,15 @@ class ProfileAdmin(NoBatchDeleteMixin, VersionAdmin):
|
||||
return format_html('<a href="{0}" style="white-space:nowrap;">{1}</a>',
|
||||
obj.get_absolute_url(), gettext('View on site'))
|
||||
|
||||
@admin.display(description=_('User'), ordering='user__username')
|
||||
@admin.display(description=_('user'), ordering='user__username')
|
||||
def admin_user_admin(self, obj):
|
||||
return obj.username
|
||||
|
||||
@admin.display(description=_('Email'), ordering='user__email')
|
||||
@admin.display(description=_('email'), ordering='user__email')
|
||||
def email(self, obj):
|
||||
return obj.user.email
|
||||
|
||||
@admin.display(description=_('Timezone'), ordering='timezone')
|
||||
@admin.display(description=_('timezone'), ordering='timezone')
|
||||
def timezone_full(self, obj):
|
||||
return obj.timezone
|
||||
|
||||
|
@ -207,23 +207,23 @@ class SubmissionAdmin(VersionAdmin):
|
||||
'%d submissions were successfully rescored.',
|
||||
len(submissions)) % len(submissions))
|
||||
|
||||
@admin.display(description=_('Problem code'), ordering='problem__code')
|
||||
@admin.display(description=_('problem code'), ordering='problem__code')
|
||||
def problem_code(self, obj):
|
||||
return obj.problem.code
|
||||
|
||||
@admin.display(description=_('Problem name'), ordering='problem__name')
|
||||
@admin.display(description=_('problem name'), ordering='problem__name')
|
||||
def problem_name(self, obj):
|
||||
return obj.problem.name
|
||||
|
||||
@admin.display(description=_('User'), ordering='user__user__username')
|
||||
@admin.display(description=_('user'), ordering='user__user__username')
|
||||
def user_column(self, obj):
|
||||
return obj.user.user.username
|
||||
|
||||
@admin.display(description=_('Time'), ordering='time')
|
||||
@admin.display(description=_('time'), ordering='time')
|
||||
def execution_time(self, obj):
|
||||
return round(obj.time, 2) if obj.time is not None else 'None'
|
||||
|
||||
@admin.display(description=_('Memory'), ordering='memory')
|
||||
@admin.display(description=_('memory'), ordering='memory')
|
||||
def pretty_memory(self, obj):
|
||||
memory = obj.memory
|
||||
if memory is None:
|
||||
@ -233,7 +233,7 @@ class SubmissionAdmin(VersionAdmin):
|
||||
else:
|
||||
return gettext('%.2f MB') % (memory / 1024)
|
||||
|
||||
@admin.display(description=_('Language'), ordering='language__name')
|
||||
@admin.display(description=_('language'), ordering='language__name')
|
||||
def language_column(self, obj):
|
||||
return obj.language.name
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user