source: WAeUP_CMS/branches/waeup_cms_sandbox/skins/WAEUP/portlet_calendar.pt @ 2163

Last change on this file since 2163 was 13, checked in by Henrik Bettermann, 19 years ago
File size: 6.1 KB
Line 
1<html xmlns:tal="http://xml.zope.org/namespaces/tal"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      i18n:domain="plone">
4
5<body>
6
7<div metal:define-macro="portlet"
8     tal:omit-tag=""
9     tal:define="DateTime python:modules['DateTime'].DateTime;
10                 current python:DateTime();
11                 current_day current/day;
12                 yearmonth here/getYearAndMonthToDisplay;
13                 nextYearMax python: current+365;
14                 prevYearMin python: current-365;
15                 year python:yearmonth[0];
16                 month python:yearmonth[1];
17                 prevMonthTime python:here.getPreviousMonth(month, year);
18                 nextMonthTime python:here.getNextMonth(month, year);
19                 weeks python:here.portal_calendar.getEventsForCalendar(month, year);
20                 anchor_url request/anchor_url | here_url;
21                 query_string python:request.get('orig_query', None);
22                 query_string python: (query_string is None and request.get('QUERY_STRING', None)) or query_string;
23                 url_quote python:modules['Products.PythonScripts.standard'].url_quote;
24                 anchor_method request/anchor_method | template/getId;
25                 translation_service nocall:here/translation_service;"
26     tal:condition="python:here.getId() in ['events', 'previous']">                       <!-- included, HB -->
27    <!-- The calendar, rendered as a table -->
28
29    <table class="ploneCalendar" id="thePloneCalendar" summary="Calendar" i18n:attributes="summary summary_calendar;">
30        <thead>
31            <tr>
32                <th id="calendar-previous">
33                    <a href="#" rel="nofollow"
34                       title="Previous month"
35                       tal:attributes="href python:'%s/%s?%s&amp;month:int=%d&amp;year:int=%d&amp;orig_query=%s' % (anchor_url, anchor_method, query_string, prevMonthTime.month(),prevMonthTime.year(),url_quote(query_string))"
36                       tal:condition="python: yearmonth > (prevYearMin.year(), prevYearMin.month())"
37                       i18n:attributes="title title_previous_month;">&laquo;</a>
38                </th>
39                <th colspan="5">
40                    <span i18n:translate="" tal:omit-tag="">
41                        <span i18n:name="monthname">
42                            <span tal:define="month_english python:translation_service.month_english(month);"
43                                  tal:attributes="id string:calendar-month-$month_english"
44                                  tal:content="python: here.utranslate(translation_service.month_msgid(month), default=month_english)"
45                                  id="calendar-month-month">&nbsp;</span>
46                        </span>
47                        <span i18n:name="year"
48                              tal:content="string:$year"
49                              tal:attributes="id string:calendar-year-$year;"
50                              id="calendar-year">&nbsp;</span>
51                    </span>
52                </th>
53                <th id="calendar-next">
54                    <a href="#" rel="nofollow"
55                       title="Next month"
56                       tal:attributes="href python:'%s/%s?%s&amp;month:int=%d&amp;year:int=%d&amp;orig_query=%s' % (anchor_url, anchor_method, query_string, nextMonthTime.month(),nextMonthTime.year(),url_quote(query_string))"
57                       tal:condition="python: yearmonth &lt; (nextYearMax.year(), nextYearMax.month())"
58                       i18n:attributes="title title_next_month;">&raquo;</a>
59                </th>
60            </tr>
61            <tr tal:define="weekdaynumbers here/portal_calendar/getDayNumbers" class="weekdays">
62                <tal:data tal:repeat="daynumber weekdaynumbers">
63                    <td tal:define="weekday_english python:translation_service.weekday_english(daynumber);"
64                        tal:content="python: here.utranslate(translation_service.day_msgid(daynumber, format='s'), default=weekday_english)">Su</td>
65                </tal:data>
66            </tr>
67        </thead>
68
69        <tal:comment replace="nothing"><!--
70        Sorry for the obtuse formatting below (the stray end-of-tag markers), but until
71        tal:block doesn't render an entire line of blank space when used, this is the only way.
72        --></tal:comment>
73        <tbody>
74            <tr tal:repeat="week weeks"
75            ><tal:block repeat="day week"
76            ><tal:block define="daynumber day/day;
77                                int_daynumber python: int(daynumber);
78                                day_event day/event;
79                                is_today python: current_day==int_daynumber and current.month()==month and current.year()==year">
80               <td class="event" tal:condition="day_event"
81                      tal:attributes="class python:test(is_today, 'todayevent', 'event')"
82                   ><tal:data tal:define="cur_date python:DateTime(year,month,int_daynumber);
83                                          begin python:url_quote((cur_date.latestTime()).ISO());
84                                          end python:url_quote(cur_date.earliestTime().ISO());"
85                              tal:omit-tag=""
86                     ><a href=""
87                         tal:attributes="href string:${here/portal_url}/search?review_state=published&amp;start.query:record:list:date=${begin}&amp;start.range:record=max&amp;end.query:record:list:date=${end}&amp;end.range:record=min;
88                                         title python:'\n'.join([here.toLocalizedTime(cur_date)]+[here.getEventString(e) for e in day['eventslist']]);"
89                         tal:content="python: daynumber or default">
90                      31
91                      </a
92                   ></tal:data>
93                </td
94                ><tal:notdayevent tal:condition="not: day_event"
95               ><td tal:attributes="class python:test(is_today,'todaynoevent',None)"
96                    tal:content="python: daynumber or default"></td
97               ></tal:notdayevent
98            ></tal:block
99            ></tal:block>
100            </tr>
101        </tbody>
102    </table>
103
104</div>
105
106</body>
107
108</html>
Note: See TracBrowser for help on using the repository browser.