aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_general/debug.rhtml2
-rw-r--r--app/views/admin_general/timeline.rhtml10
-rw-r--r--app/views/admin_public_body/_form.rhtml7
-rw-r--r--app/views/admin_public_body/edit.rhtml6
-rw-r--r--app/views/general/_topnav.rhtml4
-rw-r--r--app/views/general/exception_caught.rhtml4
-rw-r--r--app/views/general/frontpage.rhtml2
-rw-r--r--app/views/general/search.rhtml2
-rw-r--r--app/views/public_body/_search_ahead.rhtml1
-rw-r--r--app/views/request/_request_listing_via_event.rhtml23
-rw-r--r--app/views/request/select_authority.rhtml11
-rw-r--r--app/views/user/show.rhtml2
-rw-r--r--app/views/user/sign.rhtml13
13 files changed, 42 insertions, 45 deletions
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.rhtml
index 422edea03..b3b06085f 100644
--- a/app/views/admin_general/debug.rhtml
+++ b/app/views/admin_general/debug.rhtml
@@ -16,8 +16,6 @@ TMail::VERSION::STRING <%=h TMail::VERSION::STRING%>
Xapian::version_string <%=h Xapian::version_string%>
<br>
Spec::VERSION::STRING <%=h Spec::VERSION::STRING%>
-<br>
-Spec::Rails::VERSION::STRING <%=h Spec::Rails::VERSION::STRING%>
</p>
<h2>Configuration</h2>
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/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
index 1cdc9b3fe..d854b53f5 100644
--- a/app/views/admin_public_body/_form.rhtml
+++ b/app/views/admin_public_body/_form.rhtml
@@ -50,12 +50,13 @@
<h3>Common Fields</h3>
<p><label for="public_body_tag_string">Tags <small>(space separated; see list of tags on the right; also <strong>not_apply</strong> if FOI and EIR no longer apply to authority, <strong>eir_only</strong> if EIR but not FOI applies to authority, <strong>defunct</strong> if the authority no longer exists; charity:NUMBER if a registered charity)</small></label><br/>
-<%= f.text_field :tag_string, :size => 60 %></p>
+
+<%= text_field :public_body, :tag_string, :size => 60, :id => 'public_body_tag_string' %></p>
<p><label for="public_body_home_page">Home page <small>(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</small></label><br/>
-<%= f.text_field :home_page, :size => 60 %></p>
+<%= text_field :public_body, :home_page, :size => 60, :id => 'public_body_home_page' %></p>
<p><label for="public_body_last_edit_comment"><strong>Comment</strong> for this edit</label> <small>(put URL or other source of new info)</small><br/>
-<%= f.text_area :last_edit_comment, :rows => 3, :cols => 60 %></p>
+<%= text_area :public_body, :last_edit_comment, :rows => 3, :cols => 60, :id => 'public_body_last_edit_comment' %></p>
<!--[eoform:public_body]-->
diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml
index b91f15a2e..b19477a6b 100644
--- a/app/views/admin_public_body/edit.rhtml
+++ b/app/views/admin_public_body/edit.rhtml
@@ -9,9 +9,9 @@
<%= render :partial => 'tag_help' %>
<div id="public_body_form">
- <% form_for @public_body, :url => {:action => 'update'} do |f| %>
- <%= render :partial => 'form', :locals => {:f => f} %>
- <p><%= f.submit 'Save', :accesskey => 's' %></p>
+ <% form_tag '../update/' + @public_body.id.to_s do %>
+ <%= render :partial => 'form' %>
+ <p><%= submit_tag 'Save', :accesskey => 's' %></p>
<% end %>
<p>
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/exception_caught.rhtml b/app/views/general/exception_caught.rhtml
index b266b53a1..5f0dfe13d 100644
--- a/app/views/general/exception_caught.rhtml
+++ b/app/views/general/exception_caught.rhtml
@@ -19,6 +19,6 @@
<% end %>
<h2><%= _('Technical details') %></h2>
- <p><strong><%=@exception_class ? @exception_class : _("Unknown")%></strong></p>
- <p><strong><%=@exception_message %></strong></p>
+ <p><strong><%= h(@exception_class ? @exception_class : _("Unknown")) %></strong></p>
+ <p><strong><%= h(@exception_message) %></strong></p>
</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/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.rhtml
index 436471544..484d28256 100644
--- a/app/views/public_body/_search_ahead.rhtml
+++ b/app/views/public_body/_search_ahead.rhtml
@@ -13,6 +13,7 @@
<%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %>
<% end %>
</div>
+ <%= will_paginate WillPaginate::Collection.new(@page, 10, @xapian_requests.matches_estimated) %>
<% end %>
</p>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml
index e7c378cec..e247163a3 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.rhtml
@@ -4,7 +4,7 @@ end %>
<div class="request_listing">
<div class="request_left">
- <span class="head">
+ <span class="head">
<% if event.is_incoming_message? %>
<%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message) %>
<% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
@@ -14,9 +14,9 @@ end %>
<% else %>
<%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
<% end %>
- </span>
- <div class="requester">
- <% if event.event_type == 'sent' %>
+ </span>
+ <div class="requester">
+ <% if event.event_type == 'sent' %>
<%= _('Request sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:date=>simple_date(event.created_at )) %>
<% elsif event.event_type == 'followup_sent' %>
<%=event.display_status %>
@@ -27,19 +27,22 @@ end %>
<% elsif event.event_type == 'comment' %>
<%= _('Request to {{public_body_name}} by {{info_request_user}}. Annotated by {{event_comment_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>user_link_absolute(info_request.user),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at)) %>
<% else %>
- <% raise _("unknown event type indexed ") + event.event_type %>
+ <%# Events of other types will not be indexed: see InfoRequestEvent#indexed_by_search?
+ However, it can happen that we see other types of event transiently here in the period
+ between a change being made and the update-xapian-index job being run. %>
+ <!-- Event of type '<%= event.event_type %>', id=<%= event.id %> -->
<% end %>
- </div>
- <span class="bottomline icon_<%= info_request.calculate_status %>">
+ </div>
+ <span class="bottomline icon_<%= info_request.calculate_status %>">
<strong>
<%= info_request.display_status %>
</strong><br>
- </span>
+ </span>
</div>
<div class="request_right">
<span class="desc">
<%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
- </span>
- </div>
+ </span>
+ </div>
</div>
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml
index 55ebc40c4..0e8df872d 100644
--- a/app/views/request/select_authority.rhtml
+++ b/app/views/request/select_authority.rhtml
@@ -7,16 +7,17 @@
// http://benalman.com/projects/jquery-throttle-debounce-plugin/
$("#query").keypress($.debounce( 300, function() {
// Do a type ahead search and display results
- $("#typeahead_response").load("<%=search_ahead_bodies_url%>?q="+encodeURI(this.value), function() {
+ $("#typeahead_response").load("<%=search_ahead_bodies_url%>?query="+encodeURI(this.value), function() {
$("#authority_preview").hide(); // Hide the preview, since results have changed
});
}));
// 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();
+ $(window).scrollTop($("#banner").height());
$("#authority_preview #header_right").hide();
});
return false;
@@ -33,8 +34,8 @@
<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>
- (<a href="%s">why?</a>).') % help_about_url %>
+ like information from. <strong>By law, they have to respond</strong>
+ (<a href="%s#%s">why?</a>).') % [help_about_url, "whybother_them"] %>
</p>
<%= text_field_tag 'query', params[:query], { :size => 30 } %>
<%= hidden_field_tag 'bodies', 1 %>
@@ -56,6 +57,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..2d2394f5c 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_requests.matches_estimated.to_s) % @xapian_requests.matches_estimated %>
<!-- matches_estimated <%=@xapian_requests.matches_estimated%> -->
<%= @match_phrase %>
<%= @page_desc %>
diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml
index afdb90162..bfd0fa63e 100644
--- a/app/views/user/sign.rhtml
+++ b/app/views/user/sign.rhtml
@@ -1,4 +1,4 @@
-<% if @post_redirect.reason_params[:user_name] %>
+<% if !@post_redirect.nil? && @post_redirect.reason_params[:user_name] %>
<% @title = _("Sign in") %>
<div id="sign_alone">
@@ -19,16 +19,7 @@
<% else %>
<% @title = _('Sign in or make a new account') %>
- <div id="sign_together">
-
- <!--<p id="sign_in_reason">
- <% if @post_redirect.reason_params[:web].empty? %>
- <%= _(' Please sign in or make a new account.') %>
- <% else %>
- <%= @post_redirect.reason_params[:web] %>, <%= _('please sign in or make a new account.') %>
- <% end %>
- </p>-->
-
+ <div id="sign_together">
<div id="left_half">
<h1><%= _('Sign in') %></h1>
<%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %>