summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-05-25 13:31:07 +0200
committerMichał Górny <mgorny@gentoo.org>2018-05-25 13:32:41 +0200
commit1852a5892e2f4b0555f47118cd02500c0dd08071 (patch)
tree00ca72913d8e353948f0683246f2ba9af27cc1a8 /ag-web.rb
parentReplace redirect on no threads with inline display (diff)
downloadfrontend-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.rb9
1 files changed, 0 insertions, 9 deletions
diff --git a/ag-web.rb b/ag-web.rb
index 701a951..24111b3 100644
--- a/ag-web.rb
+++ b/ag-web.rb
@@ -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],