diff options
author | 2015-02-22 01:28:54 +0100 | |
---|---|---|
committer | 2015-02-22 01:28:54 +0100 | |
commit | 35278c94afd68d99416398e4dff1a9a5499db8f4 (patch) | |
tree | 1b981a241b45d0360c7162498e646353c17d7722 /ag-web.rb | |
parent | generify captcha error message (diff) | |
download | frontend-35278c94afd68d99416398e4dff1a9a5499db8f4.tar.gz frontend-35278c94afd68d99416398e4dff1a9a5499db8f4.tar.bz2 frontend-35278c94afd68d99416398e4dff1a9a5499db8f4.zip |
show raw mesages if there are no threads
Diffstat (limited to 'ag-web.rb')
-rw-r--r-- | ag-web.rb | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -106,6 +106,11 @@ get '/:list/threads/:year-:month/:page?' do result = threads_in_month(params[:list], params[:year], params[:month], current_page) max_pages = (result['hits']['total'].to_f / PER_PAGE).ceil + if result['hits']['total'] == 0 + redirect to("/%s/messages/%s-%s?no_threads=1" % [params[:list], params[:year], params[:month]]) + return + end + erb :listmonth, locals: { results: result, list: params[:list], current_page: current_page, max_pages: max_pages, mode: :threads } rescue => e $stderr.puts e.to_s |