aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_general/index.html.erb99
-rw-r--r--app/views/admin_public_body/edit.html.erb2
-rw-r--r--app/views/comment/_comment_form.html.erb2
-rw-r--r--app/views/comment/_single_comment.html.erb2
-rw-r--r--app/views/general/_responsive_topnav.html.erb13
-rw-r--r--app/views/help/unhappy.html.erb5
-rw-r--r--app/views/layouts/default.html.erb2
-rw-r--r--app/views/public_body/show.html.erb93
-rw-r--r--app/views/public_body_change_requests/new.html.erb2
-rw-r--r--app/views/request/_act.html.erb5
-rw-r--r--app/views/request/_followup.html.erb2
-rw-r--r--app/views/request/_incoming_correspondence.html.erb2
-rw-r--r--app/views/request/_outgoing_correspondence.html.erb2
-rw-r--r--app/views/request/_request_listing_via_event.html.erb4
-rw-r--r--app/views/request/_request_search_form.html.erb44
-rw-r--r--app/views/request/_resent_outgoing_correspondence.html.erb2
-rw-r--r--app/views/request/new.html.erb4
-rw-r--r--app/views/request/new_bad_contact.html.erb2
-rw-r--r--app/views/request/select_authorities.html.erb2
-rw-r--r--app/views/request/show.html.erb4
-rw-r--r--app/views/request_game/play.html.erb7
-rw-r--r--app/views/track/_tracking_links.html.erb34
-rw-r--r--app/views/user/_user_listing_single.html.erb2
-rw-r--r--app/views/user/set_crop_profile_photo.html.erb2
-rw-r--r--app/views/user/show.html.erb4
-rw-r--r--app/views/widgets/new.html.erb15
-rw-r--r--app/views/widgets/show.html.erb48
27 files changed, 254 insertions, 151 deletions
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb
index ba0563bb6..8840bce74 100644
--- a/app/views/admin_general/index.html.erb
+++ b/app/views/admin_general/index.html.erb
@@ -2,17 +2,10 @@
<div class="row">
<div class="span12">
- <h1><%=@title%></h1>
-
- <ul>
- <li><%=@public_body_count%> public authorities</li>
- <li>
- <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
- <%=@incoming_message_count%> incoming messages
- </li>
- <li><%=@user_count%> users, <%=@track_thing_count%> tracked things</li>
- <li><%=@comment_count%> annotations</li>
- </ul>
+ <h1><%= @title %></h1>
+ <p>
+ <%= link_to 'Summary stats have moved →', admin_stats_path %>
+ </p>
</div>
</div>
@@ -28,8 +21,14 @@
<% if @holding_pen_messages.size > 0 %>
<div class="accordion-group">
<div class="accordion-heading">
- <a class="accordion-toggle" href="#holding-pen" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@holding_pen_messages.size%></span><%= chevron_right %> Put misdelivered responses with the right request</a>
+ <a class="accordion-toggle" href="#holding-pen" data-toggle="collapse" data-parent="things-to-do">
+ <span class="label label-important">
+ <%= @holding_pen_messages.size %>
+ </span>
+ <%= chevron_right %> Put misdelivered responses with the right request
+ </a>
</div>
+
<div id="holding-pen" class="accordion-body collapse">
<table class="table table-striped table-condensed">
<tbody>
@@ -39,11 +38,13 @@
<% if message.get_body_for_quoting.strip.size == 0 %>
<%= link_to "(no body)", admin_raw_email_path(message.raw_email_id) %>
<% else %>
- <%= link_to excerpt(message.get_body_for_quoting, "", :radius => 60), admin_raw_email_path(message.raw_email_id) %>
+ <%= link_to admin_raw_email_path(message.raw_email_id) do %>
+ <%= excerpt(message.get_body_for_quoting, "", :radius => 60) %>
+ <% end %>
<% end %>
</td>
<td class="span2">
- <%=simple_date(message.sent_at)%>
+ <%= simple_date(message.sent_at) %>
</td>
</tr>
<% end %>
@@ -67,7 +68,7 @@
<%= request_both_links(@request) %>
</td>
<td class="span2">
- <%=simple_date(@request.info_request_events.last.created_at)%>
+ <%= simple_date(@request.last_event_time) %>
</td>
</tr>
<% end %>
@@ -92,7 +93,7 @@
<%= request_both_links(@request) %>
</td>
<td class="span2">
- <%=simple_date(@request.info_request_events.last.created_at)%>
+ <%= simple_date(@request.last_event_time) %>
</td>
</tr>
<% end %>
@@ -116,7 +117,7 @@
<%= request_both_links(@request) %>
</td>
<td class="span2">
- <%=simple_date(@request.info_request_events.last.created_at)%>
+ <%= simple_date(@request.last_event_time) %>
</td>
</tr>
<% end %>
@@ -178,18 +179,33 @@
<% if @new_body_requests.size > 0 %>
<div class="accordion-group">
<div class="accordion-heading">
- <a class="accordion-toggle" href="#new-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @new_body_requests.size %></span><%= chevron_right %> Add new authorities</a>
+ <a class="accordion-toggle" href="#new-authorities" data-toggle="collapse" data-parent="things-to-do">
+ <span class="label label-important">
+ <%= @new_body_requests.size %>
+ </span>
+ <%= chevron_right %> Add new authorities
+ </a>
</div>
+
<div id="new-authorities" class="accordion-body collapse">
- <% for @change_request in @new_body_requests %>
- <%= render :partial => 'change_request_summary'%>
- <%= form_tag admin_change_request_path(@change_request), :method => 'put', :class => "form form-horizontal" do %>
- <%= submit_tag 'Close', :class => "btn btn-danger" %>
- <%= link_to("Close and respond", edit_admin_change_request_path(@change_request), :class => 'btn') %>
- <%= link_to("Add authority", new_admin_body_path(:change_request_id => @change_request.id), :class => 'btn btn-primary') %>
- <% end %>
+ <% for @change_request in @new_body_requests %>
+ <%= render :partial => 'change_request_summary'%>
- <% end %>
+ <%= form_tag admin_change_request_path(@change_request),
+ :method => 'put',
+ :class => "form form-horizontal" do %>
+
+ <%= submit_tag 'Close', :class => "btn btn-danger" %>
+
+ <%= link_to "Close and respond",
+ edit_admin_change_request_path(@change_request),
+ :class => 'btn' %>
+
+ <%= link_to "Add authority",
+ new_admin_body_path(:change_request_id => @change_request.id),
+ :class => 'btn btn-primary' %>
+ <% end %>
+ <% end %>
</div>
</div>
<% end %>
@@ -197,17 +213,34 @@
<% if @body_update_requests.size > 0 %>
<div class="accordion-group">
<div class="accordion-heading">
- <a class="accordion-toggle" href="#update-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @body_update_requests.size %></span><%= chevron_right %> Update authorities</a>
+ <a class="accordion-toggle" href="#update-authorities" data-toggle="collapse" data-parent="things-to-do">
+ <span class="label label-important">
+ <%= @body_update_requests.size %>
+ </span>
+ <%= chevron_right %> Update authorities
+ </a>
</div>
+
<div id="update-authorities" class="accordion-body collapse">
<% for @change_request in @body_update_requests %>
- <%= render :partial => 'change_request_summary' %>
- <%= form_tag admin_change_request_path(@change_request), :class => "form form-horizontal", :method => 'put' do %>
- <%= submit_tag 'Close', :class => "btn btn-danger" %>
- <%= link_to("Close and respond", edit_admin_change_request_path(@change_request), :class => 'btn') %>
- <%= link_to("Make update", edit_admin_body_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %>
- <% end %>
+ <%= render :partial => 'change_request_summary' %>
+
+ <%= form_tag admin_change_request_path(@change_request),
+ :class => "form form-horizontal",
+ :method => 'put' do %>
+
+ <%= submit_tag 'Close', :class => "btn btn-danger" %>
+
+ <%= link_to "Close and respond",
+ edit_admin_change_request_path(@change_request),
+ :class => 'btn' %>
+
+ <%= link_to "Make update",
+ edit_admin_body_path(@change_request.public_body,
+ :change_request_id => @change_request.id),
+ :class => 'btn btn-primary' %>
<% end %>
+ <% end %>
</div>
</div>
<% end %>
diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb
index dcafbd270..fc9c25e8f 100644
--- a/app/views/admin_public_body/edit.html.erb
+++ b/app/views/admin_public_body/edit.html.erb
@@ -13,7 +13,7 @@
<div class="row">
<div class="span8">
<div class="well">
- <%= link_to 'Show', admin_bodies_path(@public_body), :class => "btn" %>
+ <%= link_to 'Show', admin_body_path(@public_body), :class => "btn" %>
<%= link_to 'List all', admin_bodies_path, :class => "btn" %>
</div>
</div>
diff --git a/app/views/comment/_comment_form.html.erb b/app/views/comment/_comment_form.html.erb
index 6ca3f4c9f..0a6712af5 100644
--- a/app/views/comment/_comment_form.html.erb
+++ b/app/views/comment/_comment_form.html.erb
@@ -5,7 +5,7 @@
<% if !TrackThing.find_existing(@user, track_thing) && (!@user || @info_request.user != @user) %>
<p>
- <%= check_box_tag 'subscribe_to_request', "1", params[:subscribe_to_request] ? true : false %> <label for="subscribe_to_request"><%= _('Email me future updates to this request') %></label>
+ <%= check_box_tag 'subscribe_to_request', "1", params[:subscribe_to_request] %> <label for="subscribe_to_request"><%= _('Email me future updates to this request') %></label>
</p>
<% end %>
diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb
index 07017dabf..badc39d9a 100644
--- a/app/views/comment/_single_comment.html.erb
+++ b/app/views/comment/_single_comment.html.erb
@@ -1,4 +1,4 @@
-<div class="comment_in_request" id="comment-<%=comment.id.to_s%>">
+<div class="comment_in_request box" id="comment-<%=comment.id.to_s%>">
<% if comment.user && comment.user.profile_photo && !@render_to_file %>
<div class="user_photo_on_comment">
<img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt="">
diff --git a/app/views/general/_responsive_topnav.html.erb b/app/views/general/_responsive_topnav.html.erb
index 0af6629c8..c99864cab 100644
--- a/app/views/general/_responsive_topnav.html.erb
+++ b/app/views/general/_responsive_topnav.html.erb
@@ -21,11 +21,16 @@
</li>
<li id="navigation_search">
- <form id="navigation_search_form" method="get" action="<%= search_redirect_path %>">
- <label for="navigation_search_button">
- <img src="/assets/search.png" alt="Search:">
+ <form id="navigation_search_form" method="get" action="<%= search_redirect_path %>" role="search">
+ <label class="visually-hidden" for="navigation_search_button">
+ <%= _("Search") %>
</label>
- <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :title => "type your search term here" } %>
+ <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :type => "search", :placeholder => _("Search"), :title => _("type your search term here") } %>
+ <button type="submit">
+ <span class="visually-hidden">
+ <%= _("Submit Search") %>
+ </span>
+ </button>
</form>
</li>
</ul>
diff --git a/app/views/help/unhappy.html.erb b/app/views/help/unhappy.html.erb
index 79e3f8273..c0444fb54 100644
--- a/app/views/help/unhappy.html.erb
+++ b/app/views/help/unhappy.html.erb
@@ -101,9 +101,8 @@ contact any registered user from their page. There may be an Internet
forum or group that they hang out in. If it is a local matter, use <a
href="http://www.groupsnearyou.com">GroupsNearYou</a> to find such a
forum.</li>
-<li><strong>Start a pledge</strong> on <a href="http://www.pledgebank.com">PledgeBank</a> to get
-others to act together with you. For example, you could arrange a meeting with
-staff from the authority. Or you could form a small local campaigns group.
+<li>You could form a small local campaign group and arrange a meeting
+with staff from the authority.</li>
</ul>
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index 56e6b3362..39f3241c6 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -23,7 +23,7 @@
<% if @profile_photo_javascript %>
<%= javascript_include_tag "profile-photos" %>
- <%= stylesheet_link_tag "jquery.Jcrop.css" %>
+ <%= stylesheet_link_tag "jquery.Jcrop.min.css" %>
<% end %>
<% if is_admin? %>
<%= javascript_include_tag "bootstrap-dropdown" %>
diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb
index 016c2460d..546db681e 100644
--- a/app/views/public_body/show.html.erb
+++ b/app/views/public_body/show.html.erb
@@ -11,43 +11,45 @@
<% end %>
<div class="authority__header">
- <h1><%=h(@public_body.name)%></h1>
+ <h1><%= h(@public_body.name) %></h1>
<p class="authority__header__subtitle">
- <%= type_of_authority(@public_body) %><% if not @public_body.short_name.empty? %>,
- <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name))%><% end %>
- <% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to _("admin"), admin_body_path(@public_body) %>)
+ <%= type_of_authority(@public_body) %><% unless @public_body.short_name.empty? %>,
+ <%= _('also called {{public_body_short_name}}', :public_body_short_name => h(@public_body.short_name)) %>
+ <% end %>
+
+ <% if @user && @user.admin_page_links? %>
+ (<%= link_to _("admin"), admin_body_path(@public_body) %>)
<% end %>
</p>
<% if @public_body.has_notes? || @public_body.eir_only? || @public_body.special_not_requestable_reason? %>
- <div id="stepwise_make_request">
- <% if @public_body.has_notes? %>
- <p class="authority__header__notes">
- <%= @public_body.notes_as_html.html_safe %>
- </p>
- <% end %>
+ <div id="stepwise_make_request">
+ <% if @public_body.has_notes? %>
+ <p class="authority__header__notes">
+ <%= @public_body.notes_as_html.html_safe %>
+ </p>
+ <% end %>
- <% if @public_body.is_requestable? %>
- <% if @public_body.eir_only? %>
+ <% if @public_body.is_requestable? %>
+ <% if @public_body.eir_only? %>
+ <p class="authority__header__notes">
+ <%= _('You can only request information about the environment from this authority.')%>
+ </p>
+ <% end %>
+ <% elsif @public_body.special_not_requestable_reason? %>
<p class="authority__header__notes">
- <%= _('You can only request information about the environment from this authority.')%>
+ <%= public_body_not_requestable_reasons(@public_body).first %>
</p>
<% end %>
- <% elsif @public_body.special_not_requestable_reason? %>
- <p class="authority__header__notes">
- <%= public_body_not_requestable_reasons(@public_body).first %>
- </p>
- <% end %>
- </div>
+ </div>
<% end %>
- <% if @public_body.info_requests.size > 0 %>
+ <% if @number_of_visible_requests > 0 %>
<div class="authority__header__stats">
<%= n_('{{count}} request',
'{{count}} requests',
- @public_body.info_requests.size,
- :count => @public_body.info_requests.size) %>
+ @number_of_visible_requests,
+ :count => @number_of_visible_requests) %>
</div>
<% end %>
@@ -55,25 +57,25 @@
<div class="action-bar__make-request">
<% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
<%= link_to _("Make a request to this authority"), new_request_to_body_path(:url_name => @public_body.url_name), :class => "link_button_green" %>
- <% end %>
+ <% end %>
</div>
+
<div class="action-bar__follow">
- <% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
- <div class="action-bar__follow-button">
- <% if @existing_track %>
- <%= (link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green") %>
- <% else %>
- <div class="feed_link">
- <%= link_to _("Follow"), do_track_path(@track_thing), :class => "link_button_green" %>
- </div>
- <% end %>
- </div>
+ <div class="action-bar__follow-button">
+ <% if @existing_track %>
+ <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green" %>
+ <% else %>
+ <div class="feed_link">
+ <%= link_to _("Follow"), do_track_path(@track_thing), :class => "link_button_green" %>
+ </div>
+ <% end %>
+ </div>
<div class="action-bar__follower-count">
<%= n_("{{count}} follower",
"{{count}} followers",
- follower_count,
- :count => content_tag(:span, follower_count, :id => "follow_count")) %>
+ @follower_count,
+ :count => content_tag(:span, @follower_count, :id => "follow_count")) %>
</div>
</div>
</div>
@@ -81,7 +83,7 @@
<div class="authority__body">
<div class="authority__body__foi-results">
- <% if @public_body.info_requests.size == 0 %>
+ <% if @number_of_visible_requests.zero? %>
<% if @public_body.is_requestable? or @public_body.not_requestable_reason != 'defunct' %>
<% if @public_body.eir_only? %>
<h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
@@ -99,14 +101,13 @@
<% end %>
<a name="results"></a>
- <% if @public_body.info_requests.size > 4 %>
+ <% if @number_of_visible_requests > 4 %>
<%= render :partial => 'request/request_filter_form' %>
<% end %>
<% end %>
- <% if !@xapian_requests.nil? %>
-
- <% for result in @xapian_requests.results %>
+ <% if @xapian_requests %>
+ <% @xapian_requests.results.each do |result| %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %>
<% end %>
@@ -132,11 +133,17 @@
</div>
<div class="authority__body__sidebar">
- <% if @public_body.info_requests.size > 4 %>
+ <% if @number_of_visible_requests > 4 %>
<%= render :partial => 'request/request_search_form' %>
<% end %>
+
<%= render :partial => 'more_info', :locals => { :public_body => @public_body } %>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
+
+ <%= render :partial => 'track/tracking_links',
+ :locals => { :track_thing => @track_thing,
+ :existing_track => @existing_track,
+ :own_request => false,
+ :location => 'sidebar' } %>
</div>
</div>
diff --git a/app/views/public_body_change_requests/new.html.erb b/app/views/public_body_change_requests/new.html.erb
index b52d583be..9abe03732 100644
--- a/app/views/public_body_change_requests/new.html.erb
+++ b/app/views/public_body_change_requests/new.html.erb
@@ -12,7 +12,7 @@
<p>
<label class="form_label" for="user_email">
- <%= ("Your email:") %>
+ <%= _("Your email:") %>
</label>
<%= f.text_field :user_email %>
</p>
diff --git a/app/views/request/_act.html.erb b/app/views/request/_act.html.erb
index 878cdf4ff..c7bbd287f 100644
--- a/app/views/request/_act.html.erb
+++ b/app/views/request/_act.html.erb
@@ -20,3 +20,8 @@
<% end %>
<%= link_to _("Start your own blog"), "http://wordpress.com/"%>
</div>
+<% if AlaveteliConfiguration::enable_widgets %>
+ <div class="act_link">
+ <%= link_to _("Create a widget for this request"), new_request_widget_path(@info_request) %>
+ </div>
+<% end %>
diff --git a/app/views/request/_followup.html.erb b/app/views/request/_followup.html.erb
index 2643b767f..24cede824 100644
--- a/app/views/request/_followup.html.erb
+++ b/app/views/request/_followup.html.erb
@@ -20,7 +20,7 @@
</h2>
<% end %>
<% if @info_request.who_can_followup_to(incoming_message).count > 0 %>
-<div id="other_recipients">
+<div id="other_recipients" class="box">
<%= _("Don't want to address your message to {{person_or_body}}? You can also write to:", :person_or_body => name_for_followup) %>
<ul>
<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %>
diff --git a/app/views/request/_incoming_correspondence.html.erb b/app/views/request/_incoming_correspondence.html.erb
index 70bd25c7f..9d205204e 100644
--- a/app/views/request/_incoming_correspondence.html.erb
+++ b/app/views/request/_incoming_correspondence.html.erb
@@ -1,4 +1,4 @@
-<div class="incoming correspondence <%= incoming_message.prominence %>" id="incoming-<%=incoming_message.id.to_s%>">
+<div class="incoming correspondence box <%= incoming_message.prominence %>" id="incoming-<%=incoming_message.id.to_s%>">
<%- if not incoming_message.user_can_view?(@user) %>
<%= render :partial => 'request/hidden_correspondence', :locals => { :message => incoming_message }%>
<%- else %>
diff --git a/app/views/request/_outgoing_correspondence.html.erb b/app/views/request/_outgoing_correspondence.html.erb
index dced5c94c..3b85cae7f 100644
--- a/app/views/request/_outgoing_correspondence.html.erb
+++ b/app/views/request/_outgoing_correspondence.html.erb
@@ -1,4 +1,4 @@
-<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+<div class="outgoing correspondence box" id="outgoing-<%=outgoing_message.id.to_s%>">
<%- if not outgoing_message.user_can_view?(@user) %>
<%= render :partial => 'request/hidden_correspondence', :locals => { :message => outgoing_message }%>
<%- else %>
diff --git a/app/views/request/_request_listing_via_event.html.erb b/app/views/request/_request_listing_via_event.html.erb
index 20bc5b2c8..7ad568829 100644
--- a/app/views/request/_request_listing_via_event.html.erb
+++ b/app/views/request/_request_listing_via_event.html.erb
@@ -6,8 +6,8 @@ end %>
<div class="request_left">
<span class="head">
<% if event.is_incoming_message? %>
- <%= link_to highlight_words(event.info_request.title, @highlight_words), incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")) %>
- <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
+ <%= link_to highlight_words(event.info_request.title, @highlight_words), incoming_message_path(event.incoming_message) %>
+ <% elsif event.is_outgoing_message? && event.event_type == 'followup_sent' %>
<%= link_to highlight_words(event.info_request.title, @highlight_words), outgoing_message_path(event.outgoing_message) %>
<% elsif event.is_comment? %>
<%= link_to highlight_words(event.info_request.title, @highlight_words), comment_path(event.comment) %>
diff --git a/app/views/request/_request_search_form.html.erb b/app/views/request/_request_search_form.html.erb
index 3f2f66950..795070337 100644
--- a/app/views/request/_request_search_form.html.erb
+++ b/app/views/request/_request_search_form.html.erb
@@ -2,34 +2,22 @@
<div id="list-filter">
<%= form_tag(request.path, :method => "get", :id=>"filter_requests_form") do %>
- <div class="list-filter-item">
- <%= label_tag(:query, _("Keywords"), :class=>"form_label title") %>
- <%= text_field_tag(:query, params[:query]) %>
- </div>
-<% if false # don't think we want this, but leaving as an example %>
- <div class="list-filter-item">
- <%= _("Search for words in:") %> <br/>
- <% [["sent", _("messages from users")],
- ["response", _("messages from authorities")],
- ["comment", _("comments")]].each_with_index do |item, index|
- variety, title = item %>
-
- <%= check_box_tag "request_variety[]", variety, params[:request_variety].nil? ? true : params[:request_variety].include?(variety), :id => "request_variety_#{index}" %>
- <%= label_tag("request_variety_#{index}", title) %> <br/>
- <% end %>
- </div>
-<% end %>
- <div class="list-filter-item">
- <%= label_tag(:query, _("Made between"), :class=>"form_label title") %>
- <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>&nbsp;&nbsp;
- <%= label_tag(:query, _("and"), :class=>"form_label") %>
- <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
- </div>
+ <div class="list-filter-item">
+ <%= label_tag(:query, _("Keywords"), :class=>"form_label title") %>
+ <%= text_field_tag(:query, params[:query]) %>
+ </div>
+
+ <div class="list-filter-item">
+ <%= label_tag(:query, _("Made between"), :class=>"form_label title") %>
+ <%= text_field_tag(:request_date_after, params[:request_date_after], {:class => "use-datepicker", :size => 10}) %>&nbsp;&nbsp;
+ <%= label_tag(:query, _("and"), :class=>"form_label") %>
+ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
+ </div>
- <%= after_form_fields if defined?(after_form_fields) -%>
+ <%= after_form_fields if defined?(after_form_fields) -%>
- <div class="list-filter-item">
- <%= submit_tag(_("Search")) %>
- </div>
-<% end %>
+ <div class="list-filter-item">
+ <%= submit_tag(_("Search")) %>
+ </div>
+ <% end %>
</div>
diff --git a/app/views/request/_resent_outgoing_correspondence.html.erb b/app/views/request/_resent_outgoing_correspondence.html.erb
index 17b6b635b..287a5cac5 100644
--- a/app/views/request/_resent_outgoing_correspondence.html.erb
+++ b/app/views/request/_resent_outgoing_correspondence.html.erb
@@ -1,4 +1,4 @@
-<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+<div class="outgoing correspondence box" id="outgoing-<%=outgoing_message.id.to_s%>">
<h2>
<%= simple_date(info_request_event.created_at) %>
</h2>
diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb
index 486a89d45..23f7ad76a 100644
--- a/app/views/request/new.html.erb
+++ b/app/views/request/new.html.erb
@@ -144,7 +144,7 @@
<% if @info_request.public_body.info_requests.size > 0 %>
<%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %>
<% else %>
- <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_successful_url) %>
<% end %>
</p>
<% end %>
@@ -156,7 +156,7 @@
this website <a href="{{url}}">forever</a>', :url => (help_privacy_path+"#public_request").html_safe)) %>.
</p>
<p>
- <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>.', :url => (help_privacy_path+"#real_name").html_safe)) %>
+ <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>', :url => (help_privacy_path+"#real_name").html_safe)) %>
</p>
<% else %>
<p>
diff --git a/app/views/request/new_bad_contact.html.erb b/app/views/request/new_bad_contact.html.erb
index 56f3f4168..f9881b62b 100644
--- a/app/views/request/new_bad_contact.html.erb
+++ b/app/views/request/new_bad_contact.html.erb
@@ -5,6 +5,6 @@
<p><%= _('Unfortunately, we do not have a working {{info_request_law_used_full}}
address for', :info_request_law_used_full => @info_request.law_used_full) %> <%=h @info_request.public_body.name %>. <%= _('You may be able to find
one on their website, or by phoning them up and asking. If you manage
-to find one, then please <a href="{{help_url}}">send it to us</a>.', :help_url => help_contact_path) %>
+to find one, then please <a href="{{help_url}}">send it to us</a>.', :help_url => new_change_request_path(:body => @info_request.public_body.url_name)) %>
</p>
diff --git a/app/views/request/select_authorities.html.erb b/app/views/request/select_authorities.html.erb
index cfbc21a28..861fc6068 100644
--- a/app/views/request/select_authorities.html.erb
+++ b/app/views/request/select_authorities.html.erb
@@ -74,4 +74,4 @@
</div>
</div>
</div>
-<%= javascript_include_tag 'jquery_ujs.js', 'select-authorities.js' %>
+<%= javascript_include_tag 'select-authorities.js' %>
diff --git a/app/views/request/show.html.erb b/app/views/request/show.html.erb
index 78e022aa9..5862413de 100644
--- a/app/views/request/show.html.erb
+++ b/app/views/request/show.html.erb
@@ -22,7 +22,7 @@
<% if ( @update_status || @info_request.awaiting_description ) && ! @info_request.is_external? %>
- <div class="describe_state_form" id="describe_state_form_1">
+ <div class="describe_state_form box" id="describe_state_form_1">
<%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %>
</div>
<% end %>
@@ -146,7 +146,7 @@
<% end %>
<% if @info_request.awaiting_description && ! @info_request.is_external? %>
- <div class="describe_state_form" id="describe_state_form_2">
+ <div class="describe_state_form box" id="describe_state_form_2">
<%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %>
</div>
<% end %>
diff --git a/app/views/request_game/play.html.erb b/app/views/request_game/play.html.erb
index 471a0e09e..44fe641f9 100644
--- a/app/views/request_game/play.html.erb
+++ b/app/views/request_game/play.html.erb
@@ -2,7 +2,12 @@
<div id="game_sidebar">
<p style="text-align: center">
- <img width=250 height=125 src="http://chart.apis.google.com/chart?chs=250x125&cht=gom&chd=t:<%=@percentage%>" alt="<%=@percentage%>% of requests have been categorised">
+ <%=
+ image_tag "https://chart.googleapis.com/chart?chs=250x125&cht=gom&chd=t:#{@percentage}",
+ :size => "250x125",
+ :alt => "A chart showing #{@percentage}% of requests have been categorised",
+ :title => "#{@percentage}% of requests have been categorised"
+ %>
<br><%=pluralize(@missing, 'request')%> left to categorise / <%=@total %> total
</p>
diff --git a/app/views/track/_tracking_links.html.erb b/app/views/track/_tracking_links.html.erb
index c027e9732..d94d3be13 100644
--- a/app/views/track/_tracking_links.html.erb
+++ b/app/views/track/_tracking_links.html.erb
@@ -1,25 +1,23 @@
<%
- if @user
- existing_track = TrackThing.find_existing(@user, track_thing)
- end
+ existing_track = local_assigns.fetch(:existing_track) do
+ TrackThing.find_existing(@user, track_thing) if @user
+ end
%>
<% if own_request %>
- <p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
+ <p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
<% elsif existing_track %>
- <p><%= track_thing.params[:verb_on_page_already] %></p>
- <div class="feed_link feed_link_<%=location%>">
- <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green" %>
- </div>
+ <p><%= track_thing.params[:verb_on_page_already] %></p>
+
+ <div class="feed_link feed_link_<%= location %>">
+ <%= link_to _("Unsubscribe"), { :controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.fullpath }, :class => "link_button_green" %>
+ </div>
<% elsif track_thing %>
- <div class="feed_link feed_link_<%=location%>">
- <% if defined?(follower_count) && follower_count > 0 %>
- <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
- <% else %>
- <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
- <% end %>
- </div>
+ <div class="feed_link feed_link_<%= location %>">
+ <% if defined?(follower_count) && follower_count > 0 %>
+ <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
+ <% else %>
+ <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
+ <% end %>
+ </div>
<% end %>
-
-
-
diff --git a/app/views/user/_user_listing_single.html.erb b/app/views/user/_user_listing_single.html.erb
index 3cb0d283f..03ac7347b 100644
--- a/app/views/user/_user_listing_single.html.erb
+++ b/app/views/user/_user_listing_single.html.erb
@@ -17,7 +17,7 @@ end %>
<span class="bottomline">
<%= pluralize(display_user.info_requests.size, "request") %> <%= _('made.')%>
- <%= pluralize(display_user.visible_comments.size, "annotation") %> <%= _('made.')%>
+ <%= pluralize(display_user.comments.visible.size, "annotation") %> <%= _('made.')%>
<%= _('Joined in')%> <%= display_user.created_at.year %>.
</span>
diff --git a/app/views/user/set_crop_profile_photo.html.erb b/app/views/user/set_crop_profile_photo.html.erb
index 0a22d36dc..7aa8f61a4 100644
--- a/app/views/user/set_crop_profile_photo.html.erb
+++ b/app/views/user/set_crop_profile_photo.html.erb
@@ -18,7 +18,7 @@
</td>
<td>
<div style="width:96px;height:96px;overflow:hidden;">
- <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>" id="profile_photo_preview" />
+ <img src="<%= get_draft_profile_photo_url(:id => @draft_profile_photo.id) %>" id="profile_photo_preview" class="jcrop-preview" />
</div>
</td>
diff --git a/app/views/user/show.html.erb b/app/views/user/show.html.erb
index 78b513d6a..a67663389 100644
--- a/app/views/user/show.html.erb
+++ b/app/views/user/show.html.erb
@@ -173,7 +173,7 @@
<% end %>
<% else %>
<h2 id="annotations">
- <%= @is_you ? n_('Your {{count}} annotation', 'Your {{count}} annotations', @display_user.visible_comments.size, :count => @display_user.visible_comments.size) : n_("This person's {{count}} annotation", "This person's {{count}} annotations", @display_user.visible_comments.size, :count => @display_user.visible_comments.size) %>
+ <%= @is_you ? n_('Your {{count}} annotation', 'Your {{count}} annotations', @display_user.comments.visible.size, :count => @display_user.comments.visible.size) : n_("This person's {{count}} annotation", "This person's {{count}} annotations", @display_user.comments.visible.size, :count => @display_user.comments.visible.size) %>
<!-- matches_estimated <%=@xapian_comments.matches_estimated%> -->
<%= @page_desc %>
</h2>
@@ -182,7 +182,7 @@
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model] } %>
<% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.visible_comments.size) %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.comments.visible.size) %>
<% end %>
<% end %>
diff --git a/app/views/widgets/new.html.erb b/app/views/widgets/new.html.erb
new file mode 100644
index 000000000..c706155a5
--- /dev/null
+++ b/app/views/widgets/new.html.erb
@@ -0,0 +1,15 @@
+<h1>Add a widget</h1>
+
+<p>
+To add a widget for <b><%= @info_request.title %></b>, copy and paste the
+following code to your web page:
+<textarea autofocus readonly rows='4' cols='60' id='widgetbox'>
+<iframe src='<%= request_widget_url(@info_request) %>' width='320' height='215' frameborder='0' marginwidth='0' marginheight='0'></iframe>
+</textarea>
+</p>
+
+<p>
+The widget will look like this:
+<br>
+<iframe src='<%= request_widget_url(@info_request) %>' width='320' height='215' frameborder='0' marginwidth='0' marginheight='0'></iframe>
+</p>
diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb
new file mode 100644
index 000000000..07c7b1908
--- /dev/null
+++ b/app/views/widgets/show.html.erb
@@ -0,0 +1,48 @@
+<head>
+ <%= stylesheet_link_tag "widget" %>
+</head>
+<body>
+ <div class="alaveteli-widget">
+ <div class="alaveteli-widget__top">
+ <div class="alaveteli-widget__left">
+ <div class="alaveteli-widget__title">
+ <%= link_to @info_request.title, request_path(@info_request), :target => "_top" %>
+ </div>
+ <div class="alaveteli-widget__status <%= @status %>">
+ <p class="alaveteli-widget__status__status-label">Status</p>
+ <%= status_description(@info_request, @status) %>
+ </div>
+ </div>
+ <div class="alaveteli-widget__people-count">
+ <%= n_('<div class="alaveteli-widget__count">{{count}}</div> person wants to know', '<div class="alaveteli-widget__count">{{count}}</div> people want to know', @count, :count => @count) %>
+ </div>
+ </div>
+
+
+ <div class="alaveteli-widget__bottom">
+ <% if @info_request.user && @info_request.user == @user %>
+ <div class="alaveteli-widget__button alaveteli-widget__button--down">
+ <%= _('This is your request') %>
+ </div>
+ <% elsif @existing_track %>
+ <a href="<%= url_for :controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath %>">
+ <div class="alaveteli-widget__button--down">
+ <%= _('You are tracking this request') %>
+ </div>
+ </a>
+ <% else %>
+ <% if @user %>
+ <a href="<%= url_for do_track_path(@track_thing) %>" target="_blank">
+ <div class="alaveteli-widget__button">
+ <%= _('I also want to know!') %>
+ </div>
+ </a>
+ <% else %>
+ <%= form_tag request_widget_url(@info_request), :method => 'put', :target => '_blank' do %>
+ <%= submit_tag _('I also want to know!'), :class => 'alaveteli-widget__button' %>
+ <% end %>
+ <% end %>
+ <% end %>
+ </div>
+ </div>
+</body>