diff options
Diffstat (limited to 'app/views')
23 files changed, 302 insertions, 278 deletions
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.rhtml index 422edea03..40fe33616 100644 --- a/app/views/admin_general/debug.rhtml +++ b/app/views/admin_general/debug.rhtml @@ -7,6 +7,10 @@ <h2>Version numbers</h2> <p> +Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %> +<br> +Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %> +<br> RUBY_VERSION <%=h RUBY_VERSION %> <br> Rails::VERSION::STRING <%=h Rails::VERSION::STRING%> @@ -16,8 +20,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/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.rhtml index ecd2c38b7..d5717de23 100644 --- a/app/views/admin_public_body/import_csv.rhtml +++ b/app/views/admin_public_body/import_csv.rhtml @@ -31,7 +31,7 @@ <p><strong>CSV file format:</strong> A first row with the list of fields, starting with '#', is optional but highly recommended. The fields 'name' - and 'request_email' are required; additionaly, translated values are supported by + and 'request_email' are required; additionally, translated values are supported by adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example: </p> diff --git a/app/views/admin_public_body/new.rhtml b/app/views/admin_public_body/new.rhtml index b859fdf6a..047d5a5bb 100644 --- a/app/views/admin_public_body/new.rhtml +++ b/app/views/admin_public_body/new.rhtml @@ -11,9 +11,9 @@ <%= render :partial => 'tag_help' %> <div id="public_body_form"> - <% form_for :public_body, @public_body, :url => {:action => "create"} do |f| %> - <%= render :partial => 'form', :locals => {:f => f} %> - <p><%= f.submit "Create" %></p> + <% form_tag './create/' + @public_body.id.to_s do %> + <%= render :partial => 'form' %> + <p><%= submit_tag "Create" %></p> <% end %> <p> diff --git a/app/views/admin_user/_form.rhtml b/app/views/admin_user/_form.rhtml index ba2bd8f8b..be69d9a80 100644 --- a/app/views/admin_user/_form.rhtml +++ b/app/views/admin_user/_form.rhtml @@ -8,10 +8,10 @@ <p><label for="admin_user_email">Email</label> (<strong>you must</strong> first validate this)<br/> <%= text_field 'admin_user', 'email', :size => 60 %></p> -<p><label for="admin_level">Admin level</label> (<strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper)<br/> +<p><label for="admin_user_admin_level">Admin level</label> (<strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper)<br/> <%= text_field 'admin_user', 'admin_level', :size => 60 %></p> -<p><label for="ban_text">Ban text</label> <small>(if not blank will stop the +<p><label for="admin_user_ban_text">Ban text</label> <small>(if not blank will stop the user from filing new requests, making annotations or messaging other users; the text is shown in public on the user's page and when they try to do a forbidden action; write in the second person (you); see @@ -19,7 +19,9 @@ <%= text_area 'admin_user', 'ban_text', :cols => 60, :rows => 3 %></p> -<p><label for="about_me">About me</label> (user's own text on their profile, format like comments):<br/> +<p><label for="admin_user_about_me">About me</label> (user's own text on their profile, format like comments):<br/> <%= text_area 'admin_user', 'about_me', :cols => 60, :rows => 3 %></p> +<p><%= check_box 'admin_user', 'no_limit' %> +<label for="admin_user_no_limit">No rate limit</label> (disable the limit on daily requests)</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..38133e7ab 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -12,20 +12,20 @@ <div id="right_column"> <div id="frontpage_search_box"> <h2> - <%= _("Search over<br/> + <%= _("Search over<br/> <strong>{{number_of_requests}} requests</strong> <span>and</span><br/> <strong>{{number_of_authorities}} authorities</strong>", - :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %> + :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %> </h2> <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> - <div> - <%= text_field_tag 'query', params[:query], { :size => 30 } %> - <%= submit_tag _('Search') %> - </div> + <div> + <%= text_field_tag 'query', params[:query], { :size => 30 } %> + <%= submit_tag _('Search') %> + </div> <% end %> </div> <div id="frontpage_right_to_know"> - <%= render :partial => 'frontpage_intro_sentence' %> + <%= render :partial => 'frontpage_intro_sentence' %> </div> </div> <div style="clear:both"></div> @@ -34,38 +34,38 @@ <div id="frontpage_examples"> <% if @popular_bodies.size > 0 %> <div id="examples_0"> - <h3><%= _("Who can I request information from?") %></h3> - <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:", - :site_name => site_name, :number_of_authorities => PublicBody.count) %> - <ul> + <h3><%= _("Who can I request information from?") %></h3> + <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:", + :site_name => site_name, :number_of_authorities => PublicBody.count) %> + <ul> <% for popular_body in @popular_bodies %> <li><%=public_body_link(popular_body)%> <%= n_('%d request', '%d requests', popular_body.info_requests.count) % popular_body.info_requests.count %> </li> <% end%> - </ul> - <p><strong> - <%= link_to _('Browse all authorities...'), list_public_bodies_default %> - </strong></p> - </div> + </ul> + <p><strong> + <%= link_to _('Browse all authorities...'), list_public_bodies_default %> + </strong></p> + </div> <% end %> - <div id="examples_1"> - <h3><%= _("What information has been released?") %></h3> - <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:", - :site_name => site_name, :number_of_requests => InfoRequest.count) %> - <ul> - <% for event in @request_events %> - <li> - <%= public_body_link(event.info_request.public_body) %> <%= _('answered a request about') %> - <%=link_to h(event.info_request.title), request_url(event.info_request)%> + <div id="examples_1"> + <h3><%= _("What information has been released?") %></h3> + <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:", + :site_name => site_name, :number_of_requests => InfoRequest.count) %> + <ul> + <% for event in @request_events %> + <li> + <%= 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> - </li> - <% end %> - </ul> - <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p> - </div> + <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", 200) %></p> + </li> + <% end %> + </ul> + <p><strong><%=link_to _('More successful requests...'), request_list_successful_url %></strong></p> + </div> </div> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 87a6ab446..90ace809e 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -7,7 +7,7 @@ <% if @query.nil? %> <% @title = _("Search Freedom of Information requests, public authorities and users") %> <% elsif @total_hits == 0 %> - <% @title = _('There were no requests matching your query.') %> + <% @title = _('There were no results matching your query.') %> <% else %> <% @title = _("Results page {{page_number}}", :page_number => @page.to_s) %> <% end%> @@ -56,11 +56,7 @@ ["all", _("everything")]]%> <% for variety, label in labels %> <% if @variety_postfix != variety %> - <% if variety != "users" %> - <%= link_to label, search_url([params[:query], @common_query], variety, @sort_postfix) %> - <% else %> - <%= link_to label, search_url(params[:query], variety, @sort_postfix) %> - <% end %> + <%= link_to label, search_url([params[:query], variety, @sort_postfix]) %> <% else %> <%= label %> <% end %> @@ -126,9 +122,9 @@ <% if !@query.nil? %> <p id="search_controls"> - <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %> + <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url([params[:query], @variety_postfix, 'relevant'], params) %> | - <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %> + <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url([params[:query], @variety_postfix, 'newest'], params) %> <% if @sortby == 'described' %> | <%= _('Recently described results first') %> <% end %> @@ -166,7 +162,6 @@ <%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %> <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %> - <h2 class="publicbody_results"><%= _('No public authorities found') %></h2> <% if @spelling_correction %> <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p> <% end %> @@ -187,6 +182,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/layouts/default.rhtml b/app/views/layouts/default.rhtml index 2f8e0bf36..f439b27d2 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -10,13 +10,13 @@ </title> <link rel="shortcut icon" href="/favicon.ico"> - <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> - <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> - <% if !params[:print_stylesheet].nil? %> + <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'fonts', :rel => "stylesheet", :media => "all" %> + <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "print" %> + <% if !params[:print_stylesheet].nil? %> <%= stylesheet_link_tag 'print', :rel => "stylesheet", :media => "all" %> - <% end %> - <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> + <% end %> + <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %> <% if @profile_photo_javascript %> <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script> @@ -24,7 +24,7 @@ <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" > <% end %> - <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> + <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%> <!--[if LT IE 7]> <style type="text/css">@import url("/stylesheets/ie6.css");</style> <![endif]--> @@ -34,8 +34,8 @@ <!--[if LT IE 8]> <style type="text/css">@import url("/stylesheets/ie7.css");</style> <![endif]--> - <!-- the following method for customising CSS is deprecated; see `doc/THEMES.md` for detail --> - <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> + <!-- the following method for customising CSS is deprecated; see `doc/THEMES.md` for detail --> + <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %> <% if force_registration_on_new_request %> <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %> <% end %> @@ -56,7 +56,7 @@ <meta name="robots" content="noindex, nofollow"> <% end %> - <%= render :partial => 'general/before_head_end' %> + <%= render :partial => 'general/before_head_end' %> </head> <body <%= "class='front'" if params[:action] == 'frontpage' %>> @@ -102,7 +102,8 @@ <%= _('Hello, {{username}}!', :username => h(@user.name))%> <% if @user %> - <%=link_to _("My profile"), user_url(@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) %> <% end %> diff --git a/app/views/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.rhtml index 436471544..7ade89b8e 100644 --- a/app/views/public_body/_search_ahead.rhtml +++ b/app/views/public_body/_search_ahead.rhtml @@ -1,4 +1,4 @@ -<p> +<div> <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.size > 0 %> <h3><%= _('Top search results:') %></h3> @@ -13,8 +13,9 @@ <%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %> <% end %> </div> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %> <% end %> -</p> +</div> diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.rhtml index af91d8ed2..8cb207bd4 100644 --- a/app/views/public_body/list.rhtml +++ b/app/views/public_body/list.rhtml @@ -44,7 +44,7 @@ </div> <% end %> -<h2 class="publicbody_results"><%= _('Found {{count}} public bodies {{description}}', :count=>@public_bodies.size, :description=>@description) %></h2> +<h2 class="publicbody_results"><%= _('Found {{count}} public bodies {{description}}', :count=>@public_bodies.total_entries, :description=>@description) %></h2> <%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %> <%= will_paginate(@public_bodies) %><br/> diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.rhtml index 7d37a35a7..5f20a9717 100644 --- a/app/views/public_body/show.rhtml +++ b/app/views/public_body/show.rhtml @@ -1,123 +1,123 @@ <% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %> <div id="main_content"> - <div id="header_right"> + <div id="header_right"> <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> + <% 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> - <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> - <h2><%= _('More about this authority')%></h2> - <% if !@public_body.calculated_home_page.nil? %> - <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br> - <% end %> - <% if !@public_body.publication_scheme.empty? %> - <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> - <% end %> - <% if @public_body.has_tag?("charity") %> - <% for tag_value in @public_body.get_tag_values("charity") %> - <% if tag_value.match(/^SC/) %> - <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br> - <% else %> - <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br> - <% end %> - <% end %> - <% end %> - <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br> - </div> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + <h2><%= _('More about this authority')%></h2> + <% if !@public_body.calculated_home_page.nil? %> + <%= link_to _('Home page of authority'), @public_body.calculated_home_page %><br> + <% end %> + <% if !@public_body.publication_scheme.empty? %> + <%= link_to _('Publication scheme'), @public_body.publication_scheme %><br> + <% end %> + <% if @public_body.has_tag?("charity") %> + <% for tag_value in @public_body.get_tag_values("charity") %> + <% if tag_value.match(/^SC/) %> + <%= link_to _('Charity registration'), "http://www.oscr.org.uk/CharityIndexDetails.aspx?id=" + tag_value %><br> + <% else %> + <%= link_to _('Charity registration'), "http://www.charity-commission.gov.uk/SHOWCHARITY/RegisterOfCharities/CharityFramework.aspx?RegisteredCharityNumber=" + tag_value %><br> + <% end %> + <% end %> + <% end %> + <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br> + </div> - <div id="header_left"> - <p class="public-body-name-prefix"><%= _("Freedom of information requests to") %></p> - <h1><%=h(@public_body.name)%></h1> + <div id="header_left"> + <p class="public-body-name-prefix"><%= _("Freedom of information requests to") %></p> + <h1><%=h(@public_body.name)%></h1> - <p class="subtitle"> - <%=@public_body.type_of_authority(true)%><% 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"), public_body_admin_url(@public_body) %>) - <% end %> - </p> + <p class="subtitle"> + <%=@public_body.type_of_authority(true)%><% 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"), public_body_admin_url(@public_body) %>) + <% end %> + </p> - <% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %> - <p><%= @public_body.notes_as_html %></p> - <% end %> + <% if @public_body.has_notes? && (@public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact') %> + <p><%= @public_body.notes_as_html %></p> + <% end %> - <% if @public_body.eir_only? %> - <p><%= _('You can only request information about the environment from this authority.')%></p> - <% end %> + <% if @public_body.eir_only? %> + <p><%= _('You can only request information about the environment from this authority.')%></p> + <% end %> - <div id="stepwise_make_request"> - <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %> - <% if @public_body.eir_only? %> - <%= _('Make a new <strong>Environmental Information</strong> request')%> + <div id="stepwise_make_request"> + <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %> + <% if @public_body.eir_only? %> + <%= _('Make a new <strong>Environmental Information</strong> request')%> + <% else %> + <%= _('Make a new <strong>Freedom of Information</strong> request to {{public_body}}', :public_body => h(@public_body.name))%> + <% end %> + <%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%> + <% elsif @public_body.has_notes? %> + <%= @public_body.notes_as_html %> + <% elsif @public_body.not_requestable_reason == 'not_apply' %> + <%= _('Freedom of Information law does not apply to this authority, so you cannot make + a request to it.')%> + <% elsif @public_body.not_requestable_reason == 'defunct' %> + <%= _('This authority no longer exists, so you cannot make a request to it.')%> <% else %> - <%= _('Make a new <strong>Freedom of Information</strong> request to {{public_body}}', :public_body => h(@public_body.name))%> + <%= _('For an unknown reason, it is not possible to make a request to this authority.')%> <% end %> - <%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%> - <% elsif @public_body.has_notes? %> - <%= @public_body.notes_as_html %> - <% elsif @public_body.not_requestable_reason == 'not_apply' %> - <%= _('Freedom of Information law does not apply to this authority, so you cannot make - a request to it.')%> - <% elsif @public_body.not_requestable_reason == 'defunct' %> - <%= _('This authority no longer exists, so you cannot make a request to it.')%> - <% else %> - <%= _('For an unknown reason, it is not possible to make a request to this authority.')%> - <% end %> + </div> </div> - </div> - <div id="foi_results_section"> - <% if @public_body.info_requests.size == 0 %> - <% if @public_body.eir_only? %> - <h2><%= _('Environmental Information Regulations requests made using this site') %></h2> - <p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p> - <% else %> - <h2><%= _('Freedom of Information requests made using this site')%></h2> - <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p> - <% end %> - <% else %> - <h2 class="foi_results"> - <% if @public_body.eir_only? %> - <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %> + <div id="foi_results_section"> + <% if @public_body.info_requests.size == 0 %> + <% if @public_body.eir_only? %> + <h2><%= _('Environmental Information Regulations requests made using this site') %></h2> + <p>Nobody has made any Environmental Information Regulations requests to <%=h(@public_body.name)%> using this site yet.</p> + <% else %> + <h2><%= _('Freedom of Information requests made using this site')%></h2> + <p><%= _('Nobody has made any Freedom of Information requests to {{public_body_name}} using this site yet.', :public_body_name => h(@public_body.name))%></p> + <% end %> <% else %> - <% if @public_body.info_requests.size > 4 %> - <%= n_('Search within the %d Freedom of Information requests to %s', 'Search within the %d Freedom of Information requests made to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> - <% else %> - <%= n_('%d Freedom of Information request to %s', '%d Freedom of Information requests to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> - <% end %> + <h2 class="foi_results"> + <% if @public_body.eir_only? %> + <%= pluralize(@public_body.info_requests.size, "Environmental Information Regulations request made using this site") %> + <% else %> + <% if @public_body.info_requests.size > 4 %> + <%= n_('Search within the %d Freedom of Information requests to %s', 'Search within the %d Freedom of Information requests made to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> + <% else %> + <%= n_('%d Freedom of Information request to %s', '%d Freedom of Information requests to %s', @public_body.info_requests.size) % [@public_body.info_requests.size, @public_body.name] %> + <% end %> + <% end %> + <%= @page_desc %> + </h2> + <a name="results"></a> + + <% if @public_body.info_requests.size > 4 %> + <%= render :partial => 'request/request_filter_form' %> + <% end %> <% end %> - <%= @page_desc %> - </h2> - <a name="results"></a> - - <% if @public_body.info_requests.size > 4 %> - <%= render :partial => 'request/request_filter_form' %> - <% end %> - <% end %> - <div style="clear:both"> </div> - <% if !@xapian_requests.nil? %> + <div style="clear:both"> </div> + <% if !@xapian_requests.nil? %> <% for result in @xapian_requests.results %> <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> <% end %> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @public_body.info_requests.size) %> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %> - <% if @xapian_requests.results.empty? %> - <p><% _('There were no requests matching your query.') %></p> - <% else %> - <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p> - <% end %> + <% if @xapian_requests.results.empty? %> + <p><% _('There were no requests matching your query.') %></p> + <% else %> + <p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p> + <% end %> - <% else %> - <% if @public_body.eir_only? %> - <h2><%= _('Environmental Information Regulations requests made') %></h2> - <% else %> - <h2> <%= _('Freedom of Information requests made')%></h2> + <% else %> + <% if @public_body.eir_only? %> + <h2><%= _('Environmental Information Regulations requests made') %></h2> + <% else %> + <h2> <%= _('Freedom of Information requests made')%></h2> + <% end %> + <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p> <% end %> - <p> <%= _('The search index is currently offline, so we can\'t show the Freedom of Information requests that have been made to this authority.')%></p> - <% end %> </div> </div> diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml index e7c378cec..7a211ed88 100644 --- a/app/views/request/_request_listing_via_event.rhtml +++ b/app/views/request/_request_listing_via_event.rhtml @@ -4,9 +4,9 @@ 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) %> + <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %> <% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %> <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %> <% elsif event.is_comment? %> @@ -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/_search_ahead.rhtml b/app/views/request/_search_ahead.rhtml index d0b19de7d..1e65a5458 100644 --- a/app/views/request/_search_ahead.rhtml +++ b/app/views/request/_search_ahead.rhtml @@ -8,7 +8,7 @@ <% end %> <p> - <a id="body-site-search-link" target="_blank"><%= _("Or search in their website for this information.") %></a> + <a id="body-site-search-link"><%= _("Or search in their website for this information.") %></a> </p> <% end %> </div> diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml index 3890fa28b..7cbd982f1 100644 --- a/app/views/request/list.rhtml +++ b/app/views/request/list.rhtml @@ -14,11 +14,11 @@ <div style="clear:both"></div> <div class="results_section"> - <% view_cache :ttl => 5.minutes.to_i, :tag => [@view, @page, I18n.locale] do %> + <% view_cache :ttl => 5.minutes.to_i, :tag => [@cache_tag] do %> <% if @list_results.empty? %> <p> <%= _('No requests of this sort yet.')%></p> <% else %> - <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @list_results.size) %></h2> + <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @matches_estimated) %></h2> <div class="results_block"> <% for result in @list_results%> <% if result.class.to_s == 'InfoRequestEvent' %> @@ -30,6 +30,6 @@ </div> <% end %> - <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @matches_estimated) %> + <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @show_no_more_than) %> <% end %> </div> diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml index 2e554a20b..23212fc0b 100644 --- a/app/views/request/new.rhtml +++ b/app/views/request/new.rhtml @@ -47,12 +47,12 @@ <% end %> </div> - <div id="request_header_text"> <% if @info_request.public_body.has_notes? %> + <div id="request_header_text"> <h3><%= _('Special note for this authority!') %></h3> <p><%= @info_request.public_body.notes_as_html %></p> + </div> <% end %> - </div> <% if @info_request.public_body.eir_only? %> <h3><%= _('Please ask for environmental information only') %></h3> diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.rhtml index 55ebc40c4..521136f8e 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,7 @@ <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %> <% end %> </div> + <% end %> diff --git a/app/views/user/rate_limited.rhtml b/app/views/user/rate_limited.rhtml new file mode 100644 index 000000000..c1e8f360e --- /dev/null +++ b/app/views/user/rate_limited.rhtml @@ -0,0 +1,17 @@ +<% @title = "Too many requests" %> + +<h1><%=@title%></h1> + +<p><%= _("There is a limit on the number of requests that you can make in any one day. You can make more requests tomorrow.")%></p> + +<!-- Insert explanation of why we have a limit --> + +<p><%= _("If you need to make more requests than this, <a href='%s'>get in touch</a> and we’ll consider it.") % [help_contact_path] %></p> + +<% if @info_request %> + <p><%= _("Here is the message you wrote, in case you would like to copy the text and save it for later.") %></p> + + <div class="correspondence"> + <div class="correspondence_text"><%= @info_request.outgoing_messages[0].get_body_for_html_display %></div> + </div> +<% end %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index baf6621df..8f1803442 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -1,4 +1,8 @@ -<% @title = h(@display_user.name) + " - Freedom of Information requests" %> +<% if @show_requests %> + <% @title = h(@display_user.name) + " - Freedom of Information requests" %> +<% else %> + <% @title = h(@display_user.name) + " - user profile" %> +<% end %> <% if (@same_name_users.size >= 1) %> <p><%= _('There is <strong>more than one person</strong> who uses this site and has this name. @@ -7,7 +11,7 @@ <% end %> <% end%> -<% if @is_you && @undescribed_requests.size > 0 %> +<% if @show_profile && @is_you && @undescribed_requests.size > 0 %> <div class="undescribed_requests"> <p><%= _('Please <strong>go to the following requests</strong>, and let us know if there was information in the recent responses to them.')%></p> @@ -24,17 +28,18 @@ </div> <% end %> +<% if @show_profile %> <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 %> + <% if !@track_thing.nil? %> + <h2><%= _('Track this person')%></h2> + <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + <% end %> + <% if !@xapian_requests.nil? %> + <h2><%= _('On this page')%></h2> + <a href="#foi_requests"><%= _('FOI requests')%></a> + <br><a href="#annotations"><%= _('Annotations')%></a> + <% end %> </div> <div class="header_left"> @@ -76,7 +81,7 @@ <div id="user_public_banned"> <p> <strong> - <%= _('This user has been banned from {{site_name}} ', :site_name=>site_name)%> + <%= _('This user has been banned from {{site_name}} ', :site_name=>site_name)%> </strong> </p> <p> @@ -116,19 +121,20 @@ </div> </div> <div style="clear:both"></div> +<% end %> +<% if @show_requests %> <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 %> - + <% 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? %> @@ -136,16 +142,16 @@ <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 %> + <%= @page_desc %> <% 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.matches_estimated.to_s) % @xapian_requests.matches_estimated.to_s : 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 %> + <%= @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 } %> @@ -154,17 +160,19 @@ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %> <% end %> <% else %> + <% if @show_requests %> <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 %> <% end %> <% if !@xapian_comments.nil? %> <% if @xapian_comments.results.empty? %> <% if @page == 1 %> <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %> - <%= @match_phrase %> - </h2> - <p><%= _('None made.')%></p> + <%= @match_phrase %> + </h2> + <p><%= _('None made.')%></p> <% end %> <% else %> <h2 id="annotations"> @@ -181,55 +189,56 @@ <% end %> <% end %> - <% if @is_you %> - <% if @track_things.empty? %> - <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2> - <p><%= _('None made.')%></p> - <% else %> - <h2 id="email_subscriptions"> Your <%=pluralize(@track_things.size, _('email subscription')) %> </h2> - <% if @track_things_grouped.size == 1 %> +</div> +<% end %> +<% if @show_profile && @is_you %> + <% if @track_things.empty? %> + <h2 id="email_subscriptions"> <%= _('Your email subscriptions')%></h2> + <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'}, :class => "feed_form") do %> + <h3> + <%=TrackThing.track_type_description(@track_things[0].track_type)%> + <%= hidden_field_tag 'track_type', @track_things[0].track_type %> + <%= hidden_field_tag 'user', @display_user.id %> + <%= hidden_field_tag 'r', request.request_uri %> + <% if @track_things.size > 1 %> + <%= submit_tag _('unsubscribe all') %> + <% end %> + </h3> + <% end %> + <% end %> + <% for track_type, track_things in @track_things_grouped %> + <% if @track_things_grouped.size > 1 %> <% 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 %> + <%=TrackThing.track_type_description(track_type)%> + <%= hidden_field_tag 'track_type', track_type %> <%= hidden_field_tag 'user', @display_user.id %> <%= hidden_field_tag 'r', request.request_uri %> - <% if @track_things.size > 1 %> - <%= submit_tag _('unsubscribe all') %> - <% end %> + <% if track_things.size > 1 %> + <%= submit_tag _('unsubscribe all')%> + <% end %> </h3> <% end %> <% end %> - <% for track_type, track_things in @track_things_grouped %> - <% if @track_things_grouped.size > 1 %> - <% 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 %> - <%= hidden_field_tag 'user', @display_user.id %> - <%= hidden_field_tag 'r', request.request_uri %> - <% if track_things.size > 1 %> - <%= submit_tag _('unsubscribe all')%> - <% end %> - </h3> - <% end %> - <% end %> - <ul> - <% for track_thing in track_things %> - <li> - <% 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 } %> - <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s } %> - <%= submit_tag _('unsubscribe') %> - </div> - <% end %> - </li> - <% end %> - </ul> + <ul> + <% for track_thing in track_things %> + <li> + <% 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 } %> + <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s } %> + <%= submit_tag _('unsubscribe') %> + </div> + <% end %> + </li> <% end %> + </ul> <% end %> <% end %> -</div>
\ No newline at end of file +<% end %> 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 } %> |