Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 26 #27

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ Alterações
1.0.3 (unreleased)
^^^^^^^^^^^^^^^^^^

* Adiciona internacionalização Português e Espanhol.
[dbarbato]

* Adiciona ação de regra de conteúdo para aplicação de termos
VCGE a conteúdos
VCGE a conteúdos.
[ericof]

* Adiciona condição de regra de conteúdo baseada nos termos
VCGE
VCGE.
[ericof]

1.0.2 (2014-02-28)
Expand Down
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ Este produto utiliza um arquivo `SKOS
W3C para representar vocabulários controlados, dentre outras estruturas de
classificação.

Versionamento
---------------------

As versões 1.x deste pacote se referem ao VCGE 1.0

As versões 2.x deste pacote se referem ao VCGE 2.0.

Ainda não existe um caminho de migração de termos do VCGE 1.0 para o VCGE 2.0, portanto utilize o VCGE 2.0 apenas em **novos** projetos.

Estado deste pacote
---------------------

Expand Down
7 changes: 3 additions & 4 deletions src/brasil/gov/vcge/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding:utf-8 -*-
from zope.i18nmessageid import MessageFactory as BaseMessageFactory
# -*- coding: utf-8 -*-
from zope.i18nmessageid import MessageFactory


MessageFactory = BaseMessageFactory('brasil.gov.vcge')
_ = MessageFactory('brasil.gov.vcge')
6 changes: 3 additions & 3 deletions src/brasil/gov/vcge/at/extender.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding:utf-8 -*-
from Products.Archetypes import public as atapi
from Products.Archetypes.interfaces import IBaseContent
from archetypes.schemaextender.field import ExtensionField
from archetypes.schemaextender.interfaces import IBrowserLayerAwareExtender
from brasil.gov.vcge import MessageFactory as _
from brasil.gov.vcge import _ as _
from brasil.gov.vcge.interfaces import IVCGEInstalado
from Products.Archetypes import public as atapi
from Products.Archetypes.interfaces import IBaseContent
from raptus.autocompletewidget.widget import AutocompleteMultiSelectionWidget
from zope.component import adapts
from zope.interface import implements
Expand Down
2 changes: 1 addition & 1 deletion src/brasil/gov/vcge/browser/templates/vcge.pt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="documentByLine"
tal:define="categories view/skos|nothing;"
tal:condition="categories">
<tal:filedunder i18n:translate="">Assunto(s):</tal:filedunder>
<tal:filedunder i18n:translate="">Subject(s):</tal:filedunder>
<span tal:repeat="category categories">
<a href=""
class="link-category"
Expand Down
32 changes: 16 additions & 16 deletions src/brasil/gov/vcge/contentrules/action.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
# -*- coding: utf-8 -*-
from Acquisition import aq_parent
from brasil.gov.vcge.contentrules import utils
from OFS.SimpleItem import SimpleItem
from plone.app.contentrules import PloneMessageFactory as _
from brasil.gov.vcge import _ as _
from brasil.gov.vcge.contentrules import utils
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.interface import implements
from zope.schema import Bool
from zope.schema import Choice
from zope.schema import Set


VOCAB = 'brasil.gov.vcge'

FORM_NAME = _(u"Configurar a ação")
FORM_NAME = _(u"Configure the action")

FORM_DESC = _(u'Uma ação que aplica termos do VGCE a um conteúdo')
FORM_DESC = _(u'An action that applies VGCE terms to content')


class IVCGEAction(Interface):
""" Interface utilizada para descrever os elementos configuraveis
desta ação.
"""

same_as_parent = Bool(title=_(u"Utilizar os termos da pasta"),
description=_(u"Selecione esta opção para que os "
u"termos VCGE sejam herdados da "
u"pasta que abriga o conteúdo. "
u"Selecionar esta opção ignora "
u"os termos do campo a seguir."))
same_as_parent = Bool(title=_(u"Use folder terms"),
description=_(u"Select this option to have the "
u"VCGE terms inherited from the "
u"folder that holds the content. "
u"Selecting this option ignores "
u"the terms of the field below."))

skos = Set(title=_(u'VCGE'),
description=_(u'Termos a serem aplicados ao conteúdo.'),
description=_(u'Terms to be applied to the content.'),
required=False,
value_type=Choice(vocabulary=VOCAB))

Expand All @@ -55,9 +55,9 @@ def summary(self):
same_as_parent = self.same_as_parent
skos = self.skos
if same_as_parent:
msg = _(u"Aplica termos da pasta no conteúdo.")
msg = _(u"Applies folder terms to content.")
else:
msg = _(u"Aplica os termos ${skos}",
msg = _(u"Applies the terms ${skos}",
mapping=dict(skos=", ".join(skos)))
return msg

Expand Down Expand Up @@ -94,7 +94,7 @@ class VCGEAddForm(AddForm):
""" Formulario de adicao para acao VCGE
"""
form_fields = form.FormFields(IVCGEAction)
label = _(u"Adicionar ação VCGE na regra de conteúdo")
label = _(u"Add VCGE action to the content rule")
description = FORM_DESC
form_name = FORM_NAME

Expand All @@ -108,6 +108,6 @@ class VCGEEditForm(EditForm):
""" Formulario de adicao para edicao VCGE
"""
form_fields = form.FormFields(IVCGEAction)
label = _(u"Editar ação VCGE na regra de conteúdo")
label = _(u"Edit VCGE action on the content rule")
description = FORM_DESC
form_name = FORM_NAME
29 changes: 14 additions & 15 deletions src/brasil/gov/vcge/contentrules/condition.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# -*- coding:utf-8 -*-
from Acquisition import aq_inner
from brasil.gov.vcge.contentrules import utils
from OFS.SimpleItem import SimpleItem
from plone.app.contentrules import PloneMessageFactory as _
from brasil.gov.vcge import _ as _
from brasil.gov.vcge.contentrules import utils
from plone.app.contentrules.browser.formhelper import AddForm
from plone.app.contentrules.browser.formhelper import EditForm
from plone.contentrules.rule.interfaces import IExecutable
from plone.contentrules.rule.interfaces import IRuleElementData
from zope.component import adapts
from zope.formlib import form
from zope.interface import implements
from zope.interface import Interface
from zope.interface import implements
from zope.schema import Choice
from zope.schema import Set

VOCAB = 'brasil.gov.vcge'

FORM_NAME = _(u"Configurar a condição")
FORM_NAME = _(u"Configure the condition")

FORM_DESC = _(u'Uma condição VGCE executa uma regra de conteúdo apenas se '
u'um dos termos selecionados estiver presente. Caso nenhum termo '
u'seja selecionado a regra será executada apenas em conteúdos sem'
u'termos VCGE aplicados.')
FORM_DESC = _(u'A VGCE condition performs a content rule only if '
u'one of the selected terms is present. If no term is selected, '
u'the rule will be implemented only in content without '
u'VCGE terms applied.')


class IVCGECondition(Interface):
Expand All @@ -30,9 +30,8 @@ class IVCGECondition(Interface):
"""

skos = Set(title=_(u'VCGE'),
description=_(u'Termos a serem procurados. Deixe em branco '
u'para selecionar conteúdos sem nenhum termo VCGE '
u'aplicado.'),
description=_(u'Terms to be searched. Leave blank '
u'to select content with no VCGE term applied.'),
required=False,
value_type=Choice(vocabulary=VOCAB))

Expand All @@ -49,9 +48,9 @@ class VCGECondition(SimpleItem):
def summary(self):
skos = self.skos
if not skos:
msg = _(u"Nenhum termo selecionado")
msg = _(u"No terms selected")
else:
msg = _(u"VCGE contém ${skos}",
msg = _(u"VCGE contains ${skos}",
mapping=dict(skos=" or ".join(skos)))
return msg

Expand Down Expand Up @@ -87,7 +86,7 @@ class VCGEAddForm(AddForm):
de VCGE
"""
form_fields = form.FormFields(IVCGECondition)
label = _(u'Adicionar condição VCGE')
label = _(u'Add VCGE condition')
description = FORM_DESC
form_name = FORM_NAME

Expand All @@ -102,6 +101,6 @@ class VCGEEditForm(EditForm):
de VCGE
"""
form_fields = form.FormFields(IVCGECondition)
label = _(u"Editar condição VCGE")
label = _(u"Edit condition VCGE")
description = FORM_DESC
form_name = FORM_NAME
2 changes: 1 addition & 1 deletion src/brasil/gov/vcge/dx/behaviors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding:utf-8 -*-
from brasil.gov.vcge import MessageFactory as _
from brasil.gov.vcge import _ as _
from brasil.gov.vcge.dx.widget import SkosFieldWidget
from plone.autoform import directives as form
from plone.autoform.interfaces import IFormFieldProvider
Expand Down
87 changes: 84 additions & 3 deletions src/brasil/gov/vcge/locales/brasil.gov.vcge.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: brasil.gov.vcge\n"
"POT-Creation-Date: 2013-03-07 00:46+0000\n"
"POT-Creation-Date: 2014-11-07 16:52+0000\n"
"PO-Revision-Date: 2012-09-18 23:00+0000\n"
"Last-Translator: PloneGov.Br <gov@plone.org.br>\n"
"Language-Team: PloneGov.Br <gov@plone.org.br>\n"
Expand All @@ -14,11 +14,92 @@ msgstr ""
"Preferred-Encodings: utf-8 latin1\n"
"Domain: DOMAIN\n"

#: ../extender.py:37
#: ../contentrules/condition.py:21
msgid "A VGCE condition performs a content rule only if one of the selected terms is present. If no term is selected, the rule will be implemented only in content without VCGE terms applied."
msgstr ""

#: ../contentrules/action.py:97
msgid "Add VCGE action to the content rule"
msgstr ""

#: ../contentrules/condition.py:89
msgid "Add VCGE condition"
msgstr ""

#: ../contentrules/action.py:23
msgid "An action that applies VGCE terms to content"
msgstr ""

#: ../contentrules/action.py:58
msgid "Applies folder terms to content."
msgstr ""

#: ../contentrules/action.py:60
msgid "Applies the terms ${skos}"
msgstr ""

#: ../contentrules/action.py:21
msgid "Configure the action"
msgstr ""

#: ../contentrules/condition.py:19
msgid "Configure the condition"
msgstr ""

#: ../contentrules/action.py:111
msgid "Edit VCGE action on the content rule"
msgstr ""

#: ../contentrules/condition.py:104
msgid "Edit condition VCGE"
msgstr ""

#: ../profiles/default/registry.xml
#: ../upgrades/v2000/profile/registry.xml
msgid "Metadata"
msgstr ""

#: ../contentrules/condition.py:51
msgid "No terms selected"
msgstr ""

#: ../contentrules/action.py:32
msgid "Select this option to have the VCGE terms inherited from the folder that holds the content. Selecting this option ignores the terms of the field below."
msgstr ""

#: ../browser/templates/vcge.pt:6
msgid "Subject(s):"
msgstr ""

#: ../contentrules/action.py:39
msgid "Terms to be applied to the content."
msgstr ""

#: ../contentrules/condition.py:33
msgid "Terms to be searched. Leave blank to select content with no VCGE term applied."
msgstr ""

#: ../contentrules/action.py:31
msgid "Use folder terms"
msgstr ""

#: ../at/extender.py:39
#: ../contentrules/action.py:38
#: ../contentrules/condition.py:32
msgid "VCGE"
msgstr ""

#: ../extender.py:38
#: ../contentrules/condition.py:53
msgid "VCGE contains ${skos}"
msgstr ""

#: ../profiles/default/registry.xml
#: ../upgrades/v2000/profile/registry.xml
msgid "Vocabulario Controlado do Governo Eletronico"
msgstr ""

#: ../at/extender.py:40
#: ../dx/behaviors.py:26
msgid "vcge_desc"
msgstr ""

Loading