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

[ui] Proper list item view for keyword

parent 80bc50d38a87
......@@ -30,6 +30,9 @@ msgstr ""
msgid "<no final action specified>"
msgstr ""
msgid "<no reference specified>"
msgstr ""
msgid "<no rule specified>"
msgstr ""
......@@ -39,6 +42,9 @@ msgstr ""
msgid "<no title specified>"
msgstr ""
msgid "<no type specified>"
msgstr ""
msgid "<no unit specified>"
msgstr ""
......@@ -4253,6 +4259,22 @@ msgctxt "SEDAJuridictional"
msgid "juridictional"
msgstr ""
#, python-brace-format
msgid "keyword reference: {0}"
msgstr ""
#, python-brace-format
msgid "keyword scheme: {0}"
msgstr ""
#, python-brace-format
msgid "keyword type: {0}"
msgstr ""
#, python-brace-format
msgid "keyword: {0}"
msgstr ""
msgid "keyword_content"
msgstr ""
......@@ -5908,6 +5930,20 @@ msgctxt "Concept"
msgid "seda_keyword_reference_to_object"
msgstr ""
msgid "seda_keyword_reference_to_scheme"
msgstr ""
msgctxt "SEDAKeywordReference"
msgid "seda_keyword_reference_to_scheme"
msgstr ""
msgid "seda_keyword_reference_to_scheme_object"
msgstr ""
msgctxt "ConceptScheme"
msgid "seda_keyword_reference_to_scheme_object"
msgstr ""
msgid "seda_keyword_type_from"
msgstr ""
......
......@@ -30,6 +30,9 @@ msgstr "<propriétaire libre>"
msgid "<no final action specified>"
msgstr "<action finale libre>"
msgid "<no reference specified>"
msgstr "<référence libre>"
msgid "<no rule specified>"
msgstr "<règle libre>"
......@@ -39,6 +42,9 @@ msgstr "<règle libre>"
msgid "<no title specified>"
msgstr "<titre libre>"
msgid "<no type specified>"
msgstr "<type libre>"
msgid "<no unit specified>"
msgstr "<unité libre>"
......@@ -1087,7 +1093,7 @@ msgid "SEDAKeyword"
msgstr ""
msgid "SEDAKeywordContent"
msgstr ""
msgstr "mot-clé"
msgctxt "inlined:SEDAKeyword.seda_keyword_content.subject"
msgid "SEDAKeywordContent"
......@@ -1097,7 +1103,7 @@ msgid "SEDAKeywordContent_plural"
msgstr ""
msgid "SEDAKeywordReference"
msgstr ""
msgstr "référence"
msgctxt "inlined:SEDAKeyword.seda_keyword_reference_from.object"
msgid "SEDAKeywordReference"
......@@ -1107,7 +1113,7 @@ msgid "SEDAKeywordReference_plural"
msgstr ""
msgid "SEDAKeywordType"
msgstr ""
msgstr "type"
msgctxt "inlined:SEDAKeyword.seda_keyword_type_from.object"
msgid "SEDAKeywordType"
......@@ -4261,8 +4267,24 @@ msgctxt "SEDAJuridictional"
msgid "juridictional"
msgstr ""
#, python-brace-format
msgid "keyword reference: {0}"
msgstr "référence : {0}"
#, python-brace-format
msgid "keyword scheme: {0}"
msgstr "vocabulaire : {0}"
#, python-brace-format
msgid "keyword type: {0}"
msgstr "type : {0}"
#, python-brace-format
msgid "keyword: {0}"
msgstr "mot-clé : {0}"
msgid "keyword_content"
msgstr "contenu"
msgstr "valeur"
msgctxt "SEDAKeywordContent"
msgid "keyword_content"
......@@ -5903,7 +5925,7 @@ msgid "seda_keyword_reference_from_object"
msgstr ""
msgid "seda_keyword_reference_to"
msgstr "identifiant"
msgstr "concept (mot-clé de référence)"
msgctxt "SEDAKeywordReference"
msgid "seda_keyword_reference_to"
......@@ -5916,6 +5938,20 @@ msgctxt "Concept"
msgid "seda_keyword_reference_to_object"
msgstr ""
msgid "seda_keyword_reference_to_scheme"
msgstr "vocabulaire"
msgctxt "SEDAKeywordReference"
msgid "seda_keyword_reference_to_scheme"
msgstr ""
msgid "seda_keyword_reference_to_scheme_object"
msgstr ""
msgctxt "ConceptScheme"
msgid "seda_keyword_reference_to_scheme_object"
msgstr ""
msgid "seda_keyword_type_from"
msgstr ""
......
......@@ -17,6 +17,8 @@
import itertools
from logilab.mtconverter import xml_escape
from cubicweb.predicates import is_instance
from cubicweb.web.views import tabs, uicfg
......@@ -274,3 +276,34 @@ class ContentHistoryTab(viewlib.SubObjectsTab):
_('creating SEDACustodialHistoryItem (SEDACustodialHistoryItem seda_custodial_history_item '
'SEDAContent %(linkto)s)')
class KeywordBusinessValueEntityView(viewlib.LinkMetaEntityView):
__select__ = viewlib.BusinessValueEntityView.__select__ & is_instance('SEDAKeyword')
def entity_call(self, entity):
if entity.seda_keyword_content[0].keyword_content:
content = entity.seda_keyword_content[0].keyword_content
else:
content = self._cw._('<no value specified>')
msg = xml_escape(self._cw._('keyword: {0}').format(content))
self.w(u'<span class="value">{0} {1}</span>'.format(msg, entity.view('seda.xsdmeta')))
if entity.reverse_seda_keyword_type_from:
kwt = entity.reverse_seda_keyword_type_from[0]
if kwt.seda_keyword_type_to:
kwt_value = kwt.seda_keyword_type_to[0].label()
else:
kwt_value = self._cw._('<no type specified>')
msg = xml_escape(self._cw._('keyword type: {0}').format(kwt_value))
self.w(u'<br/><span>{0} {1}</span>'.format(msg, kwt.view('seda.xsdmeta')))
if entity.reverse_seda_keyword_reference_from:
kwr = entity.reverse_seda_keyword_reference_from[0]
if kwr.concept:
kwr_value = kwr.concept.view('oneline')
msg = xml_escape(self._cw._('keyword reference: {0}')).format(kwr_value)
elif kwr.scheme:
kwr_value = kwr.scheme.view('oneline')
msg = xml_escape(self._cw._('keyword scheme: {0}')).format(kwr_value)
else:
msg = xml_escape(self._cw._('<no reference specified>'))
self.w(u'<br/><span>{0} {1}</span>'.format(msg, kwr.view('seda.xsdmeta')))
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