diff --git a/README.md b/README.md index 94b8df9..a0dc7e8 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ tests locally: ## TODOs -1. Hide ancient posts (test this, dev DB is broken fuck) -1. Put a link to search_page somewhere +1. Winter/Christmas/New Years background +1. Make CAPTCHA preserve search query 1. "All new posts flagged" mode (require approval for new posts) 1. Tests for mod-only user? diff --git a/assets/css/elements.css b/assets/css/elements.css index 03a3813..2a2d37b 100644 --- a/assets/css/elements.css +++ b/assets/css/elements.css @@ -32,7 +32,7 @@ body { /* background-image: url('/images/topwwbackground.gif'); */ /* Spooky time! */ background-image: url('/images/halloween_background_1.gif'); - /* Christmas */ + /* Christmas/New Years-ish? */ /* background-image: url('/images/windowstars.gif'); */ width: 95vmin; margin: 0 auto; diff --git a/lib/PostText/Model/Thread.pm b/lib/PostText/Model/Thread.pm index 01ec23b..f380650 100644 --- a/lib/PostText/Model/Thread.pm +++ b/lib/PostText/Model/Thread.pm @@ -53,6 +53,7 @@ sub by_page($self, $this_page = 1) { sub last_page($self) { my $thread_count = $self->count; my $last_page = int($thread_count / $self->per_page); + my $max_pages = $self->max_pages; # Add a page for 'remainder' posts $last_page++ if $thread_count % $self->per_page; diff --git a/templates/thread/by_page.html.ep b/templates/thread/by_page.html.ep index 844fec5..5212c8b 100644 --- a/templates/thread/by_page.html.ep +++ b/templates/thread/by_page.html.ep @@ -12,6 +12,22 @@

<%= title %>

<% if (scalar @{$threads}) { =%>
+ <%= form_for search_page => (class => 'form-body'), begin %> +
+ <% if (my $error = validation->error('q')) { =%> +

Must be between <%= $error->[2] %> + and <%= $error->[3] %> characters.

+ <% } =%> + <%= label_for search => 'Search' %> + <%= text_field q => ( + id => 'search', + maxlength => 2047, + minlength => 1, + required => undef + ) %> +
+ + <% end %> <% for my $thread (@{$threads}) { =%>