[CMF-checkins] SVN: CMF/trunk/C - switched the CMFCalendar default
profile to browser views
Yvo Schubbe
y.2007- at wcm-solutions.de
Thu Mar 8 09:03:21 EST 2007
Log message for revision 73064:
- switched the CMFCalendar default profile to browser views
Changed:
U CMF/trunk/CHANGES.txt
D CMF/trunk/CMFCalendar/browser/README.txt
D CMF/trunk/CMFCalendar/browser/TODO.txt
U CMF/trunk/CMFCalendar/browser/configure.zcml
U CMF/trunk/CMFCalendar/browser/templates/calendar_widgets.pt
U CMF/trunk/CMFCalendar/configure.zcml
D CMF/trunk/CMFCalendar/profiles/default/skins.xml
U CMF/trunk/CMFCalendar/profiles/default/types/Event.xml
A CMF/trunk/CMFCalendar/profiles/skins_support/
A CMF/trunk/CMFCalendar/profiles/skins_support/skins.xml
U CMF/trunk/CMFCalendar/profiles/skins_support/types/Event.xml
D CMF/trunk/CMFCalendar/profiles/views_support/
U CMF/trunk/CMFCalendar/testing.py
U CMF/trunk/CMFDefault/skins/zpt_generic/getMainGlobals.py
U CMF/trunk/CMFDefault/skins/zpt_generic/main_template.pt
-=-
Modified: CMF/trunk/CHANGES.txt
===================================================================
--- CMF/trunk/CHANGES.txt 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CHANGES.txt 2007-03-08 14:03:20 UTC (rev 73064)
@@ -7,6 +7,10 @@
New Features
+ - CMFCalendar: Zope3 style browser views are now used by default.
+ An additional setup profile allows you to hook up the oldstyle skins and
+ to make customizations TTW.
+
- DirectoryView: Added 'registerDirectory' ZCML directive.
Using the old registerDirectory method in __init__.py is now deprecated.
See zcml.IRegisterDirectoryDirective for details.
Deleted: CMF/trunk/CMFCalendar/browser/README.txt
===================================================================
--- CMF/trunk/CMFCalendar/browser/README.txt 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/browser/README.txt 2007-03-08 14:03:20 UTC (rev 73064)
@@ -1,17 +0,0 @@
-Experimental Browser Views
-
- This sub-package provides Zope 3-style browser views for the CMFCalendar
- IEvent interface. These views are not used by the default profile.
-
- The content of this sub-package is experimental and might be refactored
- without further notice. Documentation and unittests are still missing but
- the views should work just as well as the corresponding skin methods.
-
- See TODO.txt for a detailed list of converted skin methods.
-
- Using the Browser Views
-
- In an un-customized CMFDefault site you will notice no difference because
- the browser views are just different in implementation, not in look and
- feel. But the browser view machinery bypasses the CMF skin machinery, so
- you will notice that TTW customizations no longer have any effect.
Deleted: CMF/trunk/CMFCalendar/browser/TODO.txt
===================================================================
--- CMF/trunk/CMFCalendar/browser/TODO.txt 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/browser/TODO.txt 2007-03-08 14:03:20 UTC (rev 73064)
@@ -1,31 +0,0 @@
-Converting skins to views:
-
- [x] @@calendar_day.html:
-
- [x] calendar_day_view.py -> CalendarView.viewDay
- CalendarView.formattedDate
- CalendarView.eventsForDay
- CalendarView.previousDayURL
- CalendarView.nextDayURL
- [x] calendar_day_view_template.pt -> templates/calendar_day.pt
- [x] getEndAsString.py -> CalendarView._getEndAsString
- [x] getStartAsString.py -> CalendarView._getStartAsString
-
- [x] @@calendar_widget:
-
- [x] calendarBox.pt -> templates/calendar_widgets.pt
- [x] getDaysClass.py -> CalendarBoxView.getDaysClass
- [x] getMonthAndYear.py -> CalendarBoxView.getMonthAndYear
- [x] getNextMonthLink.py -> CalendarBoxView.getNextMonthLink
- [x] getPreviousMonthLink.py -> CalendarBoxView.getPreviousMonthLink
-
- [x] IEvent @@view.html:
-
- [x] event_view.py -> EventView
- [x] event_view_template.pt -> formlib based
-
- [x] IMutableEvent @@edit.html:
-
- [x] event_edit_form.py -> EventEditView
- [x] event_edit_template.pt -> formlib based
- [x] event_edit_control.py -> formlib based
Modified: CMF/trunk/CMFCalendar/browser/configure.zcml
===================================================================
--- CMF/trunk/CMFCalendar/browser/configure.zcml 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/browser/configure.zcml 2007-03-08 14:03:20 UTC (rev 73064)
@@ -51,4 +51,14 @@
permission="zope2.View"
/>
+ <browser:resource
+ name="event_icon.gif"
+ image="../skins/zpt_calendar/event_icon.gif"
+ />
+
+ <browser:resource
+ name="calendar.css"
+ file="../skins/zpt_calendar/CalendarStyle.css"
+ />
+
</configure>
Modified: CMF/trunk/CMFCalendar/browser/templates/calendar_widgets.pt
===================================================================
--- CMF/trunk/CMFCalendar/browser/templates/calendar_widgets.pt 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/browser/templates/calendar_widgets.pt 2007-03-08 14:03:20 UTC (rev 73064)
@@ -53,7 +53,7 @@
tal:attributes="class python: calendar_box_view.getDaysClass(daynumber, month, year, day['event'])">
<a href
tal:omit-tag="not: day/event"
- tal:attributes="href string:${portal_url}/@@calendar_day.html?date=${datestring}"
+ tal:attributes="href string:${portal_url}/calendar_day.html?date=${datestring}"
tal:content="python:daynumber or default"> </a>
</td></tal:loop>
</tr>
Modified: CMF/trunk/CMFCalendar/configure.zcml
===================================================================
--- CMF/trunk/CMFCalendar/configure.zcml 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/configure.zcml 2007-03-08 14:03:20 UTC (rev 73064)
@@ -38,9 +38,9 @@
/>
<genericsetup:registerProfile
- name="views_support"
- title="Experimental CMFCalendar Browser Views"
- description="Hooks up the browser views."
+ name="skins_support"
+ title="CMFCalendar Oldstyle Skins"
+ description="Hooks up the oldstyle skins."
provides="Products.GenericSetup.interfaces.EXTENSION"
for="Products.CMFCore.interfaces.ISiteRoot"
/>
Deleted: CMF/trunk/CMFCalendar/profiles/default/skins.xml
===================================================================
--- CMF/trunk/CMFCalendar/profiles/default/skins.xml 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/profiles/default/skins.xml 2007-03-08 14:03:20 UTC (rev 73064)
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<object name="portal_skins" meta_type="CMF Skins Tool">
- <object name="zpt_calendar" meta_type="Filesystem Directory View"
- directory="Products.CMFCalendar:skins/zpt_calendar"/>
- <skin-path name="*">
- <layer name="zpt_calendar" insert-before="zpt_content"/>
- </skin-path>
-</object>
Modified: CMF/trunk/CMFCalendar/profiles/default/types/Event.xml
===================================================================
--- CMF/trunk/CMFCalendar/profiles/default/types/Event.xml 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/profiles/default/types/Event.xml 2007-03-08 14:03:20 UTC (rev 73064)
@@ -5,23 +5,23 @@
<property name="title" i18n:translate="">Event</property>
<property name="description"
i18n:translate="">Events are objects for use in Calendar topical queries on the catalog.</property>
- <property name="content_icon">event_icon.gif</property>
+ <property name="content_icon">++resource++event_icon.gif</property>
<property name="content_meta_type">CMF Event</property>
<property name="product"></property>
<property name="factory">cmf.calendar.event</property>
- <property name="immediate_view">event_edit_form</property>
+ <property name="immediate_view">edit.html</property>
<property name="global_allow">True</property>
<property name="filter_content_types">True</property>
<property name="allowed_content_types"/>
<property name="allow_discussion">False</property>
- <alias from="(Default)" to="event_view"/>
- <alias from="view" to="event_view"/>
+ <alias from="(Default)" to="@@view.html"/>
+ <alias from="view" to="@@view.html"/>
<action title="View" action_id="view" category="object" condition_expr=""
- url_expr="string:${object_url}/event_view" visible="True">
+ url_expr="string:${object_url}" visible="True">
<permission value="View"/>
</action>
<action title="Edit" action_id="edit" category="object" condition_expr=""
- url_expr="string:${object_url}/event_edit_form" visible="True">
+ url_expr="string:${object_url}/edit.html" visible="True">
<permission value="Change portal events"/>
</action>
</object>
Copied: CMF/trunk/CMFCalendar/profiles/skins_support (from rev 73054, CMF/trunk/CMFCalendar/profiles/views_support)
Copied: CMF/trunk/CMFCalendar/profiles/skins_support/skins.xml (from rev 73054, CMF/trunk/CMFCalendar/profiles/default/skins.xml)
Property changes on: CMF/trunk/CMFCalendar/profiles/skins_support/skins.xml
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: CMF/trunk/CMFCalendar/profiles/skins_support/types/Event.xml
===================================================================
--- CMF/trunk/CMFCalendar/profiles/views_support/types/Event.xml 2007-03-08 05:33:18 UTC (rev 73054)
+++ CMF/trunk/CMFCalendar/profiles/skins_support/types/Event.xml 2007-03-08 14:03:20 UTC (rev 73064)
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<object name="Event">
- <alias from="(Default)" to="@@view.html"/>
- <alias from="event_edit_form" to="@@edit.html"/>
- <alias from="event_view" to="@@view.html"/>
- <alias from="view" to="@@view.html"/>
+ <alias from="(Default)" to="event_view"/>
+ <alias from="edit.html" to="event_edit_form"/>
+ <alias from="view.html" to="event_view"/>
+ <alias from="view" to="event_view"/>
</object>
Modified: CMF/trunk/CMFCalendar/testing.py
===================================================================
--- CMF/trunk/CMFCalendar/testing.py 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFCalendar/testing.py 2007-03-08 14:03:20 UTC (rev 73064)
@@ -43,7 +43,8 @@
app = ZopeTestCase.app()
addConfiguredSite(app, 'site', 'Products.CMFDefault:default',
snapshot=False,
- extension_ids=('Products.CMFCalendar:default',))
+ extension_ids=('Products.CMFCalendar:default',
+ 'Products.CMFCalendar:skins_support'))
transaction.commit()
ZopeTestCase.close(app)
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/getMainGlobals.py
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/getMainGlobals.py 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/getMainGlobals.py 2007-03-08 14:03:20 UTC (rev 73064)
@@ -6,6 +6,8 @@
from Products.CMFDefault.utils import getBrowserCharset
atool = getToolByInterfaceName('Products.CMFCore.interfaces.IActionsTool')
+caltool_iface = 'Products.CMFCalendar.interfaces.ICalendarTool'
+caltool = getToolByInterfaceName(caltool_iface, None)
mtool = getToolByInterfaceName('Products.CMFCore.interfaces.IMembershipTool')
ptool = getToolByInterfaceName('Products.CMFCore.interfaces.IPropertiesTool')
utool = getToolByInterfaceName('Products.CMFCore.interfaces.IURLTool')
@@ -30,6 +32,7 @@
'mtool': mtool,
'atool': atool,
'wtool': wtool,
+ 'caltool_installed': caltool is not None,
'portal_object': portal_object,
'portal_title': portal_object.Title(),
'object_title': context.Title(),
Modified: CMF/trunk/CMFDefault/skins/zpt_generic/main_template.pt
===================================================================
--- CMF/trunk/CMFDefault/skins/zpt_generic/main_template.pt 2007-03-08 13:52:00 UTC (rev 73063)
+++ CMF/trunk/CMFDefault/skins/zpt_generic/main_template.pt 2007-03-08 14:03:20 UTC (rev 73064)
@@ -5,6 +5,7 @@
mtool globals/mtool;
atool globals/atool;
wtool globals/wtool;
+ caltool_installed globals/caltool_installed;
portal_object globals/portal_object;
portal_title globals/portal_title;
object_title globals/object_title;
@@ -30,9 +31,9 @@
<link rel="stylesheet" type="text/css" href="zpt_stylesheet.css"
tal:attributes="href context/zpt_stylesheet.css/absolute_url" />
- <link rel="stylesheet" type="text/css" href="CalendarStyle.css"
- tal:condition="context/CalendarStyle.css|nothing"
- tal:attributes="href context/CalendarStyle.css/absolute_url" />
+ <link rel="stylesheet" type="text/css" href="calendar.css"
+ tal:condition="caltool_installed"
+ tal:attributes="href string:${portal_url}/++resource++calendar.css" />
<metal:slot define-slot="style_slot" />
</head>
@@ -240,10 +241,9 @@
</td>
</tr>
- <tr>
+ <tr tal:condition="caltool_installed">
<td>
- <div metal:use-macro="context/calendarBox/macros/calendarBox | default">
- <!-- CMFCalendar not Installed -->
+ <div metal:use-macro="context/@@calendar_widget/macros/calendarBox">
</div>
</td>
</tr>
More information about the CMF-checkins
mailing list