Merge "Make volume status detail translatable"

This commit is contained in:
Jenkins 2015-07-20 19:49:17 +00:00 committed by Gerrit Code Review
commit a116fa7bfb
2 changed files with 8 additions and 1 deletions

View File

@ -16,7 +16,7 @@
<dd>{{ volume.description }}</dd>
{% endif %}
<dt>{% trans "Status" %}</dt>
<dd>{{ volume.status|capfirst }}</dd>
<dd>{{ volume.status_label|capfirst }}</dd>
</dl>
</div>

View File

@ -52,6 +52,13 @@ class DetailView(tabs.TabView):
context["volume"] = volume
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(volume)
status_label = [label for (value, label) in
project_tables.VolumesTableBase.STATUS_DISPLAY_CHOICES
if value.lower() == (volume.status or '').lower()]
if status_label:
volume.status_label = status_label[0]
else:
volume.status_label = volume.status
return context
@memoized.memoized_method