aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2012-09-29 10:04:09 +1000
committerMatthew Landauer <matthew@openaustralia.org>2012-09-29 10:04:09 +1000
commit287c7f3944fb35ba939a74da368d6b8f973454aa (patch)
treea92a5495766978af8698f10be9b920e4d7f94864
parentfe1ddf9c737bb9051d8ccab2af6b81f607fe877d (diff)
When the list of requests on the frontpage is being filled out with not just successful
requests make the text and the link reflect that
-rw-r--r--app/controllers/general_controller.rb3
-rw-r--r--app/views/general/frontpage.rhtml16
2 files changed, 17 insertions, 2 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 5a7b006a0..dc8e03d7a 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -55,10 +55,13 @@ class GeneralController < ApplicationController
# If there are not yet enough successful requests, fill out the list with
# other requests
if @request_events.count < max_count
+ @request_events_all_successful = false
query = 'variety:sent'
xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count-@request_events.count)
more_events = xapian_object.results.map { |r| r[:model] }
@request_events += more_events
+ else
+ @request_events_all_successful = true
end
rescue
@request_events = []
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml
index 8b078836e..e2d74a5e2 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.rhtml
@@ -51,7 +51,13 @@
<% end %>
<div id="examples_1">
- <h3><%= _("What information has been released?") %></h3>
+ <h3>
+ <% if @request_events_all_successful %>
+ <%= _("What information has been released?") %>
+ <% else %>
+ <%= _("What information has been requested?") %>
+ <% end %>
+ </h3>
<%= _("{{site_name}} users have made {{number_of_requests}} requests, including:",
:site_name => site_name, :number_of_requests => InfoRequest.count) %>
<ul>
@@ -64,7 +70,13 @@
</li>
<% end %>
</ul>
- <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p>
+ <p><strong>
+ <% if @request_events_all_successful %>
+ <%=link_to _('More successful requests...'), request_list_successful_url %>
+ <% else %>
+ <%=link_to _('More requests...'), request_list_all_url %>
+ <% end %>
+ </strong></p>
</div>
</div>