diff options
Diffstat (limited to 'app/views/user/show.rhtml')
-rw-r--r-- | app/views/user/show.rhtml | 88 |
1 files changed, 52 insertions, 36 deletions
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index c3a99311a..baf6621df 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -24,20 +24,20 @@ </div> <% end %> - -<div id="request_sidebar"> - <h2><%= _('Track this person')%></h2> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> - - <h2><%= _('On this page')%></h2> - <a href="#foi_requests"><%= _('FOI requests')%></a> - <br><a href="#annotations"><%= _('Annotations')%></a> - <% if @is_you %> - <br><a href="#email_subscriptions"><%= _('Email subscriptions')%></a> - <% end %> -</div> - -<div class="single_user"> +<div id="user_profile_header"> + <div id="header_right"> + <h2><%= _('Track this person')%></h2> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + + <h2><%= _('On this page')%></h2> + <a href="#foi_requests"><%= _('FOI requests')%></a> + <br><a href="#annotations"><%= _('Annotations')%></a> + <% if @is_you %> + <br><a href="#email_subscriptions"><%= _('Email subscriptions')%></a> + <% end %> + </div> + + <div class="header_left"> <p id="user_photo_on_profile"> <% if @display_user.profile_photo %> <% if @is_you %> @@ -110,25 +110,42 @@ <% if not @is_you %> <p id="user_not_logged_in"> - <%= link_to _('Sign in'), signin_url(:r => request.request_uri) %> <%= _('to change password, - subscriptions and more')%> (<%=h @display_user.name %> <%= _('only')%>) + <%= _('<a href="%s">Sign in</a> to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]%> </p> <% end %> + </div> +</div> +<div style="clear:both"></div> + +<div id="user_profile_search"> + <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %> + <div> + <%= text_field_tag(:user_query, params[:user_query]) %> + <% if @is_you %> + <%= submit_tag(_("Search your contributions")) %> + <% else %> + <%= submit_tag(_("Search contributions by this person")) %> + <% end %> + </div> + <% end %> + <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.empty? %> <% if @page == 1 %> - <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? 'you' : 'this person' %> </h2> - <p><%= @is_you ? _('You have') : _('This person has') %> - <%= _(' made no Freedom of Information requests using this site.')%></p> + <h2 class="foi_results" id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %> +</h2> + <p><%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %> + <%= @page_desc %> <% end %> <% else %> - <h2 id="foi_requests"> - <%= @is_you ? 'Your ' : "This person's " %> - <%=pluralize(@display_user.info_requests.size, _('Freedom of Information request')) %> + <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 %> <!-- matches_estimated <%=@xapian_requests.matches_estimated%> --> - <%= @page_desc %> + <%= @match_phrase %> + <%= @page_desc %> </h2> + <% for result in @xapian_requests.results %> <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> @@ -137,21 +154,22 @@ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %> <% end %> <% else %> - <h2 id="foi_requests"><%= _('Freedom of Information requests made by')%> <%= @is_you ? _('you') : _('this person') %> </h2> + <h2 class="foi_results" id="foi_requests"><%= @is_you ? _('Freedom of Information requests made by you') : _('Freedom of Information requests made by this person') %> </h2> <p><%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests this person has made.')%></p> <% end %> <% if !@xapian_comments.nil? %> <% if @xapian_comments.results.empty? %> <% if @page == 1 %> - <h2><%= @is_you ? 'Your' : 'This person\'s' %> <%= _('annotations')%> </h2> - <p>None made.</p> + <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %> + <%= @match_phrase %> + </h2> + <p><%= _('None made.')%></p> <% end %> <% else %> <h2 id="annotations"> - <%= @is_you ? _('Your ') : _('This person\'s') %> - <%=pluralize(@display_user.visible_comments.size, _('annotation')) %> - <!-- matches_estimated <%=@xapian_comments.matches_estimated%> --> + <%= @is_you ? n_('Your %d annotation', 'Your %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size : n_('This person\'s %d annotation', 'This person\'s %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size %> + <!-- matches_estimated <%=@xapian_comments.matches_estimated%> --> <%= @page_desc %> </h2> @@ -166,11 +184,11 @@ <% if @is_you %> <% if @track_things.empty? %> <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2> - <p>None made.</p> + <p><%= _('None made.')%></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' do %> + <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %> <h3> <%=TrackThing.track_type_description(@track_things[0].track_type)%> <%= hidden_field_tag 'track_type', @track_things[0].track_type %> @@ -184,7 +202,7 @@ <% end %> <% for track_type, track_things in @track_things_grouped %> <% if @track_things_grouped.size > 1 %> - <% form_tag :controller => 'track', :action => 'delete_all_type' do %> + <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %> <h3> <%=TrackThing.track_type_description(track_type)%> <%= hidden_field_tag 'track_type', track_type %> @@ -200,7 +218,7 @@ <ul> <% for track_thing in track_things %> <li> - <% form_tag :controller => 'track', :action => 'update', :track_id => track_thing.id do %> + <% form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %> <div> <%= track_thing.params[:list_description] %> <%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %> @@ -214,6 +232,4 @@ <% end %> <% end %> <% end %> - -</div> - +</div>
\ No newline at end of file |