aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/default.rhtml1
-rw-r--r--app/views/public_body/show.rhtml2
-rw-r--r--app/views/request/_sidebar.rhtml2
-rw-r--r--app/views/request/_wall_listing.rhtml30
-rw-r--r--app/views/track/_tracking_links.rhtml19
-rw-r--r--app/views/user/_change_receive_email.rhtml16
-rw-r--r--app/views/user/show.rhtml7
-rw-r--r--app/views/user/wall.rhtml16
8 files changed, 79 insertions, 14 deletions
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index e60e7bef2..bc9dfb02d 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -104,6 +104,7 @@
<% if @user %>
<%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %>
<%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %>
+ <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %>
<% end %>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml
index 5f20a9717..63bd5f7fc 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.rhtml
@@ -4,7 +4,7 @@
<h2><%= _('Follow this authority')%></h2>
<% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
- <p><%= n_("There is %d person following this authority", "There are %d people following this authority", follower_count) % follower_count %></p>
+ <p><%= n_("<span id='follow_count'>%d</span> person is following this authority", "<span id='follow_count'>%d</span> people are following this authority", follower_count) % follower_count %></p>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
<h2><%= _('More about this authority')%></h2>
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
index c0708a36a..bca142fa9 100644
--- a/app/views/request/_sidebar.rhtml
+++ b/app/views/request/_sidebar.rhtml
@@ -1,9 +1,11 @@
<div id="right_column">
+ <div id="follow_box">
<h2><%= _('Follow this request') %></h2>
<% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>
<p><%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %></p>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>
+ </div>
<% if @info_request.described_state != "attention_requested" %>
<h2><%= _('Offensive? Unsuitable?') %></h2>
<% if @info_request.attention_requested %>
diff --git a/app/views/request/_wall_listing.rhtml b/app/views/request/_wall_listing.rhtml
new file mode 100644
index 000000000..9cde234c0
--- /dev/null
+++ b/app/views/request/_wall_listing.rhtml
@@ -0,0 +1,30 @@
+<% if @highlight_words.nil?
+ @highlight_words = []
+end %>
+
+<div class="request_listing">
+ <div class="request_left">
+ <div class="requester">
+ <% if event.event_type == 'sent' %>
+ <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was 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),:request_url=>request_url(info_request),:request_title=>info_request.title) %>
+ <% elsif event.event_type == 'followup_sent' %>
+ <%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was 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),:request_url=>outgoing_message_url(event.outgoing_message),:request_title=>info_request.title) %>
+ <% elsif event.event_type == 'response' %>
+ <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',: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),:request_url=>incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
+ <% elsif event.event_type == 'comment' %>
+ <%= _('An <a href="{{request_url}}">annotation</a> to <em>{{request_title}}</em> was made 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),:request_url=>comment_url(event.comment),:request_title=>info_request.title) %>
+ <% else %>
+ <%# 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>
+ </div>
+ <div class="request_right">
+ <span class="desc">
+ <%= highlight_and_excerpt(event.search_text_main(true), @highlight_words, 150) %>
+ </span>
+ </div>
+</div>
+
diff --git a/app/views/track/_tracking_links.rhtml b/app/views/track/_tracking_links.rhtml
index f50a8bbbf..39f346eff 100644
--- a/app/views/track/_tracking_links.rhtml
+++ b/app/views/track/_tracking_links.rhtml
@@ -7,18 +7,17 @@
<% if own_request %>
<p><%= _('This is your own request, so you will be automatically emailed when new responses arrive.')%></p>
<% elsif existing_track %>
- <% form_tag({:controller => 'track', :action => 'update', :track_id => existing_track.id}, :class => "feed_form feed_form_" + location) do %>
- <p>
- <%= track_thing.params[:verb_on_page_already] %>
- <%= hidden_field_tag 'track_medium', "delete" %>
- <%= hidden_field_tag 'r', request.request_uri %>
- <%= submit_tag "unsubscribe" %>
- </p>
- <% end %>
+ <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.request_uri}, :class => "link_button_green" %>
+ </div>
<% elsif track_thing %>
<div class="feed_link feed_link_<%=location%>">
- <%= link_to '<img src="/images/email-16.png" alt="">', do_track_url(track_thing) %>
- <%= link_to _("Follow by email"), do_track_url(track_thing) %>
+ <% if defined? follower_count && follower_count > 0 %>
+ <%= link_to _("I like this request"), do_track_url(track_thing), :class => "link_button_green" %>
+ <% else %>
+ <%= link_to _("Follow"), do_track_url(track_thing), :class => "link_button_green" %>
+ <% end %>
</div>
<div class="feed_link feed_link_<%=location%>">
diff --git a/app/views/user/_change_receive_email.rhtml b/app/views/user/_change_receive_email.rhtml
new file mode 100644
index 000000000..83e5d8601
--- /dev/null
+++ b/app/views/user/_change_receive_email.rhtml
@@ -0,0 +1,16 @@
+<% form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %>
+ <div>
+ <% if @user.receive_email_alerts %>
+ <%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %><br><br>
+ <%= hidden_field_tag 'receive_email_alerts', 'false' %>
+ <%= hidden_field_tag 'came_from', request.url %>
+ <%= submit_tag _("Turn off email alerts") %>
+ <% else %>
+ <%= _('Items matching the following conditions are currently displayed on your wall.') %><br><br>
+ <%= hidden_field_tag 'receive_email_alerts', 'true' %>
+ <%= hidden_field_tag 'came_from', request.url %>
+ <%= submit_tag _("Also send me alerts by email") %>
+ <% end %>
+ </div>
+<% end %>
+
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index f8b820f03..d723196d3 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -192,11 +192,12 @@
</div>
<% end %>
<% if @show_profile && @is_you %>
+ <h2 id="email_subscriptions"> <%= _("Things you're following")%></h2>
+ <%= render :partial => 'change_receive_email' %>
+ <br>
<% if @track_things.empty? %>
- <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2>
- <p><%= _('None made.')%></p>
+ <p><%= _("You're not following anything.")%></p>
<% else %>
- <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2>
<% if @track_things_grouped.size == 1 %>
<% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>
<h3>
diff --git a/app/views/user/wall.rhtml b/app/views/user/wall.rhtml
new file mode 100644
index 000000000..190cc0a6d
--- /dev/null
+++ b/app/views/user/wall.rhtml
@@ -0,0 +1,16 @@
+<% @title = h(@display_user.name) + _(" - wall") %>
+<% if @is_you %>
+<div class="medium_column">
+ <p><%= _('You can change the requests and users you are following on <a href="{{profile_url}}">your profile page</a>.', :profile_url => show_user_profile_path) %>
+ <%= render :partial => 'change_receive_email' %>
+</div>
+<% end %>
+<div id="user_profile_search">
+ <% if !@feed_results.nil? %>
+ <% for result in @feed_results %>
+ <%= render :partial => 'request/wall_listing', :locals => { :event => result, :info_request => result.info_request } %>
+ <% end %>
+ <% end %>
+
+
+</div>