From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D348C138A87 for ; Sun, 22 Feb 2015 00:29:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AF552E0872; Sun, 22 Feb 2015 00:29:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5FA07E0872 for ; Sun, 22 Feb 2015 00:29:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4DBEF340AF6 for ; Sun, 22 Feb 2015 00:29:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C43011245A for ; Sun, 22 Feb 2015 00:29:11 +0000 (UTC) From: "Alex Legler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Alex Legler" Message-ID: <1424564934.35278c94afd68d99416398e4dff1a9a5499db8f4.a3li@gentoo> Subject: [gentoo-commits] proj/ag-web:master commit in: views/, / X-VCS-Repository: proj/ag-web X-VCS-Files: ag-web.rb views/listmonth.erb X-VCS-Directories: views/ / X-VCS-Committer: a3li X-VCS-Committer-Name: Alex Legler X-VCS-Revision: 35278c94afd68d99416398e4dff1a9a5499db8f4 X-VCS-Branch: master Date: Sun, 22 Feb 2015 00:29:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ee9e2a97-fd00-4dbd-a754-da342c521e87 X-Archives-Hash: e8aeda894792f32efa4309f6878098d4 commit: 35278c94afd68d99416398e4dff1a9a5499db8f4 Author: Alex Legler a3li li> AuthorDate: Sun Feb 22 00:28:54 2015 +0000 Commit: Alex Legler gentoo org> CommitDate: Sun Feb 22 00:28:54 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/ag-web.git;a=commit;h=35278c94 show raw mesages if there are no threads --- ag-web.rb | 5 +++++ views/listmonth.erb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ag-web.rb b/ag-web.rb index b178b71..182d269 100644 --- a/ag-web.rb +++ b/ag-web.rb @@ -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 diff --git a/views/listmonth.erb b/views/listmonth.erb index 4cdabe3..a986eb8 100644 --- a/views/listmonth.erb +++ b/views/listmonth.erb @@ -6,6 +6,12 @@ <%= partial :views, locals: { list: list, mode: mode } %> +<% if params[:no_threads] %> +
+ There were no threads that started this month, showing you all messages instead. +
+<% end %> +
Subject