Permalink
Browse files

make summary mode sticky, when clicking through prev/next day links.

  • Loading branch information...
1 parent 09eaa4f commit 9f7b43e167e27168277da09bc91a9f1f8abcb46d @prakashk prakashk committed Jan 21, 2013
Showing with 20 additions and 5 deletions.
  1. +6 −0 cgi/out.pl
  2. +14 −5 cgi/template/linkblock.tmpl
View
@@ -237,6 +237,9 @@ sub irclog_output {
# where the hell does the leading double slash come from?
$next_url =~ s{^//+}{/};
$t->param(NEXT_URL => $next_url);
+ if ($summary) {
+ $t->param(NEXT_DATE => $tomorrow);
+ }
}
my $yesterday = date($date) - 1;
@@ -246,6 +249,9 @@ sub irclog_output {
my $prev_url = $base_url . "$channel/$yesterday";
$prev_url =~ s{^//+}{/};
$t->param(PREV_URL => $prev_url);
+ if ($summary) {
+ $t->param(PREV_DATE => $yesterday);
+ }
}
}
@@ -1,12 +1,21 @@
- <p><TMPL_IF NAME=PREV_URL><a href="<TMPL_VAR NAME=PREV_URL>" rel="prev">&larr; Previous
- day</a> |</TMPL_IF>
+ <p><TMPL_IF NAME=PREV_URL>
+ <TMPL_IF NAME=IS_SUMMARY>
+ <a href="<TMPL_VAR NAME=BASE_URL>out.pl?channel=<TMPL_VAR NAME=CHANNEL>;date=<TMPL_VAR NAME=PREV_DATE>;summary=1" rel="prev">
+ <TMPL_ELSE>
+ <a href="<TMPL_VAR NAME=PREV_URL>" rel="prev">
+ </TMPL_IF>&larr; Previous day</a> |
+ </TMPL_IF>
<a href="<TMPL_VAR NAME=BASE_URL>">Channels</a> |
<a href="<TMPL_VAR NAME=BASE_URL><TMPL_VAR NAME=CHANNEL>/">#<TMPL_VAR
CHANNEL> index</a> |
- <a href="<TMPL_VAR NAME=BASE_URL><TMPL_VAR NAME=CHANNEL>/today">Today</a> |
+ <a href="<TMPL_VAR NAME=BASE_URL><TMPL_VAR NAME=CHANNEL>/today<TMPL_IF NAME=IS_SUMMARY>?summary=1</TMPL_IF>">Today</a> |
<TMPL_IF NAME=NEXT_URL>
- <a href="<TMPL_VAR NAME=NEXT_URL>" rel="next">Next day &rarr;</a> |
- </TMPL_IF>
+ <TMPL_IF NAME=IS_SUMMARY>
+ <a href="<TMPL_VAR NAME=BASE_URL>out.pl?channel=<TMPL_VAR NAME=CHANNEL>;date=<TMPL_VAR NAME=NEXT_DATE>;summary=1" rel="next">
+ <TMPL_ELSE>
+ <a href="<TMPL_VAR NAME=NEXT_URL>" rel="next">
+ </TMPL_IF>Next day &rarr;</a> |
+ </TMPL_IF>
<a href="<TMPL_VAR BASE_URL>search.pl?channel=<TMPL_VAR CHANNEL>">Search</a> |
<a href="http://www.google.com/search?q=site%3Airclog.perlgeek.de+inurl%3A<TMPL_VAR NAME=CHANNEL ESCAPE=URL>">Google Search</a>
<TMPL_IF NAME=DATE>| <a href="<TMPL_VAR

0 comments on commit 9f7b43e

Please sign in to comment.