2013-09-29 20:18:21 +02:00
|
|
|
$def with (links, span, base, offset, limit, total, date_range)
|
|
|
|
|
|
|
|
$if date_range:
|
|
|
|
$for year in date_range.years:
|
|
|
|
$if not loop.first: <span class="sep"> | </span>
|
|
|
|
$if year == date_range.year: <b>
|
|
|
|
<a href="links/$year">$year</a>
|
|
|
|
$if year == date_range.year: </b>
|
|
|
|
<br/>
|
|
|
|
$if date_range.month is None: <b>
|
|
|
|
<a href="links/$date_range.year">Whole year</a>
|
|
|
|
$if date_range.month is None: </b>
|
|
|
|
$for i in range(1, len(date_range.months)):
|
|
|
|
<span class="sep"> | </span>
|
|
|
|
$if i == date_range.month: <b>
|
|
|
|
<a href="links/$date_range.year/$i">$date_range.months[i]</a>
|
|
|
|
$if i == date_range.month: </b>
|
|
|
|
<hr/>
|
2012-05-05 12:12:43 +02:00
|
|
|
|
|
|
|
$ last_date = None
|
|
|
|
|
|
|
|
$for link in links:
|
2012-06-04 10:45:58 +02:00
|
|
|
$ date = link.to_datestr()
|
2012-05-05 12:12:43 +02:00
|
|
|
$if date != last_date:
|
2013-09-28 20:57:44 +02:00
|
|
|
<h1 class="entry-title">
|
2012-07-04 11:33:35 +02:00
|
|
|
<a href="links/$link.to_date_link()">$date</a>
|
2013-09-28 20:57:44 +02:00
|
|
|
</h1>
|
2012-05-05 12:12:43 +02:00
|
|
|
$ last_date = date
|
|
|
|
|
2013-09-28 20:57:44 +02:00
|
|
|
<div class="entry-summary">
|
2012-05-05 12:12:43 +02:00
|
|
|
$if not link.URL:
|
2013-09-29 15:11:23 +02:00
|
|
|
<b>$link.title</b>
|
2012-05-05 12:12:43 +02:00
|
|
|
$else:
|
2012-05-06 11:19:51 +02:00
|
|
|
<a href="$link.URL">$:link.URL_description</a>
|
2012-05-05 12:12:43 +02:00
|
|
|
$:link.description
|
|
|
|
$if link.extended:
|
2013-09-28 20:57:44 +02:00
|
|
|
<a href="link/$link.linkID" class="more-link">more inside</a>
|
|
|
|
</div>
|
|
|
|
<div class="entry-meta">
|
2014-04-17 20:17:16 +02:00
|
|
|
posted $link.ago() ago
|
|
|
|
by <a href="user/$link.user.username">$link.user.username</a>
|
|
|
|
|
2013-09-28 20:57:44 +02:00
|
|
|
-
|
2014-04-18 22:32:01 +02:00
|
|
|
<a href="link/$link.linkID">$model.plural(link.comment_count, 'comment')</a>
|
2012-06-04 10:45:58 +02:00
|
|
|
</div>
|
2012-07-04 11:33:35 +02:00
|
|
|
|
2013-09-28 21:25:03 +02:00
|
|
|
$ at, pages = model.paginate(offset, total, limit)
|
|
|
|
$if pages:
|
2012-07-04 11:33:35 +02:00
|
|
|
Page
|
2013-09-28 21:25:03 +02:00
|
|
|
$for page in pages:
|
|
|
|
$if page == at: <b>
|
|
|
|
<a href="$base?offset=${(page-1)*limit}">$page</a>
|
|
|
|
$if page == at: </b>
|