source: products/SimpleBlog/tags/1.3.5qg/skins/SimpleBlog/SimpleBlog_macros.pt @ 2743

Last change on this file since 2743 was 1, checked in by myroslav, 19 years ago

Building directory structure

File size: 21.0 KB
Line 
1<html xmlns:tal="http://xml.zope.org/namespaces/tal"
2      xmlns:metal="http://xml.zope.org/namespaces/metal"
3      i18n:domain="SimpleBlog">
4<body>
5
6<div metal:define-macro="full" tal:define="showReadMore python:0" class="simpleBlogEntry">
7    <div tal:define="size headerSize | python:1;title obj/title_or_id;
8                         showIcons obj/simpleblog_tool/getShowIcons"
9             class="simpleBlogTitle">
10                <tal:x replace='structure string:<h${size} class="noMargin">'/>
11            <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;">
12                <img alt="" tal:condition="showIcons" src="#" tal:attributes="src string:${obj/portal_url}/${obj/getIcon};alt obj/title" />
13                <span tal:replace="title"/>
14            </a>
15                <tal:x replace="structure string:</h${size}>"/>
16
17    </div>
18    <div class="simpleBlogDescription documentDescription description" tal:content="structure python:obj.Description()">
19        description
20    </div>
21    <div tal:replace="structure python:obj.getBody()" class="simpleBlogBody"/><br/><br/>
22        <tal:tags metal:use-macro="obj/SimpleBlog_macros/macros/technoratiTags"/>
23        <tal:byLine metal:use-macro="obj/SimpleBlog_macros/macros/ByLineFoot"/>
24</div>
25
26<div metal:define-macro="descriptionOnly"  tal:define="showReadMore python:1" class="simpleBlogEntry">
27    <div tal:define="size headerSize | python:1;title obj/title_or_id;
28                         showIcons obj/simpleblog_tool/getShowIcons"
29             class="simpleBlogTitle">
30                <tal:x replace='structure string:<h${size} class="noMargin">'/>
31            <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;">
32                <img alt="" tal:condition="showIcons" src="#" tal:attributes="src string:${obj/portal_url}/${obj/getIcon};alt obj/title" />
33                <span tal:replace="title"/>
34            </a>
35                <tal:x replace="structure string:</h${size}>"/>
36    </div>
37    <div tal:content="structure python:obj.Description()" class="simpleBlogDescriptionOnly">
38        description
39    </div>
40        <tal:tags metal:use-macro="obj/SimpleBlog_macros/macros/technoratiTags"/>
41        <tal:byLine metal:use-macro="obj/SimpleBlog_macros/macros/ByLineFoot"/>
42
43</div>
44
45<div metal:define-macro="titleOnly" tal:define="showReadMore python:1" class="simpleBlogTitle">
46    <tal:block tal:define="size headerSize | python:1;title obj/title_or_id;
47                               showIcons obj/simpleblog_tool/getShowIcons">
48                <tal:x replace='structure string:<h${size} class="noMargin">'/>
49            <a href="" tal:attributes="href obj/absolute_url" style="cursor:pointer;">
50                <img alt="" tal:condition="showIcons" src="#" tal:attributes="src string:${obj/portal_url}/${obj/getIcon};alt obj/title" />
51                <span tal:replace="title"/>
52            </a>
53                <tal:x replace="structure string:</h${size}>"/>
54    </tal:block>
55        <tal:tags metal:use-macro="obj/SimpleBlog_macros/macros/technoratiTags"/>
56        <tal:byLine metal:use-macro="obj/SimpleBlog_macros/macros/ByLineFoot"/>
57    <p />
58</div>
59
60<div metal:define-macro="ByLine" class="BlogByLine">
61     <span i18n:translate="blog_by_line">
62    Submitted by
63        <a href="" i18n:name="author" tal:attributes="href python:container.portal_membership.getHomeUrl(obj.Creator());" tal:content="obj/Creator">author</a>.
64    on <span i18n:name="date" tal:replace="python:here.toPortalTime(obj.simpleblog_tool.getEntryDate(obj), long_format=1)">Jun 2, 2002 2:42 pm</span>.
65     </span>
66     <span tal:define="cats python:obj.EntryCategory();
67                       pss modules/Products.PythonScripts.standard;"
68           class="simpleBlogBylineCats">
69           <tal:categories tal:repeat="cat cats" tal:condition="cats">
70                <span tal:omit-tag="" tal:condition="not: repeat/cat/start">|&nbsp;</span>
71                <strong><a href="#"
72                           tal:define="quotedCat python:pss.url_quote(cat)"
73                           tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}"
74                           title="category"><span  tal:omit-tag="" tal:content="cat"/></a></strong>
75           </tal:categories>
76     </span>
77</div>
78
79
80<div metal:define-macro="technoratiTags"
81      tal:define="cats python:obj.EntryTag();"
82     tal:condition="python:here.isTagsEnabled() and cats"
83     tal:omit-tag="">
84     _____<br/>
85     tags:
86     <span class="simpleBlogBylineCats">
87           <tal:categories tal:repeat="cat cats" tal:condition="cats"><span tal:omit-tag="" tal:condition="not: repeat/cat/start">|&nbsp;
88                      </span><strong><a href="#"
89                           rel="tag"   
90                           tal:define="quotedCat python:cat.lower().replace(' ', '+')"
91                           tal:attributes="href string:http://www.technorati.com/tag/${quotedCat}"><span  tal:omit-tag="" tal:content="cat"/></a></strong>
92           </tal:categories>
93     </span>
94</div>
95
96<div metal:define-macro="ByLineFoot" class="BlogByLine">
97    <tal:x define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj);
98                   ccount python:allowed and obj.portal_discussion.getDiscussionFor(obj).replyCount(obj);
99                   tballowed python:here.getAllowTrackback();
100                   tbcount python:len(obj.getTrackbacks())">
101         <span i18n:translate="blog_by_line">
102         <span tal:define="edate python:obj.simpleblog_tool.getEntryDate(obj)"
103               i18n:name="date" tal:replace="python:DateTime(edate).strftime('%A, %B %d, %Y')">Jun 2, 2002 2:42 pm</span>
104         </span>
105         <span tal:define="cats python:obj.EntryCategory();
106                           pss modules/Products.PythonScripts.standard;"
107               tal:omit-tag="">
108               <tal:x tal:condition="cats"> in </tal:x>
109               <tal:categories tal:repeat="cat cats" tal:condition="cats">
110                    <span tal:omit-tag="" tal:condition="not: repeat/cat/start">|&nbsp;</span>
111                    <strong><a href="#"
112                               tal:define="quotedCat python:pss.url_quote(cat)"
113                               tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat}"
114                               title="category"><span  tal:omit-tag="" tal:content="cat"/></a></strong>
115               </tal:categories>
116         </span>&nbsp;|&nbsp;
117         <strong><a href=""
118            tal:attributes="href obj/absolute_url"
119            i18n:translate="permalink">Permalink</a></strong>&nbsp;|&nbsp;
120         <tal:block condition="allowed">
121         <strong><a href=""
122              tal:attributes="href string:${obj/absolute_url}#comments"
123              tal:content="string:Comments (${ccount})">Comments</a></strong>
124            <tal:x condition="tbcount">&nbsp;|&nbsp;</tal:x>
125         </tal:block>
126         <strong tal:condition="python:tballowed and tbcount">
127            <tal:x tal:replace="string:TrackBack (${tbcount})">TrackBack</tal:x></strong>
128         <div tal:condition="tballowed"> trackback URL: &nbsp;
129               <tal:x replace="string:${obj/absolute_url}/sbtrackback"/>
130         </div>
131
132   </tal:x>
133</div>
134
135<!-- macro for the commandline showing the categories for the current entry and the comments plus actions to read more and add comments -->
136<div tal:condition="not: standardButtons" metal:define-macro="commandLineNonStandard" tal:define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj)" class="BlogCommandLine">
137    <tal:comments tal:condition="allowed">
138        <tal:block tal:define="comments python:obj.portal_discussion.getDiscussionFor(obj);
139                                       tb_number python:len(obj.getTrackbacks())">
140            <a href="" tal:attributes="href obj/absolute_url"
141                           i18n:translate="comments">Comments</a>: <span tal:content="python:comments.replyCount(obj)" />&nbsp;
142            |&nbsp;<a href="" tal:attributes="href obj/absolute_url"
143                           i18n:translate="trackbacks">Trackbacks</a>: <span tal:content="tb_number" />&nbsp;
144            <span tal:condition="python:obj.portal_membership.checkPermission('Reply to item', obj)">
145                |&nbsp;<a href="" tal:attributes="href string:${obj/absolute_url}/discussion_reply_form?backurl=${obj/absolute_url}" title="Add new comment"
146                              i18n:translate="add_new_comment"
147                              i18n:attributes="title add_new_comment">Add new comment</a>&nbsp;
148            </span>
149        </tal:block>
150    </tal:comments>
151    <tal:readmore tal:condition="showReadMore | python:0">
152        <span tal:condition="allowed">|</span>
153        <a href="" tal:attributes="href obj/absolute_url" title="Read more"
154                   i18n:attributes="title read_full_blog"
155                   i18n:translate="read_full_blog">Read more</a>
156    </tal:readmore>
157    <span tal:condition="python:obj.portal_membership.checkPermission('Modify portal content', obj)">|
158    <a href="" tal:attributes="href string:${obj/absolute_url}/base_edit" title="Edit"
159           i18n:translate="edit_blog">Edit</a>
160    </span>
161</div>
162
163<div tal:condition="standardButtons" metal:define-macro="commandLine" tal:define="allowed python:obj.portal_discussion.isDiscussionAllowedFor(obj)" class="BlogCommandLine">
164    <div class="simpleBlogLinkButtons">
165        <tal:comments tal:condition="allowed">
166            <tal:block tal:define="comments python:obj.portal_discussion.getDiscussionFor(obj);
167                                               tb_number python:len(obj.getTrackbacks())">
168                <a href="" tal:attributes="href obj/absolute_url"
169                    i18n:translate="comments">Comments</a>: <span tal:content="python:comments.replyCount(obj)" />&nbsp;
170            |&nbsp;<a href="" tal:attributes="href obj/absolute_url"
171                           i18n:translate="trackbacks">Trackbacks</a>: <span tal:content="tb_number" />&nbsp;
172            </tal:block>
173        </tal:comments>
174        <tal:readmore tal:condition="showReadMore | python:0">
175            <span tal:condition="allowed">|</span>
176            <a href="" tal:attributes="href obj/absolute_url" title="Read more">Read more</a>
177        </tal:readmore>
178    </div>
179    <form action=""
180          method="post"
181          tal:condition="python:allowed and here.portal_membership.checkPermission('Reply to item', obj)"
182          tal:attributes="action string:${obj/absolute_url}/discussion_reply_form">         
183        <input type="Hidden" name="backurl" value="" tal:attributes="value obj/absolute_url">
184        <input class="standalone" type="submit" value="Add Comment" i18n:attributes="value add_new_comment"/>
185    </form>
186    <form action=""
187          method="post"
188          tal:condition="python:obj.portal_membership.checkPermission('Modify portal content', obj)"
189          tal:attributes="action string:${obj/absolute_url}/base_edit">         
190          <input class="standalone" type="submit" value="Edit" i18n:attributes="value edit_blog"/>
191    </form>
192</div>
193
194
195
196<!-- macro used by the portlets to compile a list of available categories -->
197<div metal:define-macro="portletCategories" tal:define="cats python:here.simpleblog_tool.getAvailableCategories(here)" tal:omit-tag="">
198    <tal:toggle tal:define="global toggle python:toggle or 0"/>
199    <tal:cats tal:repeat="cat python:here.simpleblog_tool.getSortedKeys(cats)">
200        <div tal:define="oddrow repeat/cat/odd" tal:condition="repeat/cat/start" tal:attributes="class python:test(toggle, 'portletContent content odd','portletContent content even')">
201            <strong i18n:translate="blog_categories">Categories:</strong>
202        </div>
203        <div tal:define="oddrow repeat/cat/odd;
204                         pss modules/Products.PythonScripts.standard;
205                         quotedCat python:pss.url_quote(cat)"
206            tal:attributes="class python:test(toggle, 'portletContent content even','portletContent content odd')">
207            <a tal:condition="python:cats[cat]>0"  href="#"
208                           tal:attributes="href string:${here/absolute_url}/SimpleBlogCatSearch?category=${quotedCat};
209                                           title cat"
210                           title="category"><span tal:content="cat"/></a>
211                        <span tal:condition="python:cats[cat]==0" tal:content="cat"/>
212                        (<span tal:content="python:cats[cat]"/>)
213        </div>
214        <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/>
215    </tal:cats>
216</div>
217
218<!-- macro used by the portlets to compile a list of recent additions -->
219<div metal:define-macro="portletRecent" tal:define="recent python:here.simpleblog_tool.searchForEntries(here)">
220    <tal:toggle tal:define="global toggle python:0"/>
221        <tal:entries tal:repeat="entry recent">
222        <div tal:define="oddrow repeat/entry/odd"
223                     tal:condition="repeat/entry/start"
224                     tal:attributes="class python:test(toggle, 'portletContent content odd','portletContent content even')">
225                     
226                     
227            <tal:frontpage tal:define="fp python:here.simpleblog_tool.getFrontPage(here)">
228                <a tal:condition="python:fp!=None" href="#" tal:attributes="href fp/absolute_url;title fp/title_or_id" title=""><strong><span tal:replace="fp/title_or_id"/>:</strong></a>
229                <strong tal:condition="python:fp==None" i18n:translate="recent_additions">Recent additions:</strong>
230            </tal:frontpage>
231        </div>
232        <div tal:define="oddrow repeat/entry/odd"
233                 tal:attributes="class python:test(toggle, 'portletContent content even','portletContent content odd')">
234            <a href="#"
235                           tal:attributes="href entry/getURL;"
236                           title="entry">
237                           <img src="#" tal:attributes="src string:${portal_url}/${entry/getIcon};" alt="" />
238                           <span tal:content="python:entry.Title or entry.getId"/>
239                        </a>
240        </div>
241        <div tal:define="oddrow repeat/entry/odd"
242                     tal:condition="repeat/entry/end"
243                     tal:attributes="class python:test(toggle, 'portletMore portletContent content odd','portletMore portletContent content even')">
244            <a href="#" tal:attributes="href string:${here/absolute_url}/SimpleBlogFullSearch"
245                           title="more..."
246                           i18n:attributes="title box_morelink"
247                           i18n:translate="box_morelink"
248                           i18n:domain="plone">More...</a>
249        </div>
250        <tal:toggle tal:define="global toggle python:test(toggle==1,0,1)"/>
251    </tal:entries>
252    <div class="portletContent content even" tal:condition="not: recent">
253                <strong i18n:translate="recent_additions">Recent additions:</strong>
254    </div>
255    <div class="portletContent content odd" tal:condition="not: recent">
256        <span i18n:translate="no_published_blog_entries">No blog entries are published.</span>
257        <tal:toggle tal:define="global toggle python:0"/>
258    </div>
259</div>
260
261<div metal:define-macro="portletCalendar"
262     tal:omit-tag=""
263     tal:define="DateTime python:modules['DateTime'].DateTime;
264                 current python:DateTime();
265                 month python:request.get('month', DateTime().month());
266                 year python:request.get('year', DateTime().year());
267                 prevMonthTime python:here.getPreviousMonth(month, year);
268                 nextMonthTime python:here.getNextMonth(month, year);
269                 weeks python:here.simpleblog_tool.getEventsForCalendar(month=month, year=year, context=here);
270                 anchor_url request/anchor_url | here_url;
271                 anchor_method request/anchor_method | template/getId;
272                 published_state python:here.simpleblog_tool.getPublishedState()"
273    i18n:domain="plone">
274    <!-- The calendar, rendered as a table -->
275
276    <table cellspacing="0" class="simpleBlogCalendar" id="thePloneCalendar" summary="Calendar" i18n:attributes="summary">
277        <thead>
278            <tr>
279                <th id="calendar-previous">
280                    <a href="#" tal:attributes="href python:'%s/%s?month:int=%d&amp;year:int=%d' % (anchor_url, anchor_method, prevMonthTime.month(),prevMonthTime.year())">&laquo;</a>
281                </th>
282                <th colspan="5"
283                    tal:define="date string:$month/1/$year;">
284                    <span i18n:translate="" tal:omit-tag="">
285                        <span i18n:name="monthname">
286                            <span i18n:translate=""
287                                  tal:define="monthstring python:DateTime(date).strftime('%B').capitalize();"
288                                  tal:attributes="id string:calendar-month-$monthstring"
289                                  tal:content="string:$monthstring"
290                                  id="calendar-month-month">&nbsp;</span>
291                        </span>
292                        <span i18n:name="year"
293                              tal:define="year python:DateTime(date).year()"
294                              tal:content="string:$year"
295                              tal:attributes="id string:calendar-year-$year;"
296                              id="calendar-year">&nbsp;</span>
297                    </span>
298                 </th>
299                <th id="calendar-next" tal:on-error="string:">
300                    <a href="#" tal:attributes="href python:'%s/%s?month:int=%d&amp;year:int=%d' % (anchor_url, anchor_method, nextMonthTime.month(),nextMonthTime.year())">&raquo;</a>
301                </th>
302            </tr>
303            <tr tal:define="weekdays here/portal_calendar/getDays" class="weekdays">
304                <tal:block repeat="weekday weekdays">
305                <td i18n:translate="" tal:content="weekday">Su</td>
306               </tal:block>
307            </tr>
308        </thead>
309        <tbody>
310            <tr tal:repeat="week weeks">
311              <tal:block repeat="day week">
312                <tal:block define="daynumber day/day;
313                                   datestring python: '%d%0.2d%0.2d' % (year, month, daynumber);
314                                   javascriptstring string:javascript:%sDay('%s');">
315                  <td class="event" tal:condition="day/event"
316                      tal:attributes="onmouseout  python: javascriptstring % ('hide', datestring);
317                                      onmouseover python: javascriptstring % ('show', datestring);
318                                      class       python:test(current.year()==year and current.month()==month and current.day()==int(daynumber), 'todayevent', 'event')">
319                    <span tal:define="begEndTimes python:here.getBeginAndEndTimes(day=daynumber, month=month, year=year)" tal:omit-tag="">
320                      <span tal:define="begin python:DateTime(begEndTimes[0].timeTime()+86400).ISO();
321                                        end python:DateTime(begEndTimes[1].strftime('%m/%d/%y')).ISO();
322                                        pss python:modules['Products'].PythonScripts.standard" tal:omit-tag="">
323                      <a href="" tal:attributes="href python:here.absolute_url()+'/SimpleBlogDaySearch?startdate=%s'%(pss.url_quote(end))">
324                        <span tal:replace="python: daynumber or default">&nbsp;</span>
325                      </a>
326                      </span>
327                    </span>
328                  </td>
329                  <tal:notdayevent tal:condition="not: day/event">
330                  <td tal:condition="python: current.year()==year and current.month()==month and current.day()==int(daynumber)"
331                      tal:content="python: daynumber or default" class="todaynoevent">
332                    &nbsp;
333                  </td>
334                  <td tal:condition="not: python: current.year()==year and current.month()==month and current.day()==int(daynumber)"
335                      tal:content="python: daynumber or default">
336                    &nbsp;
337                  </td>
338                  </tal:notdayevent>
339                </tal:block>
340              </tal:block>
341            </tr>
342        </tbody>
343    </table>
344
345
346    <!-- The sticky notes -->
347    <tal:week repeat="week weeks"><tal:day repeat="day week">
348        <div class="dayPopup"
349             id="dummy"
350             tal:attributes="id python:'day%d%0.2d%0.2d' % (year, month, day['day']) "
351             tal:condition="day/event">
352             <div class="date" tal:content="python:here.toPortalTime('%d/%0.2d/%0.2d' % (year, month, day['day']))">
353             2001-04-11
354             </div>
355             <tal:event repeat="anevent day/eventslist">
356             <div class="appointment" tal:content="python: here.getEventString(event=anevent)">an event</div>
357             </tal:event>
358        </div>
359      </tal:day>
360    </tal:week>
361
362</div>
363
364
365</body>
366</html>
Note: See TracBrowser for help on using the repository browser.