[CMF-checkins] SVN: CMF/trunk/CMFCalendar/skins/zpt_calendar/ - made sure encoded strings are converted to unicode

Yvo Schubbe y.2006_ at wcm-solutions.de
Sun Feb 5 16:32:08 EST 2006


Log message for revision 41568:
  - made sure encoded strings are converted to unicode
  - some related refactoring and cleanup

Changed:
  D   CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt
  A   CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.py
  A   CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view_template.pt
  UU  CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
  D   CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt
  A   CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.py
  A   CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view_template.pt

-=-
Deleted: CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt	2006-02-05 21:30:52 UTC (rev 41567)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt	2006-02-05 21:32:07 UTC (rev 41568)
@@ -1,49 +0,0 @@
-<html metal:use-macro="context/main_template/macros/master">
-<body>
-
-<metal:slot metal:fill-slot="header">&nbsp;</metal:slot>
-
-<metal:slot metal:fill-slot="main">
- <div metal:define-macro="dayViewBox"
-      class="dayViewBox"
-      tal:define="thisDay python:DateTime(request.get('date', DateTime().aCommon()[:12]))">
-
-  <table class="dayView" cellpadding="0" cellspacing="0" border="0">
-
-   <tr>
-     <th>
-       <a href="#" tal:attributes="href python:context.getPreviousDayLink(template.absolute_url(), thisDay)">&laquo;</a>
-     </th>
-     <th tal:content="python:thisDay.aCommon()[:12]" colspan="3" nowrap>Date Heading</th>
-     <th>
-       <a href="#" tal:attributes="href python:context.getNextDayLink(template.absolute_url(), thisDay)">&raquo;</a>
-     </th>
-   </tr>
-
-   <tal:events tal:repeat="event python:context.portal_calendar.getEventsForThisDay(thisDay)">
-     <tr>
-       <td class="heading" colspan="5" nowrap>
-         <a href="#" tal:attributes="href event/getURL" tal:content="event/Title">
-           event title
-         </a>
-       </td>
-     </tr>
-
-     <tr>
-       <td class="startDate" tal:content="python:context.getStartAsString(thisDay, event)" nowrap colspan="2">
-        Event Start
-       </td>
-       <td nowrap>
-        --
-       </td>
-       <td class="endDate" tal:content="python:context.getEndAsString(thisDay, event)" nowrap colspan="2">
-        Event End
-       </td>
-     </tr>
-   </tal:events>
-
- </div>
-</metal:slot>
-
-</body>
-</html>

Added: CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.py	2006-02-05 21:30:52 UTC (rev 41567)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.py	2006-02-05 21:32:07 UTC (rev 41568)
@@ -0,0 +1,23 @@
+##parameters=
+##
+from Products.CMFCore.utils import getToolByName
+from Products.CMFDefault.utils import decode
+
+caltool = getToolByName(script, 'portal_calendar')
+
+options = {}
+base_url = script.absolute_url()
+thisDay = DateTime(context.REQUEST.get('date', DateTime().aCommon()[:12]))
+options['previous_url'] = '%s?date=%s' % (base_url, (thisDay-1).Date())
+options['date'] = thisDay.aCommon()[:12]
+options['next_url'] =  '%s?date=%s' % (base_url, (thisDay+1).Date())
+
+items = [ {'title': item.Title,
+           'url': item.getURL(),
+           'start': context.getStartAsString(thisDay, item),
+           'stop': context.getEndAsString(thisDay, item)}
+          for item in caltool.getEventsForThisDay(thisDay) ]
+
+options['listItemInfos'] = tuple(items)
+
+return context.calendar_day_view_template(**decode(options, script))


Property changes on: CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.py
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view_template.pt (from rev 41533, CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt)
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view.pt	2006-02-01 15:10:13 UTC (rev 41533)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view_template.pt	2006-02-05 21:32:07 UTC (rev 41568)
@@ -0,0 +1,38 @@
+<html metal:use-macro="context/main_template/macros/master">
+<body>
+
+<metal:slot metal:fill-slot="header">&nbsp;</metal:slot>
+
+<metal:slot metal:fill-slot="main">
+<div class="dayViewBox" metal:define-macro="dayViewBox">
+<table class="dayView" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+  <th>
+   <a href="#" tal:attributes="href options/previous_url">&laquo;</a>
+  </th>
+  <th colspan="3" nowrap="nowrap" tal:content="options/date">Date Heading</th>
+  <th>
+   <a href="#" tal:attributes="href options/next_url">&raquo;</a>
+  </th>
+ </tr>
+ <tal:loop tal:repeat="item_info options/listItemInfos">
+ <tr>
+  <td class="heading" colspan="5" nowrap="nowrap">
+   <a href="#" tal:attributes="href item_info/url"
+      tal:content="item_info/title">event title</a>
+  </td>
+ </tr>
+ <tr>
+  <td class="startDate" colspan="2" nowrap="nowrap"
+     tal:content="item_info/start">Event Start</td>
+  <td nowrap="nowrap"> -- </td>
+  <td class="endDate" colspan="2" nowrap="nowrap"
+     tal:content="item_info/stop">Event End</td>
+ </tr>
+</tal:loop>
+</table>
+</div>
+</metal:slot>
+
+</body>
+</html>


Property changes on: CMF/trunk/CMFCalendar/skins/zpt_calendar/calendar_day_view_template.pt
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py	2006-02-05 21:30:52 UTC (rev 41567)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py	2006-02-05 21:32:07 UTC (rev 41568)
@@ -1,6 +1,7 @@
 ##parameters=change='', change_and_view=''
 ##
 from Products.CMFCalendar.utils import Message as _
+from Products.CMFDefault.utils import decode
 
 form = context.REQUEST.form
 if change and \
@@ -51,4 +52,4 @@
 options['form'] = { 'action': target,
                     'listButtonInfos': tuple(buttons) }
 
-return context.event_edit_template(**options)
+return context.event_edit_template(**decode(options, script))


Property changes on: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_edit_form.py
___________________________________________________________________
Name: svn:keywords
   - Author Date Id Revision

Deleted: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt	2006-02-05 21:30:52 UTC (rev 41567)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt	2006-02-05 21:32:07 UTC (rev 41568)
@@ -1,74 +0,0 @@
-<html metal:use-macro="context/main_template/macros/master">
-<head>
- <metal:slot fill-slot="base"
- ><tal:span tal:replace="structure context/getBaseTag"
-/></metal:slot>
-</head>
-<body>
-
-<metal:slot metal:fill-slot="main" i18n:domain="cmf_calendar">
-<div class="Desktop">
-
-<table class="Event" border="0" cellpadding="5" width="100%" cellspacing="3">
- <tr>
-  <th width="10%" i18n:translate="">Event Name</th>
-  <td nowrap="nowrap" tal:content="context/Title">Title</td>
-  <th width="10%" i18n:translate="">Contact Name</th>
-  <td nowrap="nowrap" tal:content="context/contact_name">contact_name</td>
- </tr>
- <tr>
-  <th width="10%" i18n:translate="">Location</th>
-  <td nowrap="nowrap" tal:content="context/location">location</td>
-  <th width="10%" i18n:translate="">Contact Email</th>
-  <td nowrap="nowrap" tal:condition="context/contact_email">
-   <a tal:attributes="href python:'mailto:' + context.contact_email"
-      tal:content="context/contact_email"
-      href="mailto:contact_email">contact_email</a></td>
- </tr>
- <tr>
-  <th width="10%" i18n:translate="">Event type</th>
-  <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>
- <tr tal:condition="context/event_url|nothing">
-  <th width="10%" i18n:translate="">Event URL</th>
-  <td colspan="3" nowrap="nowrap"><a href="event_url"
-     tal:attributes="href context/event_url"
-     tal:content="context/event_url">event_url</a></td>
- </tr>
- <tr>
-  <td colspan="4"><hr /></td>
- </tr>
- <tr>
-  <th width="10%" i18n:translate="">Start Date</th>
-  <td tal:content="python:DateTime.Date(context.start())">start</td>
-  <th width="10%" i18n:translate="">Stop Date</th>
-  <td tal:content="python:DateTime.Date(context.end())">end</td>
- </tr>
- <tr>
-  <th width="10%" i18n:translate="">Start Time</th>
-  <td tal:content="python:DateTime.Time(context.start())">start</td>
-  <th width="10%" i18n:translate="">Stop Time</th>
-  <td tal:content="python:DateTime.Time(context.end())">end</td>
- </tr>
- <tr>
-  <td colspan="4"><hr /></td>
- </tr>
- <tr>
-  <th width="10%" i18n:translate="">Description</th>
-  <td colspan="3" valign="top" nowrap="nowrap"
-     tal:content="context/Description">Description</td>
- </tr>
- <tr>
-  <td colspan="4">&nbsp;</td>
- </tr>
-</table>
-
-</div>
-</metal:slot>
-
-</body>
-</html>

Added: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.py
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.py	2006-02-05 21:30:52 UTC (rev 41567)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.py	2006-02-05 21:32:07 UTC (rev 41568)
@@ -0,0 +1,21 @@
+##parameters=
+##
+from Products.CMFDefault.utils import decode
+
+options = {}
+options['title'] = context.Title()
+options['description'] = context.Description()
+options['contact_name'] = context.contact_name
+options['location'] = context.location
+options['contact_email'] = context.contact_email
+options['event_types'] = context.Subject()
+options['contact_phone'] = context.contact_phone
+options['event_url'] = context.event_url
+start = context.start()
+options['start_date'] = DateTime.Date(start)
+options['start_time'] = DateTime.Time(start)
+stop = context.end()
+options['stop_date'] = DateTime.Date(stop)
+options['stop_time'] = DateTime.Time(stop)
+
+return context.event_view_template(**decode(options, script))


Property changes on: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.py
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view_template.pt (from rev 41533, CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt)
===================================================================
--- CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view.pt	2006-02-01 15:10:13 UTC (rev 41533)
+++ CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view_template.pt	2006-02-05 21:32:07 UTC (rev 41568)
@@ -0,0 +1,74 @@
+<html metal:use-macro="context/main_template/macros/master">
+<head>
+ <metal:slot fill-slot="base"
+ ><tal:span tal:replace="structure context/getBaseTag"
+/></metal:slot>
+</head>
+<body>
+
+<metal:slot metal:fill-slot="main" i18n:domain="cmf_calendar">
+<div class="Desktop">
+
+<table class="Event" border="0" cellpadding="5" width="100%" cellspacing="3">
+ <tr>
+  <th width="10%" i18n:translate="">Event Name</th>
+  <td nowrap="nowrap" tal:content="options/title">Title</td>
+  <th width="10%" i18n:translate="">Contact Name</th>
+  <td nowrap="nowrap" tal:content="options/contact_name">contact_name</td>
+ </tr>
+ <tr>
+  <th width="10%" i18n:translate="">Location</th>
+  <td nowrap="nowrap" tal:content="options/location">location</td>
+  <th width="10%" i18n:translate="">Contact Email</th>
+  <td nowrap="nowrap" tal:condition="options/contact_email">
+   <a tal:attributes="href string:mailto:${options/contact_email}"
+      tal:content="options/contact_email"
+      href="mailto:contact_email">contact_email</a></td>
+ </tr>
+ <tr>
+  <th width="10%" i18n:translate="">Event type</th>
+  <td valign="top" nowrap="nowrap"><tal:loop
+      tal:repeat="event_type options/event_types"><tal:span
+       tal:content="event_type" i18n:translate="" /> </tal:loop></td>
+  <th width="10%" i18n:translate="">Contact Phone</th>
+  <td nowrap="nowrap" tal:content="options/contact_phone">contact_phone</td>
+ </tr>
+ <tr tal:condition="options/event_url">
+  <th width="10%" i18n:translate="">Event URL</th>
+  <td colspan="3" nowrap="nowrap"><a href="event_url"
+     tal:attributes="href options/event_url"
+     tal:content="options/event_url">event_url</a></td>
+ </tr>
+ <tr>
+  <td colspan="4"><hr /></td>
+ </tr>
+ <tr>
+  <th width="10%" i18n:translate="">Start Date</th>
+  <td tal:content="options/start_date">start</td>
+  <th width="10%" i18n:translate="">Stop Date</th>
+  <td tal:content="options/stop_date">end</td>
+ </tr>
+ <tr>
+  <th width="10%" i18n:translate="">Start Time</th>
+  <td tal:content="options/start_time">start</td>
+  <th width="10%" i18n:translate="">Stop Time</th>
+  <td tal:content="options/stop_time">end</td>
+ </tr>
+ <tr>
+  <td colspan="4"><hr /></td>
+ </tr>
+ <tr>
+  <th width="10%" i18n:translate="">Description</th>
+  <td colspan="3" valign="top" nowrap="nowrap"
+     tal:content="options/description">Description</td>
+ </tr>
+ <tr>
+  <td colspan="4">&nbsp;</td>
+ </tr>
+</table>
+
+</div>
+</metal:slot>
+
+</body>
+</html>


Property changes on: CMF/trunk/CMFCalendar/skins/zpt_calendar/event_view_template.pt
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the CMF-checkins mailing list