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

[ui] Custom business value view for attachment

introducing special display of its attributes.
parent de1ed3756df3
......@@ -7,6 +7,13 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#, python-format
msgid " (attributes: %s)"
msgstr ""
msgid " ALT_I18N "
msgstr ""
msgid "<no value specified>"
msgstr ""
......@@ -5288,6 +5295,9 @@ msgctxt "SEDANumberOfPage"
msgid "number_of_page"
msgstr ""
msgid "optional"
msgstr ""
msgid "originating_agency_archive_unit_identifier"
msgstr ""
......
......@@ -7,6 +7,13 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#, python-format
msgid " (attributes: %s)"
msgstr "(attributes : %s)"
msgid " ALT_I18N "
msgstr " OU "
msgid "<no value specified>"
msgstr "<valeur libre>"
......@@ -5291,6 +5298,9 @@ msgctxt "SEDANumberOfPage"
msgid "number_of_page"
msgstr ""
msgid "optional"
msgstr "optionnel"
msgid "originating_agency_archive_unit_identifier"
msgstr ""
......
......@@ -23,7 +23,7 @@ from cubicweb.web.views import uicfg, tabs
from cubes.relationwidget import views as rwdg
from cubes.seda.xsd2yams import RDEF_CONSTRAINTS
from cubes.seda.views import rtags_from_xsd_element
from cubes.seda.views import rtags_from_xsd_element, viewlib
_ = unicode
......@@ -173,3 +173,21 @@ class PhysicalDataObjectTabbedPrimaryView(tabs.TabbedPrimaryView):
tabs = [
'main_tab',
]
class AttachmentTypedBusinessValueEntityView(viewlib.BusinessValueEntityView):
__select__ = is_instance('SEDAAttachment')
def entity_call(self, entity):
super(AttachmentTypedBusinessValueEntityView, self).entity_call(entity)
attributes = []
for rtype in ('reverse_seda_uri', 'reverse_seda_filename'):
values = getattr(entity, rtype)
if values:
value = values[0]
display = value.dc_type()
if value.user_cardinality == '0..1':
display += ' <i>%s</i>' % self._cw._('optional')
attributes.append(display)
if attributes:
self.w(self._cw._(' (attributes: %s)') % ', '.join(attributes))
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