From cc4da4bbba61589b26c02d5d3c11cf47337508d9 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 31 Oct 2011 07:51:33 +0100 Subject: [PATCH 01/10] fix class reference for contents view in management interface --- browser/configure.zcml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/configure.zcml b/browser/configure.zcml index 1bc2f89..6dee3f7 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -29,7 +29,7 @@ From 8c56ddeec86f88ba337e2ad9fd22bc6fc9227f43 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 31 Oct 2011 11:54:48 +0100 Subject: [PATCH 02/10] add new 'create Orgunit' action --- locales/de/LC_MESSAGES/loops.mo | Bin 14927 -> 15113 bytes locales/de/LC_MESSAGES/loops.po | 20 +++++++++++++------- organize/browser/party.py | 10 ++++++++++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index 5263c366ac0ad27fa7a01d996783c2b09d09792c..155a88692afb270ff8c1f5b58c075eda87277c2b 100644 GIT binary patch delta 6126 zcmZwLdz_C|0>|-Zm@$mYFym5gGl+7V7`HA|WOgZ&lu}z^XqM45a;;Q;wV`a5GL(>P zBvf+CCEccrjU=MWN_Jg0ZQDf>YpKuY_d9y^$3Cyu*ZZ93InO!gInVk1ep4Tgo;)_T zCnI@g#8E3Lit6J#6{Bbj<>DHijiSryMA6mQ6 zj>%_5Q6;Q}RWJ)_AB$R1@P;{HWvEQIx`oOVI{-Xvg`Xem&Y@f6Ty<;rc{$LQ~NvoP|Ew zl5l+uI?*@Kb{o+}-G;W`hnb8Y{Xl_Lic;$)8f2j}Zi_bTiZ$^XwA~PNg<@!jGtqX> zArBR;Lnpc&UAY5T4UeD`OsbdYzZ%ATvW67wFc%%5N2m`(I~t2lU@|h-XdX7gb>aLj zY(V{6bV60xNcNkB*4trxWih_8Xg}B2XZ<~K2Pcy8Zgi=}qn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^t!B~cwimSmFkK0aWMKv>H^Hh>6pp$qj?mZ!9sN88_)-DLO0bGw1bZ@ z3qMB(_&xeclDfw$(*}LV`N#(pm7oI{k4|s~+TSd6b5>x&6N@Me#>dblK8$X{Ds-mJ zdPGqh?1(PmAhhF==zu3f6z;;)@=vzwi7g4UQ=7__%{? zv^@uXKpy(wd~}9A(SZ-ZMmPk$zYM)@GCH8?*bC>OU&)*3E82&=t*GjF*545qo)AB% z7#&&PP#+W=j(%R}qnq;@^uFtZGlO%`2UnoiJ&MdNT7mwz>0Q_nkD>!^pXeFSqzHYd zC!r%d1)b^C(0(I&!!77us0inmp$}SvuE=_H?`%Lf+pFj++>Ng2LG-%sLVF^)IG#xZ zY{-e`=n52~H}nbT2ci!eigqvz9nffWQ%yi76Nj(jP)MWm-x6z`E#tjYGXPI>1iogLbq}yg>$$fyCo&QindOu*e3E zGf7?AKEYQ=CS{MtqX76Ax>_3Y9uUc{id53f&Gs&f76Y;1){$L>-wOGz_ z$}33@`4cH2$Bqjr%qM$EGI@}EPv(*@h{qGIe^PiaHatoCSolB3sk99x%gGeabKh{- zVwvNQu_eji+HZbtt}fN2?GoSP-+p!C0QDi{y3l?a-a(p@Ysue9ZIVU@ z9127KIvgav2^z))@Q& zH8W^$a*r1+)X+XkE?wD`zREU_sDDHm&bpptRU?}J\n" "Language-Team: loops developers \n" "MIME-Version: 1.0\n" @@ -114,13 +114,13 @@ msgid "Create Glossary Item..." msgstr "Glossareintrag anlegen..." msgid "Create Glossary Item" -msgstr "Glossareintrag anlegen" +msgstr "Glossareintrag anlegen." msgid "Create Person..." msgstr "Person anlegen..." msgid "Create a new person." -msgstr "Eine neue Person anlegen" +msgstr "Eine neue Person anlegen." msgid "Edit Person..." msgstr "Person bearbeiten..." @@ -132,25 +132,31 @@ msgid "Create Institution..." msgstr "Institution anlegen..." msgid "Create a new institution." -msgstr "Eine neue Institution anlegen" +msgstr "Eine neue Institution anlegen." msgid "Edit Institution..." msgstr "Institution bearbeiten..." msgid "Modify institution." -msgstr "Institution bearbeiten" +msgstr "Institution bearbeiten." + +msgid "Create Orgunit..." +msgstr "Organisationseinheit anlegen..." + +msgid "Create a new organizational unit." +msgstr "Eine neue Organisationseinheit anlegen." msgid "Create Address..." msgstr "Adresse anlegen..." msgid "Create a new address." -msgstr "Eine neue Adresse anlegen" +msgstr "Eine neue Adresse anlegen." msgid "Edit Address..." msgstr "Adresse bearbeiten..." msgid "Modify address." -msgstr "Adresse bearbeiten" +msgstr "Adresse bearbeiten." msgid "Create Concept, Type = " msgstr "Begriff anlegen, Typ = " diff --git a/organize/browser/party.py b/organize/browser/party.py index 5062013..2aa8be4 100644 --- a/organize/browser/party.py +++ b/organize/browser/party.py @@ -96,6 +96,16 @@ actions.register('editInstitution', 'portlet', DialogAction, dialogName='editInstitution', ) +actions.register('createOrgUnit', 'portlet', DialogAction, + title=_(u'Create Orgunit...'), + description=_(u'Create a new organizational unit.'), + viewName='create_concept.html', + dialogName='createOrgUnit', + typeToken='.loops/concepts/orgunit', + fixedType=True, + innerForm='inner_concept_form.html', +) + actions.register('send_email', 'object', DialogAction, description=_(u'Send a link to this object by email.'), viewName='object_send_email.html', From de4496830c5316742d29add36bb97c6ad83a8206 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 31 Oct 2011 12:10:57 +0100 Subject: [PATCH 03/10] add new 'Create Project' action --- locales/de/LC_MESSAGES/loops.mo | Bin 15113 -> 15234 bytes locales/de/LC_MESSAGES/loops.po | 10 ++++++++-- organize/browser/party.py | 2 -- organize/browser/task.py | 15 ++++++++++++--- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index 155a88692afb270ff8c1f5b58c075eda87277c2b..616b70a25aa0e526ef0b7ce215c893781f0a340c 100644 GIT binary patch delta 6034 zcmYk=3!IKs0>|+)W*Ea5Gh+-w%8ZfAU=)=K5nVP#C1pj0ELInZ?fOb37ZuwRJ-1iPvEZ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4?CHo-&aeRbP7G2VZ}RDsVmI&d@e9d<+qJO}NtD0m4v zp}uIle&`Af#2R=HX5$2OrDmZ^y%cS?0iD=R>x>_LPoX+iYMcCO)x{drJD_``2l@nk z(V34z2YwLURAbTmCu0uILnrtO`byTJEAu5f@LuE-7#+gccXdj;E&K#sfv?f_hr{)9XC(t=qW5Q^6RM5wsfNg+MJ>>GKNx8j zM-Nl5;RN*EJdJidH`HH3J6MYjT#8+>44qh=vy=Pt(I+iH?=M8}>lm(gL)%{(?2Dk8QQp#_W_sM*+ggi}te;lLIi(C*+K91j#^T;0ZFlk8~ z=r0go!9Tv&>EutuC-LiaDtU-_JV*MF?p8Q@l3U4N$!Ic#RHQ@yAJTEk|0Nz7)SKgr z#CM-XeFgrJTt+zJ=%=I*4MLZzGL3$JoI<6Tv>>ihCfE6R|8`vSTPcd}q&$(_LCS^m zF9qvjRqp*V)K9`%X{`Tb3MYq?a$_hzgP)K_giRj(Le3zwiN_1%F4B$EpyM>MnX<=~ z9s9vl_?JMIhRdBM{#kCc)vu6a7IY8;g} z$R@Iy Date: Wed, 2 Nov 2011 13:37:27 +0100 Subject: [PATCH 04/10] access predicate options via adapter --- browser/concept.py | 4 ++-- tests/setup.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/browser/concept.py b/browser/concept.py index 9fa7d5e..1b867eb 100644 --- a/browser/concept.py +++ b/browser/concept.py @@ -347,8 +347,8 @@ class ConceptView(BaseView): def isHidden(self, pr): if (getName(pr.second.conceptType) in - #IOptions(adapted(pr.predicate))('hide_parents_for', [])): - IOptions(pr.predicate)('hide_parents_for', [])): + IOptions(adapted(pr.predicate))('hide_parents_for', [])): + #IOptions(pr.predicate)('hide_parents_for', [])): return True hideRoles = None options = component.queryAdapter(adapted(pr.first), IOptions) diff --git a/tests/setup.py b/tests/setup.py index dcc1197..9bd43bd 100644 --- a/tests/setup.py +++ b/tests/setup.py @@ -58,7 +58,8 @@ from loops.browser.node import ViewPropertiesConfigurator from loops.common import NameChooser from loops.concept import Concept from loops.concept import IndexAttributes as ConceptIndexAttributes -from loops.config.base import GlobalOptions, LoopsOptions, QueryOptions, TypeOptions +from loops.config.base import GlobalOptions, LoopsOptions +from loops.config.base import QueryOptions, PredicateOptions, TypeOptions from loops.interfaces import ILoopsObject, IIndexAttributes from loops.interfaces import IDocument, IFile, ITextDocument from loops.layout.base import LayoutNode @@ -143,6 +144,7 @@ class TestSite(object): component.provideAdapter(ConceptSecuritySetter) component.provideAdapter(ResourceSecuritySetter) component.provideAdapter(LoopsOptions) + component.provideAdapter(PredicateOptions) component.provideAdapter(QueryOptions) component.provideAdapter(TypeOptions) component.provideUtility(GlobalOptions()) From 6f8c9bda6ace5315a03e62d2f5bc367c69cf817a Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 2 Nov 2011 13:38:50 +0100 Subject: [PATCH 05/10] work in progress: micro articles --- compound/README.txt | 11 +++++ compound/microart/__init__.py | 4 ++ compound/microart/base.py | 73 ++++++++++++++++++++++++++++++++ compound/microart/browser.py | 52 +++++++++++++++++++++++ compound/microart/configure.zcml | 29 +++++++++++++ compound/microart/interfaces.py | 59 ++++++++++++++++++++++++++ compound/microart/schema.py | 37 ++++++++++++++++ compound/microart/view_macros.pt | 17 ++++++++ configure.zcml | 1 + 9 files changed, 283 insertions(+) create mode 100644 compound/microart/__init__.py create mode 100644 compound/microart/base.py create mode 100755 compound/microart/browser.py create mode 100644 compound/microart/configure.zcml create mode 100644 compound/microart/interfaces.py create mode 100644 compound/microart/schema.py create mode 100755 compound/microart/view_macros.pt diff --git a/compound/README.txt b/compound/README.txt index 4d0a049..06b6e2e 100644 --- a/compound/README.txt +++ b/compound/README.txt @@ -316,6 +316,17 @@ When we clear the `private` flag the post becomes visible again. True +Micro Articles +============== + + >>> from loops.compound.microart.base import MicroArt + >>> from loops.compound.microart.interfaces import IMicroArt + >>> component.provideAdapter(BlogPost, provides=IMicroArt) + + >>> tMicroArt = addAndConfigureObject(concepts, Concept, 'microart', + ... title=u'MicroArt', conceptType=tType) + + Fin de partie ============= diff --git a/compound/microart/__init__.py b/compound/microart/__init__.py new file mode 100644 index 0000000..4bc90fb --- /dev/null +++ b/compound/microart/__init__.py @@ -0,0 +1,4 @@ +""" +$Id$ +""" + diff --git a/compound/microart/base.py b/compound/microart/base.py new file mode 100644 index 0000000..3b568be --- /dev/null +++ b/compound/microart/base.py @@ -0,0 +1,73 @@ +# +# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Micro articles (MicroArt). +""" + +from zope.cachedescriptors.property import Lazy +from zope.dublincore.interfaces import IZopeDublinCore +from zope.interface import implements +from zope.event import notify +from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent +from zope import schema +from zope.traversing.api import getName + +from loops.common import adapted +from loops.compound.base import Compound +from loops.compound.microart.interfaces import IMicroArt +from loops.resource import Resource +from loops.setup import addAndConfigureObject +from loops.type import TypeInterfaceSourceList + + +TypeInterfaceSourceList.typeInterfaces += (IMicroArt,) + + +class MicroArt(Compound): + + implements(IMicroArt) + + _adapterAttributes = Compound._adapterAttributes + ('text',) + _noexportAttributes = ('text',) + _textIndexAttributes = ('text',) + + defaultTextContentType = 'text/restructured' + textContentType = defaultTextContentType + + def getText(self): + res = self.getParts() + if len(res) > 0: + return adapted(res[0]).data + return u'' + def setText(self, value): + res = self.getParts() + if len(res) > 0: + res = adapted(res[0]) + else: + tTextDocument = self.conceptManager['textdocument'] + name = getName(self.context) + '_text' + res = addAndConfigureObject(self.resourceManager, Resource, name, + title=self.title, contentType=self.defaultTextContentType, + resourceType=tTextDocument) + #notify(ObjectCreatedEvent(res)) + self.add(res, position=0) + res = adapted(res) + res.data = value + notify(ObjectModifiedEvent(res.context)) + text = property(getText, setText) diff --git a/compound/microart/browser.py b/compound/microart/browser.py new file mode 100755 index 0000000..f35c83a --- /dev/null +++ b/compound/microart/browser.py @@ -0,0 +1,52 @@ +# +# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +View classes for micro articles (MicroArt). +""" + + +import itertools +from zope import component +from zope.app.pagetemplate import ViewPageTemplateFile +from zope.cachedescriptors.property import Lazy + +from loops.browser.concept import ConceptView, ConceptRelationView +from loops.common import adapted +from loops import util +from loops.util import _ + + +view_macros = ViewPageTemplateFile('view_macros.pt') + + +class MicroArtView(ConceptView): + + @Lazy + def macro(self): + return view_macros.macros['microart'] + + def render(self): + return self.renderText(self.data['text'], self.adapted.textContentType) + + def resources(self): + stdPred = self.loopsRoot.getConceptManager().getDefaultPredicate() + rels = self.context.getResourceRelations([stdPred]) + for r in rels: + yield self.childViewFactory(r, self.request, contextIsSecond=True) + diff --git a/compound/microart/configure.zcml b/compound/microart/configure.zcml new file mode 100644 index 0000000..36e46c9 --- /dev/null +++ b/compound/microart/configure.zcml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + diff --git a/compound/microart/interfaces.py b/compound/microart/interfaces.py new file mode 100644 index 0000000..9151803 --- /dev/null +++ b/compound/microart/interfaces.py @@ -0,0 +1,59 @@ +# +# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Micro articles (MicroArt / MikroArtikel in German). +""" + +from zope.interface import Interface, Attribute +from zope import interface, component, schema + +from loops.compound.interfaces import ICompound +from loops.util import _ + + +class IMicroArt(ICompound): + """ A short article with a few elements, for collecting + relevant information in a knowledge management environment. + """ + + # title = Ueberschrift, Thema + + story = schema.Text( # Geschichte + title=_(u'Story'), + description=_(u'The story, i.e. the main text of your ' + u'micro article. Who did what? What happend?'), + required=True) + + insight = schema.Text( # Einsicht + title=_(u'Insight'), + description=_(u'What can we learn from the story? What ' + u'has gone wrong? What was good?'), + required=True) + + consequences = schema.Text( #(Schluss-) Folgerungen + title=_(u'Consequences'), + description=_(u'What we will do next time in a similar ' + u'situation?'), + required=True) + + followUps = schema.Text( #Anschlussfragen + title=_(u'Follow-up'), + description=_(u'Question for helping to solve or avoid ' + u'similar problems in the future.'), + required=False) diff --git a/compound/microart/schema.py b/compound/microart/schema.py new file mode 100644 index 0000000..b6d6dbf --- /dev/null +++ b/compound/microart/schema.py @@ -0,0 +1,37 @@ +# +# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Specialized schema factories +""" + +from zope.component import adapts + +from cybertools.composer.schema.factory import SchemaFactory +from loops.compound.microart.interfaces import IMicroArt + + +class MicroArtSchemaFactory(SchemaFactory): + + adapts(IMicroArt) + + def __call__(self, interface, **kw): + schema = super(MicroArtSchemaFactory, self).__call__(interface, **kw) + schema.fields.text.height = 10 + return schema + diff --git a/compound/microart/view_macros.pt b/compound/microart/view_macros.pt new file mode 100755 index 0000000..ff15b1f --- /dev/null +++ b/compound/microart/view_macros.pt @@ -0,0 +1,17 @@ + + +
+ +
+ Description +
+
Here comes the text...
+ + + +
diff --git a/configure.zcml b/configure.zcml index 4400bed..a1522a5 100644 --- a/configure.zcml +++ b/configure.zcml @@ -473,6 +473,7 @@ + From 31417566726bfea5fb58fdf567ba397b413155fe Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Wed, 2 Nov 2011 17:04:50 +0100 Subject: [PATCH 06/10] add Header3 part --- browser/lobo/configure.zcml | 8 ++++++++ browser/lobo/standard.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/browser/lobo/configure.zcml b/browser/lobo/configure.zcml index 0be24a7..e24df89 100644 --- a/browser/lobo/configure.zcml +++ b/browser/lobo/configure.zcml @@ -63,6 +63,14 @@ factory="loops.browser.lobo.standard.Header2" permission="zope.View" /> + + +
diff --git a/browser/lobo/standard.py b/browser/lobo/standard.py index 15ce35f..aa3ac40 100644 --- a/browser/lobo/standard.py +++ b/browser/lobo/standard.py @@ -233,7 +233,7 @@ class Header3(BasePart): macroName = 'header' imageSize = 'large' - cssClass = ['span-6 last', 'clear'] + cssClass = ['span-6 last', 'clear', 'clear'] # resource parts From 132206e8236489a2c270a37eca8d8caf87bb8937 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Fri, 4 Nov 2011 10:23:49 +0100 Subject: [PATCH 09/10] round knowledge fit value to two decimals --- knowledge/knowledge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knowledge/knowledge.py b/knowledge/knowledge.py index 38db3fd..a623a90 100644 --- a/knowledge/knowledge.py +++ b/knowledge/knowledge.py @@ -182,7 +182,7 @@ class Task(BaseTask, KnowledgeAdapterMixin): item['other'].append(k) result.append(item) for item in result: - item['fit'] /= len(reqs) + item['fit'] = round(item['fit'] / len(reqs), 2) return sorted(result, key=lambda x: (-x['fit'], x['person'].title)) From b96a7df7aa857a2dd72ad98e66e90ae9eee034c8 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Fri, 4 Nov 2011 14:09:35 +0100 Subject: [PATCH 10/10] fix space below images --- browser/lobo/standard.pt | 6 ++---- browser/skin/lobo/lobo.css | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/browser/lobo/standard.pt b/browser/lobo/standard.pt index f7c49e9..d086bb2 100644 --- a/browser/lobo/standard.pt +++ b/browser/lobo/standard.pt @@ -112,15 +112,13 @@ - + alt cell/title" /> - + alt cell/title" /> diff --git a/browser/skin/lobo/lobo.css b/browser/skin/lobo/lobo.css index fd323c7..de8850b 100644 --- a/browser/skin/lobo/lobo.css +++ b/browser/skin/lobo/lobo.css @@ -443,7 +443,7 @@ img.notselected { /* lobo layout-specific classes */ .legend { - margin-top: 1px; + margin-top: 5px; } /* comments */