checked in mising files in the blog demo.

This commit is contained in:
agentzh (章亦春)
2010-01-25 03:05:37 +08:00
parent 3079df6d8c
commit c5a7c04b77
35 changed files with 2771 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<ul class="module-list">
[% FOREACH archive IN archives -%]
<li class="module-list-item">
[%- index = archive.month %]
<a href="#archive/[% archive.year %]/[% archive.month %]">[% months.$index %] [% archive.year %] ([% archive.count %])</a>
</li>
[% END -%]
</ul>
<p class="module-more">
[% IF offset > 0 %]
<a href="javascript:getArchiveList([% offset - count %])">&lt;&lt;</a>
[% END %]
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
[% IF archives.size == count %]
<a id="more-archives" href="javascript:getArchiveList([% offset + count %]);">
Next...
</a>
[% END %]
</p>

View File

@ -0,0 +1,16 @@
[% IF next %]
[%- index = next.month %]
<a href="#archive/[% next.year %]/[% next.month %]">
« [% months.$index %] [% next.year %]
</a>
[% END %]
|
<a href="#posts/1"> Main </a>
|
[% IF prev %]
[%- index = prev.month %]
<a href="#archive/[% prev.year %]/[% prev.month %]">
[% months.$index %] [% prev.year %] »
</a>
[% END %]

View File

@ -0,0 +1,71 @@
[%- index = month + 1 %]
<h2 class="module-header">[% months.$index %] [% year %]</h2>
<div class="module-content">
<table id="calendar-nav">
<tbody>
<tr>
<th>
<a class="nav-arrow"
href="javascript:void(0)"
onclick="getCalendar([% year - 1 %], [% month %])">
&lt;&lt;
</a>
</th>
<th>
<a class="nav-arrow"
href="javascript:void(0)"
onclick="getCalendar([% month - 1 < 0 ? year - 1 : year %], [% month - 1 < 0 ? 11 : month - 1 %])">
&lt;
</a>
</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>
<a class="nav-arrow"
href="javascript:void(0)"
onclick="getCalendar([% month + 1 > 11 ? year + 1: year %], [% month + 1 > 11 ? 0 : month + 1 %])">
&gt;
</a>
</th>
<th>
<a class="nav-arrow"
href="javascript:void(0)"
onclick="getCalendar([% year + 1 %], [% month %])">
&gt;&gt;
</a>
</th>
</tr>
</tbody>
</table>
<table summary="Monthly calendar with links to each day's posts">
<tbody>
<tr>
<th>Sun</th>
<th>Mon</th>
<th>Tue</th>
<th>Wed</th>
<th>Thu</th>
<th>Fri</th>
<th>Sat</th>
</tr>
[%- day = 1; %]
[%- WHILE day <= end_of_month %]
<tr>
[%- day_of_week = 0 %]
[%- WHILE day_of_week <= 6 %]
[%- today_mark = day == today ? 'class="today-cell"' : '' %]
[%- IF (day > end_of_month) || (day == 1 && day_of_week < first_day_of_week) -%]
<td>&nbsp;</td>
[%- ELSE -%]
<td id="day-[% year %]-[% month %]-[% day %]" [% today_mark %]>[% day %]</td>
[%- day = day + 1 %]
[%- END %]
[%- day_of_week = day_of_week + 1 %]
[%- END %]
[%- END %]
</tr>
</tbody>
</table>
</div>

View File

@ -0,0 +1,29 @@
[%- FOREACH comment IN comments -%]
<a name="post-[% comment.post %]:comment-[% comment.id %]" id="post-[% comment.post %]:comment-[% comment.id %]"></a>
<div class="comment" id="comment-95523406">
<div class="comment-content">
[%- IF comment.body %]
[%- comment.body.replace('&', '&amp;')
.replace('<', '&lt;')
.replace('>', '&gt;')
.replace('\n', '<br/>')
.replace(' ', '&nbsp; ')
.replace('(http://(?:\%[A-Fa-f0-9]{2}|[-A-Za-z./0-9~_])+)', '<a href="$1">$1</a>') %]
[%- END %]
</div>
<p class="comment-footer">
Posted by:
[% IF comment.url %]
[%- url = comment.url %]
[% IF NOT url.match('^\\w+://');
url = 'http://' _ url;
END -%]
<a href="[% url | html %]">[% comment.sender | html %]</a>
[% ELSE %]
[% comment.sender | html %] |
[% END %]
[% comment.created | html %]
</p>
</div>
[%- END %]

View File

@ -0,0 +1,24 @@
[%
SET prev_post = undef;
SET next_post = undef;
FOREACH post IN posts;
IF post.id < current;
prev_post = post;
ELSE;
next_post = post;
END;
END -%]
[% IF next_post %]
<a href="#post-[% next_post.id %]">
« [% next_post.title %]
</a>
[% END %]
|
<a href="#post-list"> Main </a>
|
[% IF prev_post %]
<a href="#post-[% prev_post.id %]">
[% prev_post.title %] »
</a>
[% END %]

View File

@ -0,0 +1,51 @@
[% DEFAULT
page = 1,
page_count = undef,
title = 'Pages',
prefix = 'post-list/',
suffix = ''
-%]
[% IF page_count <= 10;
from = 1;
to = page_count;
ELSE;
from = page - 10 >= 1 ? page - 10 : 1
to = page + 9 >= page_count ? page_count : page + 9;
END -%]
<center>
<table class="paging">
<tr>
<td>
[% title %]:&nbsp; &nbsp;
</td>
<td>
[%- IF page > 1 %]
<span class="prev-page">
<a href="#[% prefix _ (page - 1) _ suffix %]">Previous</a>
</span>
[%- END %]
</td>
[%- i = from; %]
[%- WHILE i <= to %]
[%- IF i == page %]
<td class="highlight">[% i %]</td>
[%- ELSE %]
<td><a href="#[% prefix _ i _ suffix %]">[% i %]</a></td>
[%- END %]
[%- i = i + 1 %]
[%- END %]
<td>
[%- IF page < page_count %]
<span class="next-page">
<a href="#[% prefix _ (page + 1) _ suffix %]">Next</a>
</span>
[%- END %]
</td>
</tr>
</table>
</center>
<br/>

View File

@ -0,0 +1,5 @@
<div id="post-list-nav" class="content-nav"></div>
[% FOREACH post IN post_list %]
[% PROCESS 'post.tt' %]
[% END %]

View File

@ -0,0 +1,55 @@
<p class="content-nav">
</p>
<!-- entry -->
[% PROCESS 'post.tt' -%]
<a id="post-[%post.id%]:comments" name="post-[%post.id%]-comments"></a>
<div class="comments">
<h3 class="comments-header">Comments</h3>
<div class="comments-content">
<!-- comment list -->
</div>
</div>
<!-- comment form -->
<form id="comment-form" onsubmit="return false;" method="post">
<div class="comments-open">
<input id="comment-for" type="hidden" value="[% post.id %]"></input>
<h2 class="comments-open-header">Post a comment</h2>
<div class="comments-open-content">
<div id="comments-open-data">
<p>
<label for="comment-author">Name:</label>
<input id="comment-author" name="author" size="30" class="required"/>
</p>
<p>
<label for="comment-email">Email Address: <span class="comment-form-note">(Not displayed with comment.)</span></label>
<input id="comment-email" name="email" size="30" class="required" />
</p>
<p>
<label for="comment-url">URL:</label>
<input id="comment-url" name="url" size="30" />
</p>
<p>
<label for="comment-bake-cookie"><input type="checkbox"
id="comment-bake-cookie" name="bakecookie" value="1" />
Remember personal info?</label>
</p>
</div>
<p id="comments-open-text">
<label for="comment-text">Comments:</label>
<textarea id="comment-text" name="text" rows="10" cols="30" class="required"></textarea>
</p>
</div>
<div id="comments-open-footer" class="comments-open-footer">
<!-- <button name="preview" id="comment-preview">&nbsp;Preview&nbsp;</button> -->
<button name="post" id="comment-post" onclick="postComment([% post.id %]);">&nbsp;Post&nbsp;</button>
</div>
</div>
</form>

View File

@ -0,0 +1,32 @@
<h2 class="date-header">[% post.created %]</h2>
<div class="entry">
<h3 class="entry-header">
<a href="#post-[% post.id %]">
[%- post.title -%]
</a>
</h3>
<div class="entry-content">
<div class="entry-body">
[%- post.content -%]
<p/>
</div>
</div>
<div class="entry-footer">
<p class="entry-footer-info">
<span class="post-footers">
Posted by [% post.author %] at
[% post.created %] in
<a href="#post-[% post.id %]">Articles</a>
</span>
<span class="separator">|</span>
<a class="permalink" href="#post-[% post.id %]">Permalink</a>
<span class="separator">|</span>
<a href="#post-[% post.id %]:comments">Comments
(<span class="comment-count" post="[% post.id %]">[% post.comments %]</span>)
</a>
</p>
<!-- technorati tags -->
<!-- post footer links -->
</div>
</div>

View File

@ -0,0 +1,30 @@
<ul class="module-list">
[% last_id %]
[% FOREACH comment IN comments -%]
<li class="module-list-item">
<a href="#post-[% comment.post %]:comment-[% comment.id %]">
[% comment.sender | html %]</a> on
<a href="#post-[% comment.post %]">[% comment.title | html %]</a>
</li>
[%- last_id = comment.id %]
[% END -%]
</ul>
<p class="module-more">
[% IF offset > 0 %]
<a href="javascript:getRecentComments([% offset - count %])">&lt;&lt</a>
[% END %]
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
[% IF last_id > 1 && comments.size == count %]
<a id="more-recent-comments" href="javascript:getRecentComments([% offset + count %]);">
Next...
</a>
[% END %]
</p>

View File

@ -0,0 +1,28 @@
<ul class="module-list">
[% last_id %]
[% FOREACH post IN posts -%]
<li class="module-list-item">
<a href="#post-[% post.id %]">[% post.title %]</a>
</li>
[%- last_id = post.id %]
[% END -%]
</ul>
<p class="module-more">
[% IF offset > 0 %]
<a href="javascript:getRecentPosts([% offset - count %])">&lt;&lt;</a>
[% END %]
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;
[% IF last_id > 1 && posts.size == count %]
<a id="more-recent-posts" href="javascript:getRecentPosts([% offset + count %]);">
Next...
</a>
[% END %]
</p>