diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-05-25 13:31:07 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-05-25 13:32:41 +0200 |
commit | 1852a5892e2f4b0555f47118cd02500c0dd08071 (patch) | |
tree | 00ca72913d8e353948f0683246f2ba9af27cc1a8 /ag-web.rb | |
parent | Replace redirect on no threads with inline display (diff) | |
download | frontend-1852a5892e2f4b0555f47118cd02500c0dd08071.tar.gz frontend-1852a5892e2f4b0555f47118cd02500c0dd08071.tar.bz2 frontend-1852a5892e2f4b0555f47118cd02500c0dd08071.zip |
Remove the awful redirect on no messages in month
The redirect when no messages are found in month is awfully irritating,
given that it rewrites the whole URL. Furthermore, it logically can
only happen when someone types the URL manually which makes redirecting
really silly. Instead, just display the 'no messages' message along
with empty message list.
Implicitly, this also adds a message when someone goes beyond last page.
Currently, he seems only blank list.
Bug: https://bugs.gentoo.org/656386
Diffstat (limited to 'ag-web.rb')
-rw-r--r-- | ag-web.rb | 9 |
1 files changed, 0 insertions, 9 deletions
@@ -125,10 +125,6 @@ get '/:list/threads/:year-:month/:page?' do if result['hits']['total'] == 0 result = messages_in_month(params[:list], params[:year], params[:month], current_page) no_threads = true - if result['hits']['total'] == 0 - redirect '/%s/?no_messages=1' % params[:list] - return - end end max_pages = (result['hits']['total'].to_f / PER_PAGE).ceil @@ -163,11 +159,6 @@ get '/:list/messages/:year-:month/:page?' do result = messages_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 '/%s/?no_messages=1' % params[:list] - return - end - erb :listmonth, locals: { results: result, list: params[:list], |