aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--app/views/request/_request_listing_short_via_event.rhtml13
-rw-r--r--app/views/request/_sidebar.rhtml11
-rw-r--r--public/stylesheets/main.css24
4 files changed, 47 insertions, 3 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index c8a75ff63..ded9fc3d3 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -53,7 +53,7 @@ class RequestController < ApplicationController
# ... requests that have similar imporant terms
behavior_cache :tag => ['similar', @info_request.id] do
begin
- limit = 3
+ limit = 5
@xapian_similar = ::ActsAsXapian::Similar.new([InfoRequestEvent], @info_request.info_request_events,
:limit => limit, :collapse_by_prefix => 'request_collapse')
@xapian_similar_more = (@xapian_similar.matches_estimated > limit)
diff --git a/app/views/request/_request_listing_short_via_event.rhtml b/app/views/request/_request_listing_short_via_event.rhtml
new file mode 100644
index 000000000..7cc86a684
--- /dev/null
+++ b/app/views/request/_request_listing_short_via_event.rhtml
@@ -0,0 +1,13 @@
+<% if @highlight_words.nil?
+ @highlight_words = []
+end %>
+
+<div class="request_short_listing">
+ <h3><%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %></h3>
+ <p>
+ To <%= public_body_link_absolute(info_request.public_body) %>
+ by <%= user_link_absolute(info_request.user) %>,
+ <%= simple_date(info_request.created_at) %>
+ </p>
+</div>
+
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index e4bedb943..f31932151 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -29,7 +29,13 @@
<% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>
<h2>Similar requests</h2>
<% for result in @xapian_similar.results %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
+ <% for result in @xapian_similar.results %>
+ <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
+ <% for result in @xapian_similar.results %>
+ <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
<% if @xapian_similar_more %>
<p><%= link_to "More similar requests", request_similar_url(@info_request) %></p>
@@ -40,7 +46,8 @@
<p><%= link_to "Event history details", request_details_url(@info_request) %></p>
- <!-- this links is here for legal reasons, discuss with board and our lawyer before removing -->
+ <!-- this link with this wording is here for legal reasons, discuss with
+ board and our lawyer before changing or removing it -->
<p><small><a href="/help/about#commercial">Are you the owner of
any commercial copyright on this page?</a></small></p>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 3e452dfb1..d9ea1de5e 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -625,8 +625,32 @@ div#blog_sidebar img
.body_listing span.desc
{ background-image: none; float: left; clear: both; padding: 0px 0 0 42px;}
+/*--------------------------------- content : short lists */
+.request_short_listing
+{
+ margin-top: 1em;
+}
+.request_short_listing h3
+{
+ font-size: 1.2em;
+}
+.request_short_listing p
+{
+ font-size: 0.8em;
+ margin-top: -0.8em;
+ margin-bottom: 0;
+}
+
+
+.request_short_listing a
+{ text-decoration: none; }
+
+.request_short_listing
+{
+}
+
/*---------------- content : lists back/next */
div.pagination { text-align: center; padding-top: 0.3em;}