[CMF-checkins] SVN: CMF/trunk/CMF - some form refactoring and
cleanup
Yvo Schubbe
y.2006_ at wcm-solutions.de
Fri Jan 27 06:10:45 EST 2006
Log message for revision 41467:
- some form refactoring and cleanup
- updated pot files
- removed obsolete subjectsList.py
Changed:
U CMF/trunk/CMFCalendar/locales/cmf_calendar.pot
U CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_control.py
U CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
U CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_template.pt
U CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt
U CMF/trunk/CMFDefault/locales/cmf_default.pot
U CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/file_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/image_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/link_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt
U CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py
U CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt
D CMF/trunk/CMFDefault/skins/zpt_content/subjectsList.py
-=-
Modified: CMF/trunk/CMFCalendar/locales/cmf_calendar.pot
===================================================================
--- CMF/trunk/CMFCalendar/locales/cmf_calendar.pot 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFCalendar/locales/cmf_calendar.pot 2006-01-27 11:10:43 UTC (rev 41467)
@@ -13,7 +13,7 @@
msgid ""
msgstr ""
"Project-Id-Version: CMF 2.0\n"
-"POT-Creation-Date: Thu Jan 19 12:44:25 2006\n"
+"POT-Creation-Date: Fri Jan 27 11:59:47 2006\n"
"Language-Team: CMF Developers <zope-cmf at zope.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -53,44 +53,50 @@
#: CMFCalendar/skins/zpt_calendar/calendarBox.pt:28
#: CMFCalendar/skins/zpt_calendar/calendarBox.pt:41
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:51
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:31
msgid "${DYNAMIC_CONTENT}"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_form.py:20
+#: CMFCalendar/skins/zpt_calendar/event_edit_control.py:11
+msgid "Event changed."
+msgstr ""
+
+#: CMFCalendar/skins/zpt_calendar/event_edit_form.py:49
msgid "Change"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_form.py:21
+#: CMFCalendar/skins/zpt_calendar/event_edit_form.py:50
msgid "Change and View"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:101
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:47
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:100
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:48
msgid "Stop Date"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:129
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:51
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:128
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:52
msgid "Start Time"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:142
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:161
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:139
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:155
msgid "am"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:145
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:164
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:142
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:158
msgid "pm"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:148
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:53
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:144
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:54
msgid "Stop Time"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:169
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:60
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:162
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:61
msgid "Description"
msgstr ""
@@ -123,18 +129,18 @@
msgid "Edit: ${obj_title}"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:59
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:32
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:58
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:33
msgid "Contact Phone"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:67
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:36
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:66
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:37
msgid "Event URL"
msgstr ""
-#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:75
-#: CMFCalendar/skins/zpt_calendar/event_view.pt:45
+#: CMFCalendar/skins/zpt_calendar/event_edit_template.pt:74
+#: CMFCalendar/skins/zpt_calendar/event_view.pt:46
msgid "Start Date"
msgstr ""
Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_control.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_control.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_control.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -1,12 +1,13 @@
##parameters=title=None, description=None, event_type=None, effectiveDay=None, effectiveMo=None, effectiveYear=None, expirationDay=None, expirationMo=None, expirationYear=None, start_time=None, startAMPM=None, stop_time=None, stopAMPM=None, location=None, contact_name=None, contact_email=None, contact_phone=None, event_url=None, **kw
##
from Products.CMFCalendar.exceptions import ResourceLockedError
+from Products.CMFCalendar.utils import Message as _
try:
context.edit(title, description, event_type, effectiveDay, effectiveMo,
effectiveYear, expirationDay, expirationMo, expirationYear,
start_time, startAMPM, stop_time, stopAMPM, location,
contact_name, contact_email, contact_phone, event_url)
- return context.setStatus(True, 'Event changed.')
+ return context.setStatus(True, _(u'Event changed.'))
except ResourceLockedError, errmsg:
return context.setStatus(False, errmsg)
Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -15,10 +15,39 @@
options = {}
+options['title'] = form.get('title', context.Title())
+options['description'] = form.get('description', context.Description())
+options['contact_name'] = form.get('contact_name', context.contact_name)
+options['location'] = form.get('location', context.location)
+options['contact_email'] = form.get('contact_email', context.contact_email)
+options['event_type'] = form.get('event_type', context.Subject())
+options['contact_phone'] = form.get('contact_phone', context.contact_phone)
+options['event_url'] = form.get('event_url', context.event_url)
+
+date_strings = context.getStartStrings()
+options['effectiveYear'] = form.get('effectiveYear', date_strings['year'])
+options['effectiveMo'] = form.get('effectiveMo', date_strings['month'])
+options['effectiveDay'] = form.get('effectiveDay', date_strings['day'])
+
+time_strings = context.getStartTimeString().split()
+options['start_time'] = form.get('start_time', time_strings[0])
+AMPM = (len(time_strings) == 2 and time_strings[1] or 'pm')
+options['startAMPM'] = form.get('startAMPM', AMPM)
+
+date_strings = context.getEndStrings()
+options['expirationYear'] = form.get('expirationYear', date_strings['year'])
+options['expirationMo'] = form.get('expirationMo', date_strings['month'])
+options['expirationDay'] = form.get('expirationDay', date_strings['day'])
+
+time_strings = context.getStopTimeString().split()
+options['stop_time'] = form.get('stop_time', time_strings[0])
+AMPM = (len(time_strings) == 2 and time_strings[1] or 'pm')
+options['stopAMPM'] = form.get('stopAMPM', AMPM)
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_template.pt
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_calendar">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_calendar"
@@ -18,13 +18,13 @@
<td>
<input type="text"
name="title" maxlength="100" size="35" value="Title"
- tal:attributes="value context/Title">
+ tal:attributes="value options/title" />
</td>
<th i18n:translate="">Contact Name</th>
<td>
<input type="text"
name="contact_name" maxlength="100" size="35" value="contact_name"
- tal:attributes="value context/contact_name">
+ tal:attributes="value options/contact_name" />
</td>
</tr>
<tr>
@@ -32,35 +32,34 @@
<td>
<input type="text"
name="location" maxlength="100" size="35" value="location"
- tal:attributes="value context/location">
+ tal:attributes="value options/location" />
</td>
<th i18n:translate="">Contact Email</th>
<td>
<input type="text"
name="contact_email" maxlength="100" size="35" value="contact_email"
- tal:attributes="value context/contact_email">
+ tal:attributes="value options/contact_email" />
</td>
</tr>
<tr>
<th i18n:translate="">Event type</th>
<td>
- <select name="event_type:list" multiple
- tal:define="contentSubject context/Subject;
- allowedSubjects python:context.portal_metadata.listAllowedSubjects(context)">
+ <select name="event_type:list" multiple="multiple">
<option tal:replace="nothing">Event Type 1</option>
<option tal:replace="nothing">Event Type 2</option>
<option tal:replace="nothing">...</option>
<option value="subj"
- tal:repeat="subj allowedSubjects"
- tal:attributes="value subj; selected python:subj in contentSubject"
- tal:content="subj">Event Type N</option>
+ tal:repeat="subj python: context.portal_metadata.listAllowedSubjects(context)"
+ tal:attributes="value subj;
+ selected python: subj in options['event_type']"
+ tal:content="subj" i18n:translate="">Event Type N</option>
</select>
</td>
<th i18n:translate="">Contact Phone</th>
<td>
<input type="text" name="contact_phone" maxlength="100" size="35"
value="contact_phone" id="cb_contact_phone"
- tal:attributes="value context/contact_phone" />
+ tal:attributes="value options/contact_phone" />
</td>
</tr>
<tr>
@@ -68,108 +67,102 @@
<td colspan="3">
<input type="text" name="event_url" size="55" maxlength="100"
value="event_url"
- tal:attributes="value context/event_url" />
+ tal:attributes="value options/event_url" />
</td>
</tr>
<tr>
<th i18n:translate="">Start Date</th>
- <td tal:define="startstrings context/getStartStrings">
+ <td>
<select name="effectiveYear">
<option value=""
- tal:define="years context/buildYears"
- tal:repeat="year years"
- tal:attributes="value year; selected python:year == startstrings['year']"
+ tal:repeat="year context/buildYears"
+ tal:attributes="value year;
+ selected python: year == options['effectiveYear']"
tal:content="year">Year</option>
</select>
<select name="effectiveMo">
<option value=""
- tal:define="months context/buildMonths"
- tal:repeat="month months"
- tal:attributes="value month; selected python:month == startstrings['month']"
+ tal:repeat="month context/buildMonths"
+ tal:attributes="value month;
+ selected python: month == options['effectiveMo']"
tal:content="month">Month</option>
</select>
<select name="effectiveDay">
<option value=""
- tal:define="days context/buildDays"
- tal:repeat="day days"
- tal:attributes="value day; selected python:day == startstrings['day']"
+ tal:repeat="day context/buildDays"
+ tal:attributes="value day;
+ selected python: day == options['effectiveDay']"
tal:content="day">Day</option>
</select>
</td>
<th i18n:translate="">Stop Date</th>
- <td tal:define="endstrings context/getEndStrings">
+ <td>
<select name="expirationYear">
<option value=""
- tal:define="years context/buildYears"
- tal:repeat="year years"
- tal:attributes="value year; selected python:year == endstrings['year']"
+ tal:repeat="year context/buildYears"
+ tal:attributes="value year;
+ selected python: year == options['expirationYear']"
tal:content="year">Day</option>
</select>
<select name="expirationMo">
<option value=""
- tal:define="months context/buildMonths"
- tal:repeat="month months"
- tal:attributes="value month; selected python:month == endstrings['month']"
+ tal:repeat="month context/buildMonths"
+ tal:attributes="value month;
+ selected python: month == options['expirationMo']"
tal:content="month">Month</option>
</select>
<select name="expirationDay">
<option value=""
- tal:define="days context/buildDays"
- tal:repeat="day days"
- tal:attributes="value day; selected python:day == endstrings['day']"
+ tal:repeat="day context/buildDays"
+ tal:attributes="value day;
+ selected python: day == options['expirationDay']"
tal:content="day">Day</option>
</select>
</td>
</tr>
<tr>
<th i18n:translate="">Start Time</th>
- <td tal:define="stTimeString python:context.getStartTimeString().split();
- amSel python:(len(stTimeString) == 2 and stTimeString[1] == 'am');
- pmSel python:(len(stTimeString) == 2 and stTimeString[1] == 'pm')">
+ <td>
<select name="start_time">
<option value=""
tal:repeat="bt context/buildTimes"
- tal:attributes="value bt; selected python:bt == stTimeString[0]"
+ tal:attributes="value bt; selected python: bt == options['start_time']"
tal:content="bt">start time</option>
</select>
<input type="radio" name="startAMPM" value="am" id="cb_start_am"
- tal:attributes="checked amSel" />
+ tal:attributes="checked python: options['startAMPM'] == 'am'" />
<label for="cb_start_am" i18n:translate="">am</label>
<input type="radio" name="startAMPM" value="pm" id="cb_start_pm"
- tal:attributes="checked pmSel" />
+ tal:attributes="checked python: options['startAMPM'] == 'pm'" />
<label for="cb_start_pm" i18n:translate="">pm</label>
- <input type="hidden" name="startAMPM:default" value="pm" />
</td>
<th i18n:translate="">Stop Time</th>
- <td tal:define="stTimeString python:context.getStopTimeString().split();
- amSel python:(len(stTimeString) == 2 and stTimeString[1] == 'am');
- pmSel python:(len(stTimeString) == 2 and stTimeString[1] == 'pm')">
+ <td>
<select name="stop_time">
<option value=""
tal:repeat="bt context/buildTimes"
- tal:attributes="value bt; selected python:bt == stTimeString[0]"
+ tal:attributes="value bt; selected python: bt == options['stop_time']"
tal:content="bt">end time</option>
</select>
<input type="radio" name="stopAMPM" value="am" id="cb_stop_am"
- tal:attributes="checked amSel" />
+ tal:attributes="checked python: options['stopAMPM'] == 'am'" />
<label for="cb_stop_am" i18n:translate="">am</label>
<input type="radio" name="stopAMPM" value="pm" id="cb_stop_pm"
- tal:attributes="checked pmSel" />
+ tal:attributes="checked python: options['stopAMPM'] == 'pm'" />
<label for="cb_stop_pm" i18n:translate="">pm</label>
- <input type="hidden" name="stopAMPM:default" value="pm" />
</td>
</tr>
<tr>
<th i18n:translate="">Description</th>
<td class="TextField" colspan="3">
<textarea name="description:text" rows="5" cols="70" wrap="soft"
- tal:content="context/Description"></textarea>
+ tal:content="options/description"></textarea>
</td>
</tr>
<tr>
Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -27,8 +27,9 @@
</tr>
<tr>
<th width="10%" i18n:translate="">Event type</th>
- <td valign="top" nowrap="nowrap"
- tal:content="python:' '.join( context.Subject() )"></td>
+ <td valign="top" nowrap="nowrap"><tal:loop
+ tal:repeat="event_type context/Subject"><tal:span
+ tal:content="event_type" i18n:translate="" /> </tal:loop></td>
<th width="10%" i18n:translate="">Contact Phone</th>
<td nowrap="nowrap" tal:content="context/contact_phone">contact_phone</td>
</tr>
Modified: CMF/trunk/CMFDefault/locales/cmf_default.pot
===================================================================
--- CMF/trunk/CMFDefault/locales/cmf_default.pot 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/locales/cmf_default.pot 2006-01-27 11:10:43 UTC (rev 41467)
@@ -13,7 +13,7 @@
msgid ""
msgstr ""
"Project-Id-Version: CMF 2.0\n"
-"POT-Creation-Date: Thu Jan 19 12:44:21 2006\n"
+"POT-Creation-Date: Fri Jan 27 11:59:42 2006\n"
"Language-Team: CMF Developers <zope-cmf at zope.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -409,38 +409,38 @@
msgid "Nothing to change."
msgstr ""
-#: CMFDefault/skins/zpt_content/document_edit_form.py:24
-#: CMFDefault/skins/zpt_content/file_edit_form.py:20
+#: CMFDefault/skins/zpt_content/document_edit_form.py:30
+#: CMFDefault/skins/zpt_content/file_edit_form.py:24
#: CMFDefault/skins/zpt_content/folder_edit_form.py:20
-#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:27
-#: CMFDefault/skins/zpt_content/image_edit_form.py:20
-#: CMFDefault/skins/zpt_content/link_edit_form.py:20
-#: CMFDefault/skins/zpt_content/metadata_edit_form.py:27
-#: CMFDefault/skins/zpt_content/newsitem_edit_form.py:22
+#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:45
+#: CMFDefault/skins/zpt_content/image_edit_form.py:24
+#: CMFDefault/skins/zpt_content/link_edit_form.py:23
+#: CMFDefault/skins/zpt_content/metadata_edit_form.py:45
+#: CMFDefault/skins/zpt_content/newsitem_edit_form.py:27
#: CMFDefault/skins/zpt_generic/reconfig_form.py:21
#: CMFDefault/skins/zpt_generic/password_form.pt:44
#: CMFDefault/skins/zpt_generic/personalize_form.pt:92
msgid "Change"
msgstr ""
-#: CMFDefault/skins/zpt_content/document_edit_form.py:25
-#: CMFDefault/skins/zpt_content/file_edit_form.py:21
+#: CMFDefault/skins/zpt_content/document_edit_form.py:31
+#: CMFDefault/skins/zpt_content/file_edit_form.py:25
#: CMFDefault/skins/zpt_content/folder_edit_form.py:21
-#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:29
-#: CMFDefault/skins/zpt_content/image_edit_form.py:21
-#: CMFDefault/skins/zpt_content/link_edit_form.py:21
-#: CMFDefault/skins/zpt_content/metadata_edit_form.py:29
-#: CMFDefault/skins/zpt_content/newsitem_edit_form.py:23
+#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:47
+#: CMFDefault/skins/zpt_content/image_edit_form.py:25
+#: CMFDefault/skins/zpt_content/link_edit_form.py:24
+#: CMFDefault/skins/zpt_content/metadata_edit_form.py:47
+#: CMFDefault/skins/zpt_content/newsitem_edit_form.py:28
msgid "Change and View"
msgstr ""
#: CMFDefault/skins/zpt_content/document_edit_template.pt:19
#: CMFDefault/skins/zpt_content/file_edit_template.pt:17
#: CMFDefault/skins/zpt_content/folder_edit_template.pt:17
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:38
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:39
#: CMFDefault/skins/zpt_content/image_edit_template.pt:17
#: CMFDefault/skins/zpt_content/link_edit_template.pt:17
-#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:44
+#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:45
#: CMFDefault/skins/zpt_content/newsitem_edit_template.pt:17
#: CMFDefault/skins/zpt_generic/metadata_help.pt:15
#: CMFDefault/skins/zpt_generic/review.pt:28
@@ -452,17 +452,17 @@
#: CMFDefault/skins/zpt_content/document_edit_template.pt:23
#: CMFDefault/skins/zpt_content/file_edit_template.pt:21
#: CMFDefault/skins/zpt_content/folder_edit_template.pt:27
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:48
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:49
#: CMFDefault/skins/zpt_content/image_edit_template.pt:21
-#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:54
+#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:55
#: CMFDefault/skins/zpt_generic/metadata_help.pt:56
#: CMFDefault/skins/zpt_generic/search_form.pt:73
msgid "Description"
msgstr ""
#: CMFDefault/skins/zpt_content/document_edit_template.pt:27
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:100
-#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:79
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:97
+#: CMFDefault/skins/zpt_content/metadata_edit_template.pt:76
#: CMFDefault/skins/zpt_content/newsitem_edit_template.pt:21
#: CMFDefault/skins/zpt_generic/metadata_help.pt:128
msgid "Format"
@@ -543,17 +543,17 @@
msgid "Folder changed."
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:28
-#: CMFDefault/skins/zpt_content/metadata_edit_form.py:28
+#: CMFDefault/skins/zpt_content/full_metadata_edit_form.py:46
+#: CMFDefault/skins/zpt_content/metadata_edit_form.py:46
msgid "Change and Edit"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:106
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:104
#: CMFDefault/skins/zpt_generic/metadata_help.pt:153
msgid "Language"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:112
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:110
#: CMFDefault/skins/zpt_generic/metadata_help.pt:203
msgid "Rights"
msgstr ""
@@ -595,23 +595,23 @@
msgid "Subject"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:73
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:70
msgid "Contributors"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:80
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:77
msgid "Creation Date"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:83
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:80
msgid "Last Modified Date"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:88
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:85
msgid "Effective Date"
msgstr ""
-#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:93
+#: CMFDefault/skins/zpt_content/full_metadata_edit_template.pt:90
msgid "Expiration Date"
msgstr ""
Modified: CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/document_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -19,10 +19,16 @@
options = {}
+options['SafetyBelt'] = form.get('SafetyBelt', context.SafetyBelt())
+options['title'] = context.Title()
+options['description'] = context.Description()
+options['text_format'] = form.get('text_format', context.text_format)
+options['text'] = form.get('text', context.EditableBody())
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/document_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -13,28 +13,28 @@
<form action="document_edit_form" method="post" enctype="multipart/form-data"
tal:attributes="action form/action">
<input type="hidden" name="SafetyBelt" value=""
- tal:attributes="value context/SafetyBelt" />
+ tal:attributes="value options/SafetyBelt" />
<table class="FormLayout">
<tr>
<th i18n:translate="">Title</th>
- <td tal:content="context/Title">Title</td>
+ <td tal:content="options/title">Title</td>
</tr>
<tr>
<th i18n:translate="">Description</th>
- <td tal:content="context/Description">Description</td>
+ <td tal:content="options/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:path('context/text_format')=='structured-text'" />
+ checked python:path('options/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:path('context/text_format')=='plain'" />
+ tal:attributes="checked python:path('options/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:path('context/text_format')=='html'" />
+ tal:attributes="checked python:path('options/text_format')=='html'" />
<label for="cb_html" i18n:translate="">html</label>
</td>
</tr>
@@ -48,7 +48,7 @@
<th class="TextField" i18n:translate="">Edit</th>
<td class="TextField">
<textarea name="text:text" rows="20" cols="80" wrap="soft"
- tal:content="context/EditableBody"></textarea>
+ tal:content="options/text"></textarea>
</td>
</tr>
<tr>
Modified: CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/file_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -15,10 +15,14 @@
options = {}
+options['title'] = context.Title()
+options['description'] = context.Description()
+options['format'] = context.Format()
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/file_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/file_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/file_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -15,15 +15,15 @@
<table class="FormLayout">
<tr>
<th i18n:translate="">Title</th>
- <td tal:content="context/Title">Title</td>
+ <td tal:content="options/title">Title</td>
</tr>
<tr>
<th i18n:translate="">Description</th>
- <td tal:content="context/Description">Description</td>
+ <td tal:content="options/description">Description</td>
</tr>
<tr>
<th i18n:translate="">Content type</th>
- <td tal:content="context/Format">text/html</td>
+ <td tal:content="options/format">text/html</td>
</tr>
<tr>
<th i18n:translate="">Upload file</th>
Modified: CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -1,7 +1,11 @@
##parameters=change='', change_and_edit='', change_and_view=''
##
+from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import Message as _
+mdtool = getToolByName(script, 'portal_metadata')
+
+
form = context.REQUEST.form
if change and \
context.metadata_edit_control(**form) and \
@@ -19,16 +23,30 @@
options = {}
-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['allow_discussion'] = allow_discussion
+
+options['identifier'] = context.Identifier()
+options['title'] = form.get('title', context.Title())
+options['description'] = form.get('description', context.Description())
+
+subject = form.get('subject', context.Subject())
+allowed_subjects = mdtool.listAllowedSubjects(context)
+extra_subjects = [ s for s in subject if not s in allowed_subjects ]
+options['allowed_subjects'] = tuple(allowed_subjects)
+options['extra_subjects'] = tuple(extra_subjects)
+options['subject'] = tuple(subject)
+options['format'] = form.get('format', context.Format())
+
+buttons = []
+target = context.getActionInfo('object/metadata')['url']
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_edit', 'value': _(u'Change and Edit')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
+
options['form'] = { 'action': target,
- 'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
return context.full_metadata_edit_template(**options)
Modified: CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/full_metadata_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Resource Metadata: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -18,20 +18,21 @@
<td colspan="3">
<select name="allow_discussion">
<option value="default"
- tal:attributes="selected python: form['allow_discussion'] is None"
+ tal:attributes="selected python: options['allow_discussion'] is None"
i18n:translate="">Default</option>
<option value="off"
- tal:attributes="selected python: form['allow_discussion'] is False"
+ tal:attributes="selected python: options['allow_discussion'] is False"
i18n:translate="">Off</option>
<option value="on"
- tal:attributes="selected python: form['allow_discussion'] is True"
+ tal:attributes="selected python: options['allow_discussion'] is True"
i18n:translate="">On</option>
</select>
</td>
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Identifier</th>
- <td colspan="3"> <span tal:replace="context/Identifier"></span>
+ <td colspan="3">
+ <tal:span tal:content="options/identifier" />
</td>
</tr>
<tr valign="top">
@@ -41,32 +42,28 @@
name="title"
value=""
size="65"
- tal:attributes="value context/Title" />
+ tal:attributes="value options/title" />
</td>
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Description</th>
<td colspan="3">
- <textarea name="description:text" rows="5"
- cols="65" wrap="soft"
- tal:content="context/Description"></textarea>
+ <textarea name="description:text" rows="5" cols="65" wrap="soft"
+ tal:content="options/description"></textarea>
</td>
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Subject</th>
- <td tal:define="subj_lines python: '\n'.join( context.subjectsList() )">
+ <td tal:define="subj_lines python: '\n'.join(options['extra_subjects'])">
<textarea name="subject:lines" rows="3" cols="20"
tal:content="subj_lines"></textarea>
<br />
<select name="subject:list" multiple>
<option value=""
- tal:define="
- mtool context/portal_metadata;
- items python: mtool.listAllowedSubjects(context);
- subjects context/Subject"
- tal:repeat="item items"
- tal:attributes="value item; selected python: item in subjects"
- tal:content="item">
+ tal:repeat="subject options/allowed_subjects"
+ tal:attributes="value subject;
+ selected python: subject in options['subject']"
+ tal:content="subject">
</option>
</select>
</td>
@@ -98,8 +95,9 @@
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Format</th>
- <td> <input type="text" name="format" value=""
- tal:attributes="value context/Format" />
+ <td>
+ <input type="text" name="format" value=""
+ tal:attributes="value options/format" />
</td>
</tr>
<tr valign="top">
Modified: CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/image_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -15,10 +15,14 @@
options = {}
+options['title'] = context.Title()
+options['description'] = context.Description()
+options['format'] = context.Format()
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/image_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/image_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/image_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -15,15 +15,15 @@
<table class="FormLayout">
<tr>
<th i18n:translate="">Title</th>
- <td tal:content="context/Title">Title</td>
+ <td tal:content="options/title">Title</td>
</tr>
<tr>
<th i18n:translate="">Description</th>
- <td tal:content="context/Description">Description</td>
+ <td tal:content="options/description">Description</td>
</tr>
<tr>
<th i18n:translate="">Content type</th>
- <td tal:content="context/Format">text/html</td>
+ <td tal:content="options/format">text/html</td>
</tr>
<tr>
<th i18n:translate="">Upload image</th>
Modified: CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/link_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -15,10 +15,13 @@
options = {}
+options['title'] = context.Title()
+options['remote_url'] = form.get('remote_url', context.remote_url)
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/link_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/link_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/link_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -15,13 +15,13 @@
<table class="FormLayout">
<tr>
<th i18n:translate="">Title</th>
- <td tal:content="context/Title">Title</td>
+ <td tal:content="options/title">Title</td>
</tr>
<tr>
<th i18n:translate="">URL</th>
<td>
<input type="text" name="remote_url" value=""
- tal:attributes="value context/remote_url" />
+ tal:attributes="value options/remote_url" />
</td>
</tr>
<tr>
Modified: CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -1,7 +1,11 @@
##parameters=change='', change_and_edit='', change_and_view=''
##
+from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import Message as _
+mdtool = getToolByName(script, 'portal_metadata')
+
+
form = context.REQUEST.form
if change and \
context.metadata_edit_control(**form) and \
@@ -19,16 +23,30 @@
options = {}
-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['allow_discussion'] = allow_discussion
+
+options['identifier'] = context.Identifier()
+options['title'] = form.get('title', context.Title())
+options['description'] = form.get('description', context.Description())
+
+subject = form.get('subject', context.Subject())
+allowed_subjects = mdtool.listAllowedSubjects(context)
+extra_subjects = [ s for s in subject if not s in allowed_subjects ]
+options['allowed_subjects'] = tuple(allowed_subjects)
+options['extra_subjects'] = tuple(extra_subjects)
+options['subject'] = tuple(subject)
+options['format'] = form.get('format', context.Format())
+
+buttons = []
+target = context.getActionInfo('object/metadata')['url']
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_edit', 'value': _(u'Change and Edit')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
+
options['form'] = { 'action': target,
- 'allow_discussion': allow_discussion,
'listButtonInfos': tuple(buttons) }
return context.metadata_edit_template(**options)
Modified: CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/metadata_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Standard Resource Metadata: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -18,13 +18,13 @@
<td>
<select name="allow_discussion">
<option value="default"
- tal:attributes="selected python: form['allow_discussion'] is None"
+ tal:attributes="selected python: options['allow_discussion'] is None"
i18n:translate="">Default</option>
<option value="off"
- tal:attributes="selected python: form['allow_discussion'] is False"
+ tal:attributes="selected python: options['allow_discussion'] is False"
i18n:translate="">Off</option>
<option value="on"
- tal:attributes="selected python: form['allow_discussion'] is True"
+ tal:attributes="selected python: options['allow_discussion'] is True"
i18n:translate="">On</option>
</select>
</td>
@@ -37,7 +37,8 @@
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Identifier</th>
- <td colspan="3"> <span tal:replace="context/Identifier"></span>
+ <td colspan="3">
+ <tal:span tal:content="options/identifier" />
</td>
</tr>
<tr valign="top">
@@ -47,39 +48,35 @@
name="title"
value=""
size="65"
- tal:attributes="value context/Title" />
+ tal:attributes="value options/title" />
</td>
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Description</th>
<td colspan="3">
- <textarea name="description:text" rows="5"
- cols="65" wrap="soft"
- tal:content="context/Description"></textarea>
+ <textarea name="description:text" rows="5" cols="65" wrap="soft"
+ tal:content="options/description"></textarea>
</td>
</tr>
<tr valign="top">
<th align="right" i18n:translate="">Subject</th>
- <td tal:define="subj_lines python: '\n'.join( context.subjectsList() )">
+ <td tal:define="subj_lines python: '\n'.join(options['extra_subjects'])">
<textarea name="subject:lines" rows="3" cols="20"
tal:content="subj_lines"></textarea>
<br />
<select name="subject:list" multiple>
<option value=""
- tal:define="
- mtool context/portal_metadata;
- items python: mtool.listAllowedSubjects(context);
- subjects context/Subject"
- tal:repeat="item items"
- tal:attributes="value item; selected python: item in subjects"
- tal:content="item">
+ tal:repeat="subject options/allowed_subjects"
+ tal:attributes="value subject;
+ selected python: subject in options['subject']"
+ tal:content="subject">
</option>
</select>
</td>
<th align="right" i18n:translate="">Format</th>
<td>
<input type="text" name="format" value=""
- tal:attributes="value context/Format" />
+ tal:attributes="value options/format" />
</td>
</tr>
<tr>
Modified: CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_form.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -17,10 +17,15 @@
options = {}
+options['title'] = context.Title()
+options['description'] = form.get('description', context.Description())
+options['text_format'] = form.get('text_format', context.text_format)
+options['text'] = form.get('text', context.EditableBody())
+
buttons = []
target = context.getActionInfo('object/edit')['url']
-buttons.append( {'name': 'change', 'value': _('Change')} )
-buttons.append( {'name': 'change_and_view', 'value': _('Change and View')} )
+buttons.append( {'name': 'change', 'value': _(u'Change')} )
+buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
options['form'] = { 'action': target,
'listButtonInfos': tuple(buttons) }
Modified: CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/newsitem_edit_template.pt 2006-01-27 11:10:43 UTC (rev 41467)
@@ -3,7 +3,7 @@
<metal:slot metal:fill-slot="header" i18n:domain="cmf_default">
<h1 i18n:translate="">Edit: <tal:span
- tal:content="context/Title" i18n:name="obj_title">Title</tal:span></h1>
+ tal:content="options/title" i18n:name="obj_title">Title</tal:span></h1>
</metal:slot>
<metal:slot metal:fill-slot="main" i18n:domain="cmf_default"
@@ -15,35 +15,35 @@
<table class="FormLayout">
<tr>
<th i18n:translate="">Title</th>
- <td tal:content="context/Title">Title</td>
+ <td tal:content="options/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:path('context/text_format')=='structured-text'" />
+ checked python:path('options/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:path('context/text_format')=='plain'" />
+ tal:attributes="checked python:path('options/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:path('context/text_format')=='html'" />
+ tal:attributes="checked python:path('options/text_format')=='html'" />
<label for="cb_html" i18n:translate="">html</label>
</td>
</tr>
<tr>
<th class="TextField" i18n:translate="">Lead-in</th>
<td class="TextField">
- <textarea name="description:text" rows="10" wrap="soft"
- cols="65" tal:content="context/Description"></textarea>
+ <textarea name="description:text" rows="10" cols="65" wrap="soft"
+ tal:content="options/description"></textarea>
</td>
</tr>
<tr>
<th class="TextField" i18n:translate="">Body</th>
<td class="TextField">
<textarea name="text:text" rows="20" cols="65" wrap="soft"
- tal:content="context/EditableBody"></textarea>
+ tal:content="options/text"></textarea>
</td>
</tr>
<tr>
Deleted: CMF/trunk/CMFDefault/skins/zpt_content/subjectsList.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_content/subjectsList.py 2006-01-27 08:23:36 UTC (rev 41466)
+++ CMF/trunk/CMFDefault/skins/zpt_content/subjectsList.py 2006-01-27 11:10:43 UTC (rev 41467)
@@ -1,8 +0,0 @@
-## Script (Python) "subjectsList"
-##title=List Subjects for Metadata Editing
-allowedSubjects=container.portal_metadata.listAllowedSubjects(context)
-item=[]
-for i in context.Subject():
- if not i in allowedSubjects:
- item.append(i)
-return item
More information about the CMF-checkins
mailing list