[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_content -
full_metadata_edit_form.py:1.1.6.1
full_metadata_edit_template.pt:1.1.6.1
metadata_edit_control.py:1.1.6.1 metadata_edit_form.py:1.1.6.1
metadata_edit_template.pt:1.1.6.1
Yvo Schubbe
y.2004_ at wcm-solutions.de
Tue Oct 12 04:15:59 EDT 2004
Update of /cvs-repository/Products/CMFDefault/skins/zpt_content
In directory cvs.zope.org:/tmp/cvs-serv21447/CMFDefault/skins/zpt_content
Modified Files:
Tag: CMF-1_5-branch
full_metadata_edit_form.py full_metadata_edit_template.pt
metadata_edit_control.py metadata_edit_form.py
metadata_edit_template.pt
Log Message:
- fixed setting "Enable Discussion?" to 'Off'
=== Products/CMFDefault/skins/zpt_content/full_metadata_edit_form.py 1.1 => 1.1.6.1 ===
--- Products/CMFDefault/skins/zpt_content/full_metadata_edit_form.py:1.1 Tue Jul 6 12:13:11 2004
+++ Products/CMFDefault/skins/zpt_content/full_metadata_edit_form.py Tue Oct 12 04:15:28 2004
@@ -19,10 +19,14 @@
buttons = []
target = context.getActionInfo('object/metadata')['url']
+allow_discussion = getattr(context, 'allow_discussion', None)
+if allow_discussion is not None:
+ allow_discussion = bool(allow_discussion)
buttons.append( {'name': 'change', 'value': 'Change'} )
buttons.append( {'name': 'change_and_edit', 'value': 'Change and Edit'} )
buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
options['form'] = { 'action': target,
+ 'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
return context.full_metadata_edit_template(**options)
=== Products/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt 1.1 => 1.1.6.1 ===
--- Products/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:1.1 Tue Jul 6 12:13:11 2004
+++ Products/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt Tue Oct 12 04:15:28 2004
@@ -16,18 +16,17 @@
<tr>
<th i18n:translate="">Enable Discussion?</th>
<td colspan="3">
- <select name="allowDiscussion"
- tal:define="val context/isDiscussable">
- <option value="None"
- tal:attributes="selected python: val == None"
- i18n:translate="">Default</option>
- <option value="0"
- tal:attributes="selected python: val == 0"
- i18n:translate="">Off</option>
- <option value="1"
- tal:attributes="selected python: val == 1"
- i18n:translate="">On</option>
- </select>
+ <select name="allow_discussion">
+ <option value="default"
+ tal:attributes="selected python: form['allow_discussion'] is None"
+ i18n:translate="">Default</option>
+ <option value="off"
+ tal:attributes="selected python: form['allow_discussion'] is False"
+ i18n:translate="">Off</option>
+ <option value="on"
+ tal:attributes="selected python: form['allow_discussion'] is True"
+ i18n:translate="">On</option>
+ </select>
</td>
</tr>
<tr valign="top">
@@ -55,8 +54,7 @@
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Subject</th>
- <td tal:define="subj_lines python: modules['string'].join(
- context.subjectsList(), '\n' )">
+ <td tal:define="subj_lines python: '\n'.join( context.subjectsList() )">
<textarea name="subject:lines" rows="3" cols="20"
tal:content="subj_lines"></textarea>
<br />
=== Products/CMFDefault/skins/zpt_content/metadata_edit_control.py 1.1 => 1.1.6.1 ===
--- Products/CMFDefault/skins/zpt_content/metadata_edit_control.py:1.1 Tue Jul 6 12:13:11 2004
+++ Products/CMFDefault/skins/zpt_content/metadata_edit_control.py Tue Oct 12 04:15:28 2004
@@ -1,4 +1,4 @@
-##parameters=allowDiscussion=None, title=None, subject=None, description=None, contributors=None, effective_date=None, expiration_date=None, format=None, language=None, rights=None, **kw
+##parameters=allow_discussion, title=None, subject=None, description=None, contributors=None, effective_date=None, expiration_date=None, format=None, language=None, rights=None, **kw
##
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.exceptions import ResourceLockedError
@@ -44,7 +44,13 @@
if rights is None:
rights = context.Rights()
-dtool.overrideDiscussionFor(context, allowDiscussion)
+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
=== Products/CMFDefault/skins/zpt_content/metadata_edit_form.py 1.1 => 1.1.6.1 ===
--- Products/CMFDefault/skins/zpt_content/metadata_edit_form.py:1.1 Tue Jul 6 12:13:11 2004
+++ Products/CMFDefault/skins/zpt_content/metadata_edit_form.py Tue Oct 12 04:15:28 2004
@@ -19,10 +19,14 @@
buttons = []
target = context.getActionInfo('object/metadata')['url']
+allow_discussion = getattr(context, 'allow_discussion', None)
+if allow_discussion is not None:
+ allow_discussion = bool(allow_discussion)
buttons.append( {'name': 'change', 'value': 'Change'} )
buttons.append( {'name': 'change_and_edit', 'value': 'Change and Edit'} )
buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
options['form'] = { 'action': target,
+ 'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
return context.metadata_edit_template(**options)
=== Products/CMFDefault/skins/zpt_content/metadata_edit_template.pt 1.1 => 1.1.6.1 ===
--- Products/CMFDefault/skins/zpt_content/metadata_edit_template.pt:1.1 Tue Jul 6 12:13:11 2004
+++ Products/CMFDefault/skins/zpt_content/metadata_edit_template.pt Tue Oct 12 04:15:28 2004
@@ -16,18 +16,17 @@
<tr>
<th i18n:translate="">Enable Discussion?</th>
<td>
- <select name="allowDiscussion"
- tal:define="val context/isDiscussable">
- <option value="None"
- tal:attributes="selected python: val == None"
- i18n:translate="">Default</option>
- <option value="0"
- tal:attributes="selected python: val == 0"
- i18n:translate="">Off</option>
- <option value="1"
- tal:attributes="selected python: val == 1"
- i18n:translate="">On</option>
- </select>
+ <select name="allow_discussion">
+ <option value="default"
+ tal:attributes="selected python: form['allow_discussion'] is None"
+ i18n:translate="">Default</option>
+ <option value="off"
+ tal:attributes="selected python: form['allow_discussion'] is False"
+ i18n:translate="">Off</option>
+ <option value="on"
+ tal:attributes="selected python: form['allow_discussion'] is True"
+ i18n:translate="">On</option>
+ </select>
</td>
<td colspan="2" align="right">
<a href="full_metadata_edit_form"
@@ -61,8 +60,7 @@
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Subject</th>
- <td tal:define="subj_lines python: modules['string'].join(
- context.subjectsList(), '\n' )">
+ <td tal:define="subj_lines python: '\n'.join( context.subjectsList() )">
<textarea name="subject:lines" rows="3" cols="20"
tal:content="subj_lines"></textarea>
<br />
More information about the CMF-checkins
mailing list