[CMF-checkins] SVN: CMF/trunk/CMFDefault/browser/ viewification, part 2 (merging from tseaver-viewification branch):

Yvo Schubbe y.2006_ at wcm-solutions.de
Wed Feb 22 05:02:42 EST 2006


Log message for revision 41748:
  viewification, part 2 (merging from tseaver-viewification branch):
  - added metadata views (folder_edit_form, metadata_edit_form, full_metadata_edit_form)
  - added document views (document_view, document_edit_form)
  - added news item views (newsitem_view, newsitem_edit_form)

Changed:
  U   CMF/trunk/CMFDefault/browser/TODO.txt
  U   CMF/trunk/CMFDefault/browser/configure.zcml
  A   CMF/trunk/CMFDefault/browser/document.py
  A   CMF/trunk/CMFDefault/browser/metadata.py
  A   CMF/trunk/CMFDefault/browser/newsitem.py
  A   CMF/trunk/CMFDefault/browser/templates/document.pt
  A   CMF/trunk/CMFDefault/browser/templates/document_edit.pt
  A   CMF/trunk/CMFDefault/browser/templates/metadata_edit.pt
  A   CMF/trunk/CMFDefault/browser/templates/metadata_full_edit.pt
  A   CMF/trunk/CMFDefault/browser/templates/metadata_minimal_edit.pt
  A   CMF/trunk/CMFDefault/browser/templates/newsitem_edit.pt

-=-
Modified: CMF/trunk/CMFDefault/browser/TODO.txt
===================================================================
--- CMF/trunk/CMFDefault/browser/TODO.txt	2006-02-22 09:37:50 UTC (rev 41747)
+++ CMF/trunk/CMFDefault/browser/TODO.txt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -32,30 +32,30 @@
       folder_top_control.py -> FolderContentsView.top_control
       folder_bottom_control.py -> FolderContentsView.bottom_control
 
-  [ ] folder_edit_form:
+  [x] folder_edit_form:
 
       folder_edit_form.py -> MetadataMinimalEditView
       folder_edit_template.pt -> templates/metadata_minimal_edit.pt
       folder_edit_control.py -> MetadataMinimalEditView.edit_control
 
-  [ ] metadata_edit_form:
+  [x] metadata_edit_form:
 
       metadata_edit_form.py -> MetadataEditView
       metadata_edit_template.pt -> templates/metadata_edit.pt
       metadata_edit_control.py -> MetadataEditView.edit_control
 
-  [ ] full_metadata_edit_form:
+  [x] full_metadata_edit_form:
 
       full_metadata_edit_form.py -> MetadataEditView
       full_metadata_edit_template.pt -> templates/metadata_full_edit.pt
       metadata_edit_control.py -> MetadataEditView.edit_control
 
-  [ ] document_view:
+  [x] document_view:
 
       document_view.py -> DocumentView
       document_view_template.pt -> document.pt
 
-  [ ] document_edit_form:
+  [x] document_edit_form:
 
       document_edit_form.py -> DocumentEditView
       document_edit_template.pt -> templates/document_edit.pt
@@ -63,12 +63,12 @@
       validateTextFile.py -> DocumentEditView.validateTextFile
       document_edit_control.py -> DocumentEditView.edit_control
 
-  [ ] newsitem_view:
+  [x] newsitem_view:
 
       newsitem_view.py -> DocumentView
       document_view_template.pt -> document.pt
 
-  [ ] newsitem_edit_form:
+  [x] newsitem_edit_form:
 
       newsitem_edit_form.py -> NewsItemEditView
       newsitem_edit_template.pt -> templates/newsitem_edit.pt

Modified: CMF/trunk/CMFDefault/browser/configure.zcml
===================================================================
--- CMF/trunk/CMFDefault/browser/configure.zcml	2006-02-22 09:37:50 UTC (rev 41747)
+++ CMF/trunk/CMFDefault/browser/configure.zcml	2006-02-22 10:02:41 UTC (rev 41748)
@@ -3,7 +3,7 @@
     xmlns:browser="http://namespaces.zope.org/browser"
     xmlns:five="http://namespaces.zope.org/five">
 
-  <five:traversable class="Products.CMFCore.PortalFolder.PortalFolder"/>
+  <five:traversable class="Products.CMFCore.DynamicType.DynamicType"/>
 
   <browser:page
       for="Products.CMFCore.interfaces.IFolderish"
@@ -24,6 +24,69 @@
       />
 
   <browser:page
+      for="Products.CMFCore.interfaces.IMutableMinimalDublinCore"
+      name="folder_edit_form"
+      class=".metadata.MetadataMinimalEditView"
+      template="templates/metadata_minimal_edit.pt"
+      permission="zope2.ManageProperties"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFCore.interfaces.IMutableDublinCore"
+      name="metadata_edit_form"
+      class=".metadata.MetadataEditView"
+      template="templates/metadata_edit.pt"
+      permission="cmf.ModifyPortalContent"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFCore.interfaces.IMutableDublinCore"
+      name="full_metadata_edit_form"
+      class=".metadata.MetadataEditView"
+      template="templates/metadata_full_edit.pt"
+      permission="cmf.ModifyPortalContent"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFDefault.interfaces.IDocument"
+      name="document_view"
+      class=".document.DocumentView"
+      template="templates/document.pt"
+      permission="zope2.View"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFDefault.interfaces.IMutableDocument"
+      name="document_edit_form"
+      class=".document.DocumentEditView"
+      template="templates/document_edit.pt"
+      permission="cmf.ModifyPortalContent"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFDefault.interfaces.INewsItem"
+      name="newsitem_view"
+      class=".document.DocumentView"
+      template="templates/document.pt"
+      permission="zope2.View"
+      layer="cmf"
+      />
+
+  <browser:page
+      for="Products.CMFDefault.interfaces.IMutableNewsItem"
+      name="newsitem_edit_form"
+      class=".newsitem.NewsItemEditView"
+      template="templates/newsitem_edit.pt"
+      permission="cmf.ModifyPortalContent"
+      layer="cmf"
+      />
+
+  <browser:page
       for="*"
       name="form_widget"
       template="templates/form_widgets.pt"

Added: CMF/trunk/CMFDefault/browser/document.py
===================================================================
--- CMF/trunk/CMFDefault/browser/document.py	2006-02-22 09:37:50 UTC (rev 41747)
+++ CMF/trunk/CMFDefault/browser/document.py	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,111 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Browser views for documents.
+
+$Id$
+"""
+
+from Products.CMFDefault.exceptions import EditingConflict
+from Products.CMFDefault.exceptions import IllegalHTML
+from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import Message as _
+from Products.CMFDefault.utils import scrubHTML
+
+from utils import decode
+from utils import FormViewBase
+from utils import memoize
+from utils import ViewBase
+
+
+class DocumentView(ViewBase):
+
+    """View for IDocument.
+    """
+
+    # interface
+
+    @memoize
+    @decode
+    def text(self):
+        return self.context.CookedBody()
+
+
+class DocumentEditView(FormViewBase):
+
+    """Edit view for IMutableDocument.
+    """
+
+    _BUTTONS = ({'id': 'change',
+                 'title': _(u'Change'),
+                 'transform': ('validateTextFile', 'validateHTML',
+                               'edit_control'),
+                 'redirect': ('portal_types', 'object/edit')},
+                {'id': 'change_and_view',
+                 'title': _(u'Change and View'),
+                 'transform': ('validateTextFile', 'validateHTML',
+                               'edit_control'),
+                 'redirect': ('portal_types', 'object/view')})
+
+    #helpers
+
+    @memoize
+    def _getHiddenVars(self):
+        belt = self.request.form.get('SafetyBelt', self.context.SafetyBelt())
+        return {'SafetyBelt': belt}
+
+    # interface
+
+    @memoize
+    def text_format(self):
+        return self.request.form.get('text_format', self.context.text_format)
+
+    @memoize
+    @decode
+    def text(self):
+        return self.request.form.get('text', self.context.EditableBody())
+
+    # validators
+
+    def validateHTML(self, text, description='', **kw):
+        try:
+            self.request.form['description'] = scrubHTML(description)
+            self.request.form['text'] = scrubHTML(text)
+            return True
+        except IllegalHTML, errmsg:
+            return False, errmsg
+
+    def validateTextFile(self, file='', **kw):
+        try:
+            upload = file.read()
+        except AttributeError:
+            return True
+        else:
+            if upload:
+                self.request.form['text'] = upload
+                return True
+            else:
+                return True
+
+    # controllers
+
+    def edit_control(self, text_format, text, SafetyBelt='', **kw):
+        context = self.context
+        if text_format != context.text_format or \
+                text != context.EditableBody():
+            try:
+                context.edit(text_format, text, safety_belt=SafetyBelt)
+                return True, _(u'Document changed.')
+            except (ResourceLockedError, EditingConflict), errmsg:
+                return False, errmsg
+        else:
+            return False, _(u'Nothing to change.')


Property changes on: CMF/trunk/CMFDefault/browser/document.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: CMF/trunk/CMFDefault/browser/metadata.py
===================================================================
--- CMF/trunk/CMFDefault/browser/metadata.py	2006-02-22 09:37:50 UTC (rev 41747)
+++ CMF/trunk/CMFDefault/browser/metadata.py	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,209 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Browser views for metadata.
+
+$Id$
+"""
+
+from Acquisition import aq_self
+
+from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import Message as _
+
+from utils import decode
+from utils import FormViewBase
+from utils import memoize
+
+
+class MetadataMinimalEditView(FormViewBase):
+
+    """Edit view for IMutableMinimalDublinCore.
+    """
+
+    _BUTTONS = ({'id': 'change',
+                 'title': _(u'Change'),
+                 'transform': ('edit_control',),
+                 'redirect': ('portal_types', 'object/edit')},
+                {'id': 'change_and_view',
+                 'title': _(u'Change and View'),
+                 'transform': ('edit_control',),
+                 'redirect': ('portal_types', 'object/view')})
+
+    # interface
+
+    @memoize
+    @decode
+    def title(self):
+        return self.request.form.get('title', self.context.Title())
+
+    @memoize
+    @decode
+    def description(self):
+        return self.request.form.get('description',
+                                     self.context.Description())
+
+    # controllers
+
+    def edit_control(self, title, description, **kw):
+        context = self.context
+        if title!=context.Title() or description != context.Description():
+            context.edit(title=title, description=description)
+            return True, _(u'Metadata changed.')
+        else:
+            return False, _(u'Nothing to change.')
+
+
+class MetadataEditView(MetadataMinimalEditView):
+
+    """Edit view for IMutableDublinCore.
+    """
+
+    _BUTTONS = ({'id': 'change',
+                 'title': _(u'Change'),
+                 'transform': ('edit_control',),
+                 'redirect': ('portal_types', 'object/metadata')},
+                {'id': 'change_and_edit',
+                 'title': _(u'Change and Edit'),
+                 'transform': ('edit_control',),
+                 'redirect': ('portal_types', 'object/edit')},
+                {'id': 'change_and_view',
+                 'title': _(u'Change and View'),
+                 'transform': ('edit_control',),
+                 'redirect': ('portal_types', 'object/view')})
+
+    #helpers
+
+    def _tuplify(self, value):
+        if isinstance(value, basestring):
+            value = (value,)
+        return tuple([ i for i in value if i ])
+
+    # interface
+
+    @memoize
+    @decode
+    def allow_discussion(self):
+        context = aq_self(self.context)
+        allow_discussion = getattr(context, 'allow_discussion', None)
+        if allow_discussion is not None:
+            allow_discussion = bool(allow_discussion)
+        return allow_discussion
+
+    @memoize
+    @decode
+    def identifier(self):
+        return self.context.Identifier()
+
+    @memoize
+    @decode
+    def subject(self):
+        subjects = self.request.form.get('subject', self.context.Subject())
+        return tuple(subjects)
+
+    @memoize
+    @decode
+    def allowed_subjects(self):
+        mdtool = self._getTool('portal_metadata')
+        subjects = mdtool.listAllowedSubjects(self.context)
+        return tuple(subjects)
+
+    @memoize
+    @decode
+    def extra_subjects(self):
+        subjects = [ s for s
+                     in self.subject() if not s in self.allowed_subjects() ]
+        return tuple(subjects)
+
+    @memoize
+    @decode
+    def format(self):
+        return self.request.form.get('format', self.context.Format())
+
+    @memoize
+    @decode
+    def contributors(self):
+        return self.request.form.get('contributors',
+                                     self.context.Contributors())
+
+    @memoize
+    @decode
+    def language(self):
+        return self.request.form.get('language', self.context.Language())
+
+    @memoize
+    @decode
+    def rights(self):
+        return self.request.form.get('rights', self.context.Rights())
+
+    # controllers
+
+    def edit_control(self, allow_discussion, title=None, subject=None,
+                     description=None, contributors=None, effective_date=None,
+                     expiration_date=None, format=None, language=None,
+                     rights=None, **kw):
+        context = self.context
+        dtool = self._getTool('portal_discussion')
+
+        if title is None:
+            title = context.Title()
+
+        if subject is None:
+            subject = context.Subject()
+        else:
+            subject = self._tuplify(subject)
+
+        if description is None:
+            description = context.Description()
+
+        if contributors is None:
+            contributors = context.Contributors()
+        else:
+            contributors = self._tuplify(contributors)
+
+        if effective_date is None:
+            effective_date = context.EffectiveDate()
+
+        if expiration_date is None:
+            expiration_date = context.expires()
+
+        if format is None:
+            format = context.Format()
+
+        if language is None:
+            language = context.Language()
+
+        if rights is None:
+            rights = context.Rights()
+
+        if allow_discussion == 'default':
+            allow_discussion = None
+        elif allow_discussion == 'off':
+            allow_discussion = False
+        elif allow_discussion == 'on':
+            allow_discussion = True
+        dtool.overrideDiscussionFor(context, allow_discussion)
+
+        try:
+            context.editMetadata( title=title
+                                , description=description
+                                , subject=subject
+                                , contributors=contributors
+                                , effective_date=effective_date
+                                , expiration_date=expiration_date
+                                , format=format
+                                , language=language
+                                , rights=rights
+                                )
+            return True, _(u'Metadata changed.')
+        except ResourceLockedError, errmsg:
+            return False, errmsg


Property changes on: CMF/trunk/CMFDefault/browser/metadata.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: CMF/trunk/CMFDefault/browser/newsitem.py
===================================================================
--- CMF/trunk/CMFDefault/browser/newsitem.py	2006-02-22 09:37:50 UTC (rev 41747)
+++ CMF/trunk/CMFDefault/browser/newsitem.py	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors. All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Browser views for news items.
+
+$Id$
+"""
+
+from Products.CMFDefault.exceptions import ResourceLockedError
+from Products.CMFDefault.utils import Message as _
+
+from document import DocumentEditView
+from utils import decode
+from utils import memoize
+
+
+class NewsItemEditView(DocumentEditView):
+
+    """Edit view for INewsItem.
+    """
+
+    # interface
+
+    @memoize
+    @decode
+    def description(self):
+        return self.request.form.get('description',
+                                     self.context.Description())
+
+    # controllers
+
+    def edit_control(self, text_format, text, description='', **kw):
+        context = self.context
+        if description != context.Description() or \
+                text_format != context.text_format or \
+                text != context.EditableBody():
+            try:
+                context.edit(text=text, description=description,
+                             text_format=text_format)
+                return True, _(u'News Item changed.')
+            except ResourceLockedError, errmsg:
+                return False, errmsg
+        else:
+            return False, _(u'Nothing to change.')


Property changes on: CMF/trunk/CMFDefault/browser/newsitem.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Copied: CMF/trunk/CMFDefault/browser/templates/document.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/document_view_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_view_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/document.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,29 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<head>
+
+<metal:slot fill-slot="base">
+<tal:span tal:replace="structure context/getBaseTag" />
+</metal:slot>
+
+</head>
+<body>
+
+<metal:slot metal:fill-slot="header">
+<h1 id="DesktopTitle" tal:content="view/title">Document Title</h1>
+
+<div id="DesktopDescription" tal:content="view/description">Document
+ Description goes here.</div>
+
+<metal:macro metal:use-macro="context/content_byline/macros/byline" />
+</metal:slot>
+
+<metal:slot metal:fill-slot="body">
+<tal:span tal:replace="structure view/text">Cooked Body</tal:span>
+
+<div class="Discussion" tal:condition="context/viewThreadsAtBottom|nothing">
+ <tal:span tal:replace="structure context/viewThreadsAtBottom" />
+</div>
+</metal:slot>
+
+</body>
+</html>

Copied: CMF/trunk/CMFDefault/browser/templates/document_edit.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/document_edit.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,64 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+
+<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
+<h1 i18n:translate="">Edit: <tal:span
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+<div class="Desktop">
+
+<form action="document_edit_form" method="post" enctype="multipart/form-data"
+   tal:attributes="action view/form_action"
+><metal:macro metal:use-macro="context/@@form_widget/hidden_vars" />
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td tal:content="view/title">Title</td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td tal:content="view/description">Description</td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Format</th>
+  <td>
+   <input type="radio" name="text_format" value="structured-text" id="cb_stx"
+      tal:attributes="checked python: view.text_format()=='structured-text'" />
+   <label for="cb_stx" i18n:translate="">structured-text</label>
+   <input type="radio" name="text_format" value="plain" id="cb_plain"
+      tal:attributes="checked python: view.text_format()=='plain'" />
+   <label for="cb_plain" i18n:translate="">plain text</label>
+   <input type="radio" name="text_format" value="html" id="cb_html"
+      tal:attributes="checked python: view.text_format()=='html'" />
+   <label for="cb_html" i18n:translate="">html</label>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Upload</th>
+  <td>
+   <input type="file" name="file" size="40" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Edit</th>
+  <td>
+   <textarea name="text:text" rows="20" cols="80" wrap="soft"
+      tal:content="view/text"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td>
+   <metal:macro metal:use-macro="context/@@form_widget/buttons" />
+  </td>
+ </tr>
+</table>
+</form>
+
+</div>
+</metal:slot>
+
+</body>
+</html>

Copied: CMF/trunk/CMFDefault/browser/templates/metadata_edit.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/metadata_edit.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,91 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+
+<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
+<h1 i18n:translate="">Standard Resource Metadata: <tal:span
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+<div class="Desktop">
+
+<form action="metadata_edit_form" method="post"
+   tal:attributes="action view/form_action">
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Enable Discussion?</th>
+  <td>
+   <select name="allow_discussion" style="float: left">
+    <option value="default"
+       tal:attributes="selected python: view.allow_discussion() is None"
+       i18n:translate="">Default</option>
+    <option value="off"
+       tal:attributes="selected python: view.allow_discussion() is False"
+       i18n:translate="">Off</option>
+    <option value="on"
+       tal:attributes="selected python: view.allow_discussion() is True"
+       i18n:translate="">On</option>
+   </select>
+   <a href="full_metadata_edit_form" style="float: right"
+      tal:attributes="href string:${context/absolute_url}/full_metadata_edit_form"
+      i18n:translate=""
+     >Edit all metadata</a>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Identifier</th>
+  <td>
+   <tal:span tal:content="view/identifier" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td>
+   <input type="text" name="title" value="" size="80"
+      tal:attributes="value view/title" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td>
+   <textarea name="description:text" rows="3" cols="80" wrap="soft"
+      tal:content="view/description"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Subject</th>
+  <td tal:define="subj_lines python: '\n'.join(view.extra_subjects())">
+   <textarea name="subject:lines" rows="3" cols="31"
+      tal:content="subj_lines"></textarea>
+   <br />
+   <select name="subject:list" multiple>
+    <option value=""
+       tal:repeat="subject view/allowed_subjects"
+       tal:attributes="value subject;
+                       selected python: subject in view.subject()"
+       tal:content="subject">
+    </option>
+   </select>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Format</th>
+  <td>
+   <input type="text" name="format" value=""
+      tal:attributes="value view/format" />
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td>
+   <metal:macro metal:use-macro="context/@@form_widget/buttons" />
+  </td>
+ </tr>
+</table>
+</form>
+
+</div>
+</metal:slot>
+
+</body>
+</html>

Copied: CMF/trunk/CMFDefault/browser/templates/metadata_full_edit.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/metadata_full_edit.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,124 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+
+<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
+<h1 i18n:translate="">Resource Metadata: <tal:span
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+<div class="Desktop">
+
+<form action="metadata_edit_form" method="post"
+   tal:attributes="action view/form_action">
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Enable Discussion?</th>
+  <td colspan="3">
+   <select name="allow_discussion">
+    <option value="default"
+       tal:attributes="selected python: view.allow_discussion() is None"
+       i18n:translate="">Default</option>
+    <option value="off"
+       tal:attributes="selected python: view.allow_discussion() is False"
+       i18n:translate="">Off</option>
+    <option value="on"
+       tal:attributes="selected python: view.allow_discussion() is True"
+       i18n:translate="">On</option>
+   </select>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Identifier</th>
+  <td colspan="3">
+   <tal:span tal:content="view/identifier" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td colspan="3">
+   <input type="text" name="title" value="" size="80"
+      tal:attributes="value view/title" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td colspan="3">
+   <textarea name="description:text" rows="3" cols="80" wrap="soft"
+      tal:content="view/description"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Subject</th>
+  <td tal:define="subj_lines python: '\n'.join(view.extra_subjects())">
+   <textarea name="subject:lines" rows="3" cols="31"
+      tal:content="subj_lines"></textarea>
+   <br />
+   <select name="subject:list" multiple>
+    <option value=""
+       tal:repeat="subject view/allowed_subjects"
+       tal:attributes="value subject;
+                       selected python: subject in view.subject()"
+       tal:content="subject">
+    </option>
+   </select>
+  </td>
+  <th i18n:translate="">Contributors</th>
+  <td tal:define="contrib_lines python: '\n'.join(view.contributors())">
+   <textarea name="contributors:lines" rows="5" cols="31"
+      tal:content="contrib_lines"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Creation Date</th>
+  <td tal:content="context/CreationDate"></td>
+  <th i18n:translate="">Last Modified Date</th>
+  <td tal:content="context/ModificationDate"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Effective Date</th>
+  <td>
+   <input type="text" name="effective_date" value=""
+      tal:attributes="value context/EffectiveDate" />
+  </td>
+  <th i18n:translate="">Expiration Date</th>
+  <td>
+   <input type="text" name="expiration_date" value=""
+      tal:attributes="value context/ExpirationDate" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Format</th>
+  <td colspan="3">
+   <input type="text" name="format" value=""
+      tal:attributes="value view/format" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Language</th>
+  <td colspan="3">
+   <input type="text" name="language" value=""
+      tal:attributes="value view/language" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Rights</th>
+  <td colspan="3">
+   <input type="text" name="rights" value=""
+      tal:attributes="value view/rights" />
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td colspan="3">
+   <metal:macro metal:use-macro="context/@@form_widget/buttons" />
+  </td>
+ </tr>
+</table>
+</form>
+
+</div>
+</metal:slot>
+
+</body>
+</html>

Copied: CMF/trunk/CMFDefault/browser/templates/metadata_minimal_edit.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/folder_edit_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/metadata_minimal_edit.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,42 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+
+<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
+<h1 i18n:translate="">Edit: <tal:span
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+<div class="Desktop">
+
+<form action="folder_edit_form" method="post"
+   tal:attributes="action view/form_action">
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td>
+   <input type="text" name="title" value="" size="80"
+      tal:attributes="value view/title" />
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td>
+   <textarea name="description:text" rows="3" cols="80" wrap="soft"
+      tal:content="view/description"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td>
+   <metal:macro metal:use-macro="context/@@form_widget/buttons" />
+  </td>
+ </tr>
+</table>
+</form>
+
+</div>
+</metal:slot>
+
+</body>
+</html>

Copied: CMF/trunk/CMFDefault/browser/templates/newsitem_edit.pt (from rev 41740, CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt)
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt	2006-02-21 16:23:53 UTC (rev 41740)
+++ CMF/trunk/CMFDefault/browser/templates/newsitem_edit.pt	2006-02-22 10:02:41 UTC (rev 41748)
@@ -0,0 +1,60 @@
+<html metal:use-macro="context/@@standard_macros/page">
+<body>
+
+<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
+<h1 i18n:translate="">Edit: <tal:span
+    tal:content="view/title" i18n:name="obj_title">Title</tal:span></h1>
+</metal:slot>
+
+<metal:slot metal:fill-slot="body" i18n:domain="cmf_default">
+<div class="Desktop">
+
+<form action="newsitem_edit_form" method="post"
+   tal:attributes="action view/form_action">
+<table class="FormLayout">
+ <tr>
+  <th i18n:translate="">Title</th>
+  <td tal:content="view/title">Title</td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Format</th>
+  <td>
+   <input type="radio" name="text_format" value="structured-text" id="cb_stx"
+      tal:attributes="checked python: view.text_format()=='structured-text'" />
+   <label for="cb_stx" i18n:translate="">structured-text</label>
+   <input type="radio" name="text_format" value="plain" id="cb_plain"
+      tal:attributes="checked python: view.text_format()=='plain'" />
+   <label for="cb_plain" i18n:translate="">plain text</label>
+   <input type="radio" name="text_format" value="html" id="cb_html"
+      tal:attributes="checked python: view.text_format()=='html'" />
+   <label for="cb_html" i18n:translate="">html</label>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Lead-in</th>
+  <td>
+   <textarea name="description:text" rows="8" cols="80" wrap="soft"
+      tal:content="view/description"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Body</th>
+  <td>
+   <textarea name="text:text" rows="16" cols="80" wrap="soft"
+      tal:content="view/text"></textarea>
+  </td>
+ </tr>
+ <tr>
+  <td>&nbsp;</td>
+  <td>
+   <metal:macro metal:use-macro="context/@@form_widget/buttons" />
+  </td>
+ </tr>
+</table>
+</form>
+
+</div>
+</metal:slot>
+
+</body>
+</html>



More information about the CMF-checkins mailing list