Permalink
Browse files

show checked boxes for summary lines from DB

  • Loading branch information...
1 parent 86a4081 commit b5b119f54eed1827a5264b461058e4263e904246 @moritz committed Aug 15, 2011
Showing with 7 additions and 4 deletions.
  1. +5 −3 cgi/out.pl
  2. +1 −1 cgi/template/line.tmpl
  3. +1 −0 lib/IrcLog/WWW.pm
View
@@ -122,7 +122,7 @@
max_size => 150 * 1048576,
} );
# my $data = $cache->get($cache_key);
- my $date;
+ my $data;
if (defined $data){
print $data;
} else {
@@ -153,8 +153,8 @@ sub irclog_output {
}
$t->param(BASE_URL => $base_url);
my $self_url = $base_url . "/$channel/$date";
- my $db = $dbh->prepare('SELECT id, nick, timestamp, line FROM irclog '
- . 'WHERE day = ? AND channel = ? AND NOT spam ORDER BY id');
+ my $db = $dbh->prepare('SELECT id, nick, timestamp, line, in_summary FROM '
+ . 'irclog WHERE day = ? AND channel = ? AND NOT spam ORDER BY id');
$db->execute($date, $full_channel);
@@ -188,6 +188,7 @@ sub irclog_output {
my $nick = decode('utf8', ($row[1]));
my $timestamp = $row[2];
my $message = $row[3];
+ my $in_summary = $row[4];
next if $message =~ m/^\s*\[off\]/i;
push @msg, message_line( {
@@ -200,6 +201,7 @@ sub irclog_output {
colors => \@colors,
self_url => $self_url,
channel => $channel,
+ in_summary => $in_summary,
},
\$c,
);
@@ -5,7 +5,7 @@
</TMPL_IF>
<td class="time" id="i_<TMPL_VAR ID>"><a href="<TMPL_VAR BASE_URL><TMPL_VAR CHANNEL>/<TMPL_VAR DATE>#i_<TMPL_VAR ID>"><TMPL_VAR TIME></a></td>
<td class="summary"><input type="checkbox" name="in_summary_<TMPL_VAR
- LINE_NUMBER>" value="<TMPL_VAR IN_SUMMARY>" /></td>
+ ID>" <TMPL_IF IN_SUMMARY>checked="checked"</TMPL_IF> /></td>
<td class="nick<TMPL_IF NICK_CLASS> <TMPL_VAR NICK_CLASS></TMPL_IF>"><TMPL_VAR NICK></td>
<td class="msg<TMPL_IF MSG_CLASS> <TMPL_VAR MSG_CLASS></TMPL_IF> <TMPL_VAR NAME=SEARCH_FOUND DEFAULT=''>"><TMPL_VAR NAME=MESSAGE ESCAPE=0></td>
</tr>
View
@@ -497,6 +497,7 @@ sub message_line {
$args_ref->{nick},
),
LINE_NUMBER => ++$args_ref->{line_number},
+ IN_SUMMARY => $args_ref->{in_summary},
);
$h{DATE} = $args_ref->{date} if $args_ref->{date};
$h{SEARCH_FOUND} = 'search_found' if ($args_ref->{search_found});

0 comments on commit b5b119f

Please sign in to comment.