aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-10-17 14:40:57 +1100
committerMatthew Landauer <matthew@openaustralia.org>2012-10-17 14:51:59 +1100
commitd21d9b9dd10a1379ecb686e339992d7790e4bd61 (patch)
treeb1713f0ddffdee8a7cc5ce7059b3d9b588b26dbe
parent871e2fda4fea4ada327031aaa30d2bbb5774956a (diff)
In number of requests shown on home page only include requests with normal prominence
-rw-r--r--app/models/info_request.rb2
-rw-r--r--app/views/general/frontpage.rhtml4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index d8c84fa9e..74a67b9d9 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -51,6 +51,8 @@ class InfoRequest < ActiveRecord::Base
has_tag_string
+ named_scope :visible, :conditions => {:prominence => "normal"}
+
# user described state (also update in info_request_event, admin_request/edit.rhtml)
validate :must_be_valid_state
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index e7e42bb73..7f25cdd14 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -15,7 +15,7 @@
<%= _("Search over<br/>
<strong>{{number_of_requests}} requests</strong> <span>and</span><br/>
<strong>{{number_of_authorities}} authorities</strong>",
- :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.visible.count) %>
+ :number_of_requests => InfoRequest.visible.count, :number_of_authorities => PublicBody.visible.count) %>
</h2>
<% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %>
<div>
@@ -59,7 +59,7 @@
<% end %>
</h3>
<%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
- :site_name => site_name, :number_of_requests => InfoRequest.count) %>
+ :site_name => site_name, :number_of_requests => InfoRequest.visible.count) %>
<ul>
<% for event in @request_events %>
<li>