diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin_general/timeline.rhtml | 10 | ||||
-rw-r--r-- | app/views/general/_topnav.rhtml | 4 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 2 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 2 | ||||
-rw-r--r-- | app/views/request/select_authority.rhtml | 6 | ||||
-rw-r--r-- | app/views/user/show.rhtml | 2 |
6 files changed, 14 insertions, 12 deletions
diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.rhtml index dc72e46cd..39a4b3e36 100644 --- a/app/views/admin_general/timeline.rhtml +++ b/app/views/admin_general/timeline.rhtml @@ -36,10 +36,9 @@ end %> <% elsif event.event_type == 'edit_outgoing' %> - <% outgoing_messages = OutgoingMessage.find(:all, event.params[:outgoing_message_id].to_i) %> + <% outgoing_message = OutgoingMessage.find(event.params[:outgoing_message_id].to_i) %> had outgoing message edited by administrator <strong><%=h event.params[:editor] %></strong>. - <% if outgoing_messages.size > 0 %> - <% outgoing_message = outgoing_messages[0] %> + <% if outgoing_message %> <% for p in ['body'] if event.params[p.to_sym] != event.params[('old_'+p).to_sym] %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <% @@ -50,10 +49,9 @@ Missing outgoing message, internal error. <% end %> <% elsif event.event_type == 'edit_comment' %> - <% comments = Comment.find(:all, event.params[:comment_id].to_i) %> + <% comment = Comment.find(event.params[:comment_id].to_i) %> had annotation edited by administrator <strong><%=h event.params[:editor] %></strong>. - <% if comments.size > 0 %> - <% comment = comments[0] %> + <% if comment %> <% for p in ['body'] if event.params[p.to_sym] != event.params[('old_'+p).to_sym] %> Changed <%=p%> from '<%=h event.params[('old_'+p).to_sym]%>' to '<%=h event.params[p.to_sym] %>'. <% diff --git a/app/views/general/_topnav.rhtml b/app/views/general/_topnav.rhtml index 619ff3593..8ef928bba 100644 --- a/app/views/general/_topnav.rhtml +++ b/app/views/general/_topnav.rhtml @@ -1,10 +1,10 @@ <div id="topnav"> <ul id="navigation"> - <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' %>"><%= link_to _("Home"), frontpage_url %></li> + <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' and params[:action] != 'search' %>"><%= link_to _("Home"), frontpage_url %></li> <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("Make a request"), select_authority_url, :id => 'make-request-link' %></li> <li class="<%= 'selected' if params[:controller] == 'request' and !['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("View requests"), request_list_successful_url %></li> <li class="<%= 'selected' if params[:controller] == 'public_body' %>"><%= link_to _("View authorities"), list_public_bodies_default %></li> <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_url %></li> <li class="<%= 'selected' if params[:controller] == 'help' %>"><%= link_to _("Help"), help_about_url %></li> </ul> -</div>
\ No newline at end of file +</div> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index 35751b6a4..da45a8c37 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -60,7 +60,7 @@ <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %> <%=link_to h(event.info_request.title), request_url(event.info_request)%> <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> - <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %></p> + <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p> </li> <% end %> </ul> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 87a6ab446..43aa9785a 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -187,6 +187,8 @@ <%= render :partial => 'user/user_listing_single', :locals => { :display_user => result[:model] } %> <% end %> </div> + <%= will_paginate WillPaginate::Collection.new(@page, @users_per_page, @xapian_users.matches_estimated) %> + <% end %> </div> diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml index 55ebc40c4..1e78168e9 100644 --- a/app/views/request/select_authority.rhtml +++ b/app/views/request/select_authority.rhtml @@ -14,7 +14,7 @@ })); // We're using the existing body list: we intercept the clicks on the titles to // display a preview on the right hand side of the screen - $("#typeahead_response a").live('click', function() { + $("#typeahead_response .head a").live('click', function() { $("#authority_preview").load(this.href+" #public_body_show", function() { $("#authority_preview").show(); $("#authority_preview #header_right").hide(); @@ -33,7 +33,7 @@ <p> <p> <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d - <br>like information from. <strong>By law, they have to respond</strong> + like information from. <strong>By law, they have to respond</strong> (<a href="%s">why?</a>).') % help_about_url %> </p> <%= text_field_tag 'query', params[:query], { :size => 30 } %> @@ -56,6 +56,8 @@ <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> <% end %> </div> + <%= will_paginate WillPaginate::Collection.new(@page, 10, @xapian_requests.matches_estimated) %> + <% end %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 9ac203541..9845f6b89 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -147,7 +147,7 @@ <% end %> <% else %> <h2 class="foi_results" id="foi_requests"> - <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size %> + <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_bodies.matches_estimated.to_s) % @xapian_bodies.matches_estimated %> <!-- matches_estimated <%=@xapian_requests.matches_estimated%> --> <%= @match_phrase %> <%= @page_desc %> |