Better keyword display view with i18n

This commit is contained in:
David Convent 2013-04-11 12:11:23 +02:00
parent 74ff838ee8
commit d7a8814c9f
8 changed files with 205 additions and 100 deletions

View File

@ -12,78 +12,80 @@
<h1 class="documentFirstHeading" tal:content="context/Title" />
<div tal:replace="structure provider:plone.belowcontenttitle" />
<div id="dmskeywords-navigation">
<div id="dmskeywords-navigation"
i18n:domain="collective.dms.thesaurus">
<tal:broader define="widget python:view.widgets.get('broader')">
<div id="dmskeywords-navigation-broader-field"
class="field">
<label tal:content="widget/label" />
<div id="dmskeywords-navigation-left">
<tal:broader define="widget python:view.widgets.get('broader')">
<div id="dmskeywords-navigation-broader-field"
class="field">
<label tal:content="widget/label" />
<br />
<div tal:content="structure widget/render" />
</div>
</tal:broader>
<h1 class="documentFirstHeading" tal:content="context/Title" />
<p class="documentDescription"
tal:define="widget python:view.widgets.get('equivs')"
tal:condition="widget/terms"
><label tal:content="widget/label"
/>[<tal:equiv-terms repeat="value widget/terms"
><span tal:content="value"
/><span tal:condition="not:repeat/value/end"
tal:replace="python:', '"
/></tal:equiv-terms>]</p>
<dl class="portalMessage warning"
tal:define="widget python:view.widgets.get('scope_note')"
tal:condition="widget/value"
><dt tal:content="widget/label"/><dd >
<span tal:replace="structure widget/render" />
</dd></dl>
<dl class="portalMessage info"
tal:define="widget python:view.widgets.get('historical_note')"
tal:condition="widget/value"
><dt tal:content="widget/label"/><dd >
<span tal:replace="structure widget/render" />
</dd></dl>
<div class="field" id="dmskeywords-navigation-narrower-field">
<label i18n:translate="">NT (Narrower Terms)</label>
<br />
<div tal:content="structure widget/render" />
<tal:list condition="view/children">
<ul id="" class=""
tal:attributes="id string:form-widgets-children;
class string:contenttree-widget narrowerthesauruskeywords-field;
"><li tal:repeat="value view/children"
><a href="#"
tal:content="value/label"
tal:attributes="href value/url"
/></li
></ul></tal:list>
<em tal:condition="not:view/children"
i18n:translate="">nothing</em>
</div>
</tal:broader>
<div id="dmskeywords-navigation-middle">
<h1 class="documentFirstHeading" tal:content="context/Title" />
<p class="documentDescription">
<tal:equivs define="widget python:view.widgets.get('equivs')"
condition="python:widget.__name__ not in ('IBasic.title', 'IBasic.description', 'title', 'description',) and widget.terms()"
>[
<tal:equiv-terms repeat="value widget/terms"
><span tal:content="value"
/><span tal:condition="not:repeat/value/end"
tal:replace="python:', '"
/></tal:equiv-terms>
]</tal:equivs></p>
<dl class="portalMessage warning"
tal:define="widget python:view.widgets.get('scope_note')"
tal:condition="widget/value"
><dt tal:content="widget/label"/><dd >
<span tal:replace="structure widget/render" />
</dd></dl>
<dl class="portalMessage info"
tal:define="widget python:view.widgets.get('historical_note')"
tal:condition="widget/value"
><dt tal:content="widget/label"/><dd >
<span tal:replace="structure widget/render" />
</dd></dl>
<div class="field" id="dmskeywords-navigation-related-field">
<label tal:content="string:RT (Related Terms)" />
<br />
<tal:list condition="view/related">
<ul id="" class=""
tal:attributes="id string:form-widgets-related;
class string:contenttree-widget relatedthesauruskeywords-field;
"><li tal:repeat="value view/related"
><a href="#"
tal:content="value/label"
tal:attributes="href value/url"
/></li
></ul></tal:list>
<em tal:condition="not:view/related">none</em>
</div>
</div>
<div class="field" id="dmskeywords-navigation-narrower-field">
<label tal:content="string:NT (Narrower Terms)" />
<br />
<tal:list condition="view/children">
<ul id="" class=""
tal:attributes="id string:form-widgets-children;
class string:contenttree-widget narrowerthesauruskeywords-field;
"><li tal:repeat="value view/children"
><a href="#"
tal:content="value/label"
tal:attributes="href value/url"
/></li
></ul></tal:list>
<em tal:condition="not:view/children">none</em>
<div id="dmskeywords-navigation-right">
<div class="field" id="dmskeywords-navigation-related-field">
<label i18n:translate="">RT (Related Terms)</label>
<br />
<tal:list condition="view/related">
<ul id="" class=""
tal:attributes="id string:form-widgets-related;
class string:contenttree-widget relatedthesauruskeywords-field;
"><li tal:repeat="value view/related"
><a href="#"
tal:content="value/label"
tal:attributes="href value/url"
/></li
></ul></tal:list>
<em tal:condition="not:view/related"
i18n:translate="">nothing</em>
</div>
</div>
</div>

View File

@ -1,18 +1,14 @@
/* @override http://localhost:9080/Plone/portal_css/Sunburst%20Theme/++resource++thesaurus_navigation.css */
#dmskeywords-navigation-middle {
margin: 0;
padding: 1em 0;
border-top: 1px solid black;
border-bottom: 1px solid black;
.site-Plone.section-th
#dmskeywords-navigation {
float: left;
border: 1px solid gray;
margin: 1em 0;
padding: 1em;
width: 90%;
}
#dmskeywords-navigation-broader,
#dmskeywords-navigation-narrower,
#dmskeywords-navigation-equivs,
#dmskeywords-navigation-related {
margin: 0;
padding: 0;
padding-top: 10px;
#dmskeywords-navigation h1 {
margin-bottom: .5em;
}
#dmskeywords-navigation-broader {
@ -23,25 +19,13 @@
padding-top: 1em;
}
#dmskeywords-navigation-middle h1,
#dmskeywords-navigation-middle .documentDescription {
margin-bottom: 0;
}
#dmskeywords-navigation-left {
float: left;
padding-right: 1em;
}
#dmskeywords-navigation-center {
float: left;
padding-left: 1em;
padding-right: 1em;
border-left: 1px solid black;
border-right: 1px solid black;
}
#dmskeywords-navigation-right {
float: right;
padding-left: 1em;
float: left;
}
border-left: 1px solid gray;
}

View File

@ -40,13 +40,13 @@ class IDmsKeyword(model.Schema):
# HN: historical note
historical_note = schema.Text(
title=_(u"Historical Note"),
title=_(u"HN (Historical Note)"),
required=False,
)
# SN: scope note
scope_note = schema.Text(
title=_(u"Scope Note"),
title=_(u"SN (Scope Note)"),
required=False,
)

View File

@ -17,3 +17,31 @@ msgstr ""
"Preferred-Encodings: utf-8 latin1\n"
"Domain: collective.dms.thesaurus\n"
#: ./dmskeyword.py
msgid "EQ (Equivalences)"
msgstr ""
#: ./dmskeyword.py
msgid "BT (Broader Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "RT (Related Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "NT (Narrower Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "NH (Historical Note)"
msgstr ""
#: ./dmskeyword.py
msgid "NA (Scope Note)"
msgstr ""
#: ./browser/dmskeyword_view.pt
msgid "nothing"
msgstr ""

View File

@ -0,0 +1,45 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-01-09 07:42+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: en\n"
"Language-Name: English\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: plone\n"
"X-is-fallback-for: en-au en-ca en-gb en-us\n"
#: ./dmskeyword.py
msgid "EQ (Equivalences)"
msgstr ""
#: ./dmskeyword.py
msgid "BT (Broader Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "RT (Related Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "NT (Narrower Terms)"
msgstr ""
#: ./dmskeyword.py
msgid "NH (Historical Note)"
msgstr ""
#: ./dmskeyword.py
msgid "NA (Scope Note)"
msgstr ""
#: ./browser/dmskeyword_view.pt
msgid "nothing"
msgstr ""

View File

@ -0,0 +1,45 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2013-01-09 07:42+0000\n"
"PO-Revision-Date: 2013-04-10 23:42+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0\n"
"Language-Code: fr\n"
"Language-Name: French\n"
"Preferred-Encodings: utf-8 latin1\n"
"Domain: plone\n"
"X-is-fallback-for: fr-fr fr-be fr-ca\n"
#: ./dmskeyword.py
msgid "EQ (Equivalences)"
msgstr "Employé pour (équivalences)"
#: ./dmskeyword.py
msgid "BT (Broader Terms)"
msgstr "BT (Termes génériques)"
#: ./dmskeyword.py
msgid "RT (Related Terms)"
msgstr "RT (Voir aussi — Termes associés)"
#: ./dmskeyword.py
msgid "NT (Narrower Terms)"
msgstr "NT (Termes spécifiques)"
#: ./dmskeyword.py
msgid "NH (Historical Note)"
msgstr "NH (Note historique)"
#: ./dmskeyword.py
msgid "NA (Scope Note)"
msgstr "NA (Note d'application)"
#: ./browser/dmskeyword_view.pt
msgid "nothing"
msgstr "néant"

View File

@ -21,5 +21,5 @@ msgstr "Mot clé du thesaurus"
#: ./profiles/default/types/dmsthesaurus.xml
msgid "Thesaurus"
msgstr "Thesaurus"
msgstr "Thésaurus"

View File

@ -8,4 +8,5 @@
/></li
></ul>
<em tal:condition="not:view/displayItems"
i18n:translate="">none</em>
i18n:domain="collective.dms.thesaurus"
i18n:translate="">nothing</em>