Commit f6ffe05b authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

[ui] Add missing reledit view for PDO dimensions

parent d502acaa211c
......@@ -39,6 +39,9 @@ msgstr ""
msgid "<no title specified>"
msgstr ""
msgid "<no unit specified>"
msgstr ""
msgid "<no value specified>"
msgstr ""
......@@ -7681,6 +7684,10 @@ msgctxt "SEDAType"
msgid "type"
msgstr ""
#, python-brace-format
msgid "unit: {0}"
msgstr ""
msgid "user_annotation"
msgstr ""
......
......@@ -39,6 +39,9 @@ msgstr "<règle libre>"
msgid "<no title specified>"
msgstr "<titre libre>"
msgid "<no unit specified>"
msgstr "<unité libre>"
msgid "<no value specified>"
msgstr "<valeur libre>"
......@@ -7693,6 +7696,10 @@ msgctxt "SEDAType"
msgid "type"
msgstr ""
#, python-brace-format
msgid "unit: {0}"
msgstr "unité : {0}"
msgid "user_annotation"
msgstr "description"
......
......@@ -17,6 +17,8 @@
import json
from logilab.mtconverter import xml_escape
from cubicweb import tags
from cubicweb.predicates import match_form_params, is_instance
from cubicweb.web.views import uicfg, tabs
......@@ -235,3 +237,16 @@ class AttachmentTypedBusinessValueEntityView(viewlib.BusinessValueEntityView):
attributes.append(display)
if attributes:
self.w(self._cw._(' (attributes: %s)') % ', '.join(attributes))
class UnitBusinessValueEntityView(viewlib.BusinessValueEntityView):
__select__ = is_instance('SEDAWidth', 'SEDAHeight', 'SEDADepth', 'SEDAShape',
'SEDADiameter', 'SEDALength', 'SEDAThickness', 'SEDAWeight')
def entity_call(self, entity):
super(UnitBusinessValueEntityView, self).entity_call(entity)
if entity.seda_unit:
unit = self._cw._('unit: {0}').format(entity.seda_unit[0].label())
else:
unit = self._cw._('<no unit specified>')
self.w(u' (%s)' % xml_escape(unit))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment