- Timestamp:
- 10/31/07 02:35:37 (6 years ago)
- Location:
- lang/perl/mobirc/trunk/mobirc
- Files:
-
- 5 modified
-
assets/tmpl/recent.html (modified) (1 diff)
-
config.yaml.sample (modified) (1 diff)
-
lib/Mobirc/ConfigLoader.pm (modified) (2 diffs)
-
lib/Mobirc/HTTPD/Controller.pm (modified) (2 diffs)
-
lib/Mobirc/HTTPD/Router.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/mobirc/trunk/mobirc/assets/tmpl/recent.html
r837 r935 1 1 [% INCLUDE 'include/header.html' %] 2 2 3 [% FOR canon_channel IN channel_name.keys.sort %] 4 [% IF channel_name.item(canon_channel) and channel_recent.item(canon_channel) and channel_recent.item(canon_channel).size %] 5 <div class="ChannelHeader"> 6 <b class="ChannelName">[% channel_name.item(canon_channel) | html %]</b> 7 <a href="[% docroot %]channels/[% channel_name.item(canon_channel) | uri%]">more..</a><br /> 8 </div> 3 [% FOR channel IN target_channels %] 4 <div class="ChannelHeader"> 5 <b class="ChannelName">[% channel_name.item(channel) | html %]</b> 6 <a href="[% docroot %]channels/[% channel_name.item(channel) | uri%]">more..</a><br /> 7 </div> 9 8 10 [% FOR line IN channel_recent.item(canon_channel) %]11 [% render_line( line ) %]<br />12 [% END %]9 [% FOR line IN channel_recent.item(channel) %] 10 [% render_line( line ) %]<br /> 11 [% END %] 13 12 14 <hr /> 15 [% END %] 13 <hr /> 16 14 [% END %] 17 15 <br /> 16 17 [% IF has_next_page %] 18 <a href="[% docroot %]recent?t=[% now %]">next</a> 19 [% END %] 20 21 <hr /> 22 18 23 <a accesskey="8" href="[% docroot %]">ch list[8]</a> 19 24 -
lang/perl/mobirc/trunk/mobirc/config.yaml.sample
r916 r935 22 22 cookie_expires: +3d 23 23 use_cookie: 1 24 # recent_log_per_page: 40 24 25 authorizer: 25 26 - module: Mobirc::HTTPD::Authorizer::Cookie -
lang/perl/mobirc/trunk/mobirc/lib/Mobirc/ConfigLoader.pm
r927 r935 60 60 root => { type => 'str', }, 61 61 echo => { type => 'bool', }, 62 au_pcsv => { type => 'bool', },62 recent_log_per_page => { type => 'int', }, 63 63 filter => { 64 64 type => 'seq', … … 133 133 $config->{httpd}->{content_type} ||= 'text/html; charset=Shift_JIS'; 134 134 $config->{httpd}->{echo} = true unless exists $config->{httpd}->{echo}; 135 $config->{httpd}->{recent_log_per_page} ||= 30; 135 136 $config->{global}->{assets_dir} ||= File::Spec->catfile( $FindBin::Bin, 'assets' ); 136 137 -
lang/perl/mobirc/trunk/mobirc/lib/Mobirc/HTTPD/Controller.pm
r928 r935 65 65 my ($class, $c) = @_; 66 66 67 my @target_channels; 68 my $log_counter = 0; 69 my $has_next_page = false; 70 71 my @unread_channels = 72 grep { @{ $c->{irc_heap}->{channel_recent}->{$_} || [] } } 73 keys %{ $c->{irc_heap}->{channel_recent} }; 74 75 DEBUG "SCALAR " . scalar @unread_channels; 76 77 for my $channel (@unread_channels) { 78 push @target_channels, $channel; 79 $log_counter += scalar @{ $c->{irc_heap}->{channel_recent}->{$channel} }; 80 81 if ($log_counter >= $c->{config}->{httpd}->{recent_log_per_page}) { 82 $has_next_page = true; 83 last; 84 } 85 } 86 67 87 my $out = render( 68 88 $c, 69 89 'recent' => { 90 target_channels => \@target_channels, 91 has_next_page => $has_next_page, 70 92 }, 71 93 ); 72 94 73 95 # reset counter. 74 for my $canon_channel ( sort keys %{ $c->{irc_heap}->{channel_name} }) {96 for my $canon_channel ( @target_channels ) { 75 97 $c->{irc_heap}->{unread_lines}->{$canon_channel} = 0; 76 98 $c->{irc_heap}->{channel_recent}->{$canon_channel} = []; … … 200 222 title => $c->{config}->{httpd}->{title}, 201 223 version => $Mobirc::VERSION, 224 now => time(), 202 225 203 226 %{ $c->{irc_heap} }, -
lang/perl/mobirc/trunk/mobirc/lib/Mobirc/HTTPD/Router.pm
r883 r935 17 17 return 'topics'; 18 18 } 19 elsif ( $uri eq '/recent') {19 elsif ( $uri =~ m{^/recent(?:\?t=\d+)?$} ) { 20 20 return 'recent'; 21 21 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)