diff --git a/browser/common.py b/browser/common.py index 6fd3e15..5c51a59 100644 --- a/browser/common.py +++ b/browser/common.py @@ -843,6 +843,7 @@ class BaseView(GenericView, I18NView): def registerDojoFormAll(self): self.registerDojo() + self.registerDojoEditor() cm = self.controller.macros jsCall = ('dojo.require("dijit.form.Form"); ' 'dojo.require("dijit.form.DateTextBox"); ' diff --git a/browser/form_macros.pt b/browser/form_macros.pt index 0717f97..2f7f7ed 100644 --- a/browser/form_macros.pt +++ b/browser/form_macros.pt @@ -323,17 +323,15 @@ -

HTML

-
+
diff --git a/browser/loops.js b/browser/loops.js index 7a86dfa..4be35a5 100644 --- a/browser/loops.js +++ b/browser/loops.js @@ -211,6 +211,22 @@ function closeDialog(save) { } function closeDataWidget(save) { + form = dojo.byId('dialog_form'); + dojo.query('.dijitEditor').forEach(function(item, index) { + console.log(item); + var name = item.id; + var widget = dijit.byId(name); + value = widget.getValue(); + var ta = document.createElement('input'); + ta.type = 'hidden'; + ta.name = name; + ta.value = value; + form.appendChild(ta); + }); +} + + +function xx_closeDataWidget(save) { var widget = dijit.byId('data'); if (widget != undefined && save) { value = widget.getValue(); diff --git a/expert/field.py b/expert/field.py index ff813cb..5006d02 100644 --- a/expert/field.py +++ b/expert/field.py @@ -59,6 +59,11 @@ class TextField(Field): return text +class HtmlTextField(Field): + + format = 'text/html' + + class DecimalField(Field): format = 'decimal' diff --git a/interfaces.py b/interfaces.py index a552743..1330a6a 100644 --- a/interfaces.py +++ b/interfaces.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2012 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 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 @@ -30,6 +30,7 @@ from zope.app.file.interfaces import IImage as IBaseAsset from zope.component.interfaces import IObjectEvent from zope.size.interfaces import ISized +from cybertools.composer.schema.interfaces import FieldType from cybertools.relation.interfaces import IDyadicRelation from cybertools.tracking.interfaces import ITrackingStorage from cybertools.util.format import toStr, toUnicode @@ -37,6 +38,11 @@ from loops import util from loops.util import _ +class HtmlText(schema.Text): + + __typeInfo__ = ('html',) + + # common interfaces class ILoopsObject(Interface): diff --git a/locales/de/LC_MESSAGES/loops.mo b/locales/de/LC_MESSAGES/loops.mo index cd4873b..3b725e5 100644 Binary files a/locales/de/LC_MESSAGES/loops.mo and b/locales/de/LC_MESSAGES/loops.mo differ diff --git a/locales/de/LC_MESSAGES/loops.po b/locales/de/LC_MESSAGES/loops.po index 0904de9..4fe81fd 100644 --- a/locales/de/LC_MESSAGES/loops.po +++ b/locales/de/LC_MESSAGES/loops.po @@ -443,9 +443,15 @@ msgstr "Überschrift, sprechende Bezeichnung des Begriffs" msgid "Description" msgstr "Beschreibung" +msgid "label_description" +msgstr "Beschreibung" + msgid "A medium-length description describing the content and the purpose of the object" msgstr "Eine ausführlichere Beschreibung des Inhalts und Zwecks des Objekts" +msgid "desc_description" +msgstr "Eine ausführlichere Beschreibung des Inhalts und Zwecks des Objekts" + msgid "Related Items" msgstr "Verwandte Begriffe" diff --git a/organize/interfaces.py b/organize/interfaces.py index c53c2cd..7d33d28 100644 --- a/organize/interfaces.py +++ b/organize/interfaces.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2012 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 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 @@ -31,6 +31,7 @@ from cybertools.organize.interfaces import IAddress as IBaseAddress from cybertools.organize.interfaces import IPerson as IBasePerson from cybertools.organize.interfaces import ITask from loops.interfaces import ILoopsAdapter, IConceptSchema, IRelationAdapter +from loops.interfaces import HtmlText from loops.organize.util import getPrincipalFolder from loops import util from loops.util import _ @@ -173,26 +174,35 @@ class IEvent(ITask): class IAgendaItem(ILoopsAdapter): + description = HtmlText( + title=_(u'label_description'), + description=_(u'desc_description'), + default=u'', + missing_value=u'', + required=False) + responsible = schema.TextLine( title=_(u'label_responsible'), - description=_(u'desc_responsible.'), + description=_(u'desc_responsible'), default=u'', required=False) - discussion = schema.Text( + discussion = HtmlText( title=_(u'label_discussion'), - description=_(u'desc_discussion.'), + description=_(u'desc_discussion'), default=u'', missing_value=u'', required=False) - consequences = schema.Text( + consequences = HtmlText( title=_(u'label_consequences'), - description=_(u'desc_consequences.'), + description=_(u'desc_consequences'), default=u'', missing_value=u'', required=False) + description.height = discussion.height = consequences.height = 5 + # 'hasrole' predicate diff --git a/organize/work/report.py b/organize/work/report.py index 713b4fc..954cece 100644 --- a/organize/work/report.py +++ b/organize/work/report.py @@ -35,7 +35,7 @@ from cybertools.util.jeep import Jeep from loops.common import adapted, baseObject from loops.expert.browser.report import ReportConceptView from loops.expert.field import Field, TargetField, DateField, StateField, \ - TextField, UrlField + TextField, HtmlTextField, UrlField from loops.expert.field import SubReport, SubReportField from loops.expert.report import ReportInstance from loops import util @@ -329,7 +329,7 @@ taskTitle = UrlField('title', u'Task Title', description=u'The short description of the task.', cssClass='header-1', executionSteps=['output']) -taskDescription = TextField('description', u'Description', +taskDescription = HtmlTextField('description', u'Description', description=u'The long description of the task.', cssClass='header-2', executionSteps=['output']) @@ -337,11 +337,11 @@ responsible = TextField('responsible', u'label_responsible', description=u'Responsible.', cssClass='header-2', executionSteps=['output']) -discussion = TextField('discussion', u'label_discussion', +discussion = HtmlTextField('discussion', u'label_discussion', description=u'Discussion.', cssClass='header-2', executionSteps=['output']) -consequences = TextField('consequences', u'label_consequences', +consequences = HtmlTextField('consequences', u'label_consequences', description=u'Consequences.', cssClass='header-2', executionSteps=['output'])