diff options
Diffstat (limited to 'app/views')
69 files changed, 532 insertions, 244 deletions
diff --git a/app/views/admin_censor_rule/_show.html.erb b/app/views/admin_censor_rule/_show.html.erb index 46904b3b9..4b37d0cc9 100644 --- a/app/views/admin_censor_rule/_show.html.erb +++ b/app/views/admin_censor_rule/_show.html.erb @@ -15,7 +15,7 @@ <td><%=h censor_rule.send(column) %></td> <% end %> <td> - <%= link_to "Edit", admin_rule_edit_path(censor_rule) %> + <%= link_to "Edit", edit_admin_censor_rule_path(censor_rule) %> </td> </tr> <% end %> @@ -25,7 +25,7 @@ <% end %> <% if defined? info_request %> - <%= link_to "New censor rule", new_admin_info_request_censor_rule_path(info_request), :class => "btn btn-info" %> + <%= link_to "New censor rule", new_admin_request_censor_rule_path(info_request), :class => "btn btn-info" %> <span class="label label-info">for this request only</span> <% end %> diff --git a/app/views/admin_censor_rule/edit.html.erb b/app/views/admin_censor_rule/edit.html.erb index 230446ed3..ff07987f2 100644 --- a/app/views/admin_censor_rule/edit.html.erb +++ b/app/views/admin_censor_rule/edit.html.erb @@ -2,15 +2,14 @@ <h1><%=@title%></h1> -<%= form_tag admin_rule_update_path(@censor_rule), :class => "form form-horizontal" do %> +<%= form_tag admin_censor_rule_path(@censor_rule), :method => 'put', :class => "form form-horizontal" do %> <%= render :partial => 'form', :locals => { :info_request => @censor_rule.info_request, :user => @censor_rule.user } %> <div class="form-actions"> <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %> </div> <% end %> -<%= form_tag admin_rule_destroy_path(@censor_rule), :class => "form form-horizontal" do %> - <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %> +<%= form_tag admin_censor_rule_path(@censor_rule), :method => 'delete', :class => "form form-horizontal" do %> <div class="form-actions"> Permanent! --> <%= submit_tag "Destroy rule", :class => "btn btn-primary" %> </div> diff --git a/app/views/admin_censor_rule/new.html.erb b/app/views/admin_censor_rule/new.html.erb index 26b3212be..ded31cff2 100644 --- a/app/views/admin_censor_rule/new.html.erb +++ b/app/views/admin_censor_rule/new.html.erb @@ -4,7 +4,6 @@ <%= form_for @censor_rule, :url => @form_url, :class => "form form-horizontal" do %> <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @censor_user } %> - <div class="form-actions"> <%= submit_tag "Create", :class => "btn btn-primary" %> </div> diff --git a/app/views/admin_request/edit_comment.html.erb b/app/views/admin_comment/edit.html.erb index 2cf49a4a8..e3cbd7472 100644 --- a/app/views/admin_request/edit_comment.html.erb +++ b/app/views/admin_comment/edit.html.erb @@ -2,12 +2,12 @@ <%= error_messages_for 'comment' %> -<%= form_tag admin_request_update_comment_path(@comment) do %> +<%= form_tag admin_comment_path(@comment), :method => 'put' do %> <p><label for="comment_body">Body of annotation</label><br/> <%= text_area 'comment', 'body', :rows => 10, :cols => 60 %></p> - <p><label for="comment_visible">Visible</label> + <p><label for="comment_visible">Visible</label> <%= select('comment', "visible", [["Yes – show comment",true],["No – hide comment",false]]) %> </p> @@ -16,7 +16,7 @@ <% end %> <p> -<%= link_to 'Show', admin_request_show_path(@comment.info_request) %> | -<%= link_to 'List all', admin_request_list_path %> +<%= link_to 'Show request', admin_request_path(@comment.info_request) %> | +<%= link_to 'List all requests', admin_requests_path %> </p> diff --git a/app/views/admin_general/_admin_navbar.html.erb b/app/views/admin_general/_admin_navbar.html.erb index 14fc06092..b6e01f049 100644 --- a/app/views/admin_general/_admin_navbar.html.erb +++ b/app/views/admin_general/_admin_navbar.html.erb @@ -9,11 +9,17 @@ <li><%= link_to 'Timeline', admin_timeline_path %></li> <li><%= link_to 'Stats', admin_stats_path %></li> <li><%= link_to 'Debug', admin_debug_path %></li> - <li><%= link_to 'Authorities', admin_body_list_path %></li> - <li><%= link_to 'Categories', admin_categories_path %></li> - <li><%= link_to 'Requests', admin_request_list_path %></li> - <li><%= link_to 'Users', admin_user_list_path %></li> - <li><%= link_to 'Tracks', admin_track_list_path %></li> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Authorities<span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <li><%= link_to 'Authorities', admin_bodies_path %></li> + <li><%= link_to 'Categories', admin_categories_path %></li> + </ul> + </li> + <li><%= link_to 'Requests', admin_requests_path %></li> + <li><%= link_to 'Users', admin_users_path %></li> + <li><%= link_to 'Tracks', admin_tracks_path %></li> + <li><%= link_to 'Holidays', admin_holidays_path %></li> <li><%= link_to 'Log out', signout_path %></li> </ul> </div> diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb index ba9396ceb..ba0563bb6 100644 --- a/app/views/admin_general/index.html.erb +++ b/app/views/admin_general/index.html.erb @@ -37,9 +37,9 @@ <tr> <td> <% if message.get_body_for_quoting.strip.size == 0 %> - <%= link_to "(no body)", admin_request_show_raw_email_path(message.raw_email_id) %> + <%= link_to "(no body)", admin_raw_email_path(message.raw_email_id) %> <% else %> - <%= link_to excerpt(message.get_body_for_quoting, "", :radius => 60), admin_request_show_raw_email_path(message.raw_email_id) %> + <%= link_to excerpt(message.get_body_for_quoting, "", :radius => 60), admin_raw_email_path(message.raw_email_id) %> <% end %> </td> <td class="span2"> @@ -183,10 +183,10 @@ <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_update_path(@change_request), :class => "form form-horizontal" do %> + <%= 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", admin_change_request_edit_path(@change_request), :class => 'btn') %> - <%= link_to("Add authority", admin_body_new_path(:change_request_id => @change_request.id), :class => 'btn btn-primary') %> + <%= 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 %> @@ -202,10 +202,10 @@ <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_update_path(@change_request), :class => "form form-horizontal" do %> + <%= 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", admin_change_request_edit_path(@change_request), :class => 'btn') %> - <%= link_to("Make update", admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %> + <%= 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> diff --git a/app/views/admin_general/stats.html.erb b/app/views/admin_general/stats.html.erb index 27dc25ee0..03268cc14 100644 --- a/app/views/admin_general/stats.html.erb +++ b/app/views/admin_general/stats.html.erb @@ -53,8 +53,3 @@ </div> </div> </div> -<div class="row"> - <div class="span12"> - <h2>Web analytics</h2> - </div> -</div> diff --git a/app/views/admin_holiday_imports/new.html.erb b/app/views/admin_holiday_imports/new.html.erb new file mode 100644 index 000000000..047f321f9 --- /dev/null +++ b/app/views/admin_holiday_imports/new.html.erb @@ -0,0 +1,81 @@ +<% @title = "Create holidays from suggestions or iCal feed" %> +<h1><%= @title %></h1> + +<%= form_for( @holiday_import, :as => 'holiday_import', :url => '', :method => 'get', :html => { :class => 'form-horizontal form-inline' }) do |f| %> + <% if @holiday_import.holidays.empty? %> + <%= error_messages_for 'holiday_import', :header_message => 'There was a problem with these import settings' %> + <% end %> + <legend>Import settings</legend> + <div> + <div class="control-group"> + <label class="control-label">Choose the years to import holidays for</label> + <div class="controls"> + <label for="import_start_year" class="inline">Start year:</label> + <%= f.select :start_year, (Time.now.year)..(Time.now.year + 5) %> + <label for="import_end_year" class="inline">End year:</label> + <%= f.select :end_year, (Time.now.year)..(Time.now.year + 5) %> + </div> + </div> + + <div class="control-group"> + <label class="control-label">Import from built-in suggestions or iCal feed</label> + <div class="controls"> + <label class="radio inline"> + <%= f.radio_button :source, "suggestions" %>Built-in suggestions + </label> + <label class="radio inline"> + <%= f.radio_button :source, "feed" %>iCal feed + </label> + </div> + </div> + + <div class="control-group"> + <label class="control-label">iCal feed URL:</label> + <div class="controls"> + <%= f.text_field 'ical_feed_url' %> + </div> + </div> + + <div class="control-group"> + <input type="submit" value="Show holidays" class="btn btn-primary"> + </div> + + </div> +<% end %> + +<% if @holiday_import.populated %> + <h2>Holidays to import</h2> + + <table class="table table-striped table-condensed"> + <tbody> + <tr> + <td> + <% if @holiday_import.holidays.empty? %> + <% if @holiday_import.source == 'suggestions' %> + Sorry, we don't have any built-in suggestions for holiday days in <%= @holiday_import.suggestions_country_name %>. + <% else %> + Sorry, we couldn't find any holidays in that iCal feed. + <% end %> + <% else %> + <%= form_for( @holiday_import, :as => 'holiday_import', :url => admin_holiday_imports_path, :html => { :class => 'form-inline' } ) do |f| -%> + <%= error_messages_for 'holiday_import' %> + <legend> + <% if @holiday_import.source == 'suggestions' %> + Suggested holidays for <%= @holiday_import.suggestions_country_name %> (<%= @holiday_import.period %>) + <% else %> + Holidays from feed (<%= @holiday_import.period %>) + <% end %> + </legend> + <%= f.fields_for :holidays do |holiday_fields| %> + <div class="import-holiday-info"> + <%= render :partial => 'admin_holidays/form', :locals => {:f => holiday_fields, :context => :import, :holiday => holiday_fields.object } %> + </div> + <% end%> + <%= f.submit "Import", :class => 'btn btn-warning' %> + <% end %> + <% end %> + </td> + </tr> + </tbody> + </table> +<% end %> diff --git a/app/views/admin_holidays/_edit_form.html.erb b/app/views/admin_holidays/_edit_form.html.erb new file mode 100644 index 000000000..b750dbf4c --- /dev/null +++ b/app/views/admin_holidays/_edit_form.html.erb @@ -0,0 +1,14 @@ +<td> + <%= form_for(@holiday, :url => admin_holiday_path(@holiday), :html => { :class => 'form-inline edit-holiday-form'}) do |f| -%> + <%= render :partial => 'form', :locals => { :f => f, :holiday => @holiday, :context => :edit } %> + <% end %> + + <div class="holiday-destroy "> + <%= form_for @holiday, :url => admin_holiday_path(@holiday), :method => 'delete', :html => { :class => "form form-inline delete-holiday-form" } do |f| %> + <%= f.submit "Destroy", + :class => "btn btn-danger", + :confirm => 'Are you sure you want to destroy this public holiday?' %> + <% end %> + </div> + +</td> diff --git a/app/views/admin_holidays/_form.html.erb b/app/views/admin_holidays/_form.html.erb new file mode 100644 index 000000000..35370e5fc --- /dev/null +++ b/app/views/admin_holidays/_form.html.erb @@ -0,0 +1,22 @@ +<%= error_messages_for 'holiday' %> + +<div class="holiday-description"> + <% if holiday.new_record? %> + <%= f.text_field :description, :class => 'input', :placeholder => 'Enter description here' %> + <% else %> + <%= f.text_field :description, :class => 'input' %> + <% end %> +</div> + +<div class="holiday-day"> + <%= f.date_select :day, { :use_month_numbers => true }, { :class => "day_select" } %> +</div> +<div class="holiday-buttons"> + <% if context == :import %> + <%= f.submit "Remove", :class => 'btn remove-holiday' %> + <% else %> + <%= link_to("Cancel", admin_holidays_path, :class => 'btn') %> + <%= f.submit "Save", :class => 'btn btn-warning' %> +<% end %> +</div> + diff --git a/app/views/admin_holidays/_holiday.html.erb b/app/views/admin_holidays/_holiday.html.erb new file mode 100644 index 000000000..78818f411 --- /dev/null +++ b/app/views/admin_holidays/_holiday.html.erb @@ -0,0 +1,7 @@ +<td> + <div class="holiday-description"><%= holiday.description %></div> + <div class="holiday-day"><%= holiday.day %></div> + <div class="holiday-buttons"> + <%= link_to 'Edit', edit_admin_holiday_path(holiday), :class => "btn edit-button" %> + </div> +</td> diff --git a/app/views/admin_holidays/_new_form.html.erb b/app/views/admin_holidays/_new_form.html.erb new file mode 100644 index 000000000..aee73f426 --- /dev/null +++ b/app/views/admin_holidays/_new_form.html.erb @@ -0,0 +1,10 @@ +<table class="table table-striped table-condensed"> + <tbody> + <tr> + <td><%= form_for(@holiday, :url => admin_holidays_path, :html => { :class => 'form-inline new-holiday-form'}) do |f| -%> + <%= render :partial => 'form', :locals => { :f => f, :holiday => @holiday, :context => :new } %> + <% end %> + </td> + </tr> + </tbody> +</table> diff --git a/app/views/admin_holidays/edit.html.erb b/app/views/admin_holidays/edit.html.erb new file mode 100644 index 000000000..8f29c9a44 --- /dev/null +++ b/app/views/admin_holidays/edit.html.erb @@ -0,0 +1,9 @@ +<% @title = 'Edit public holiday' %> +<h1><%= @title %></h1> +<table class="table table-striped table-condensed"> + <tbody> + <tr> + <%= render :partial => 'edit_form' %> + </tr> + </tbody> +</table> diff --git a/app/views/admin_holidays/index.html.erb b/app/views/admin_holidays/index.html.erb new file mode 100644 index 000000000..d4ee8706b --- /dev/null +++ b/app/views/admin_holidays/index.html.erb @@ -0,0 +1,41 @@ +<% @title = 'Public Holidays' %> +<h1><%= @title %></h1> +<p> + + Alaveteli calculates the due dates of requests taking account of the + public holidays shown here. If you have set the + <code>WORKING_OR_CALENDAR_DAYS</code><a + href="http://alaveteli.org/docs/customising/config/#working_or_calendar_days" + target="_blank">(docs)</a> setting for Alaveteli to + <code>working</code>, the date when a response to a request is + officially overdue will be calculated in days that are not weekends + or public holidays. If you have set + <code>WORKING_OR_CALENDAR_DAYS</code> to <code>calendar</code>, the + date will be calculated in calendar days, but if the due date falls + on a public holiday or weekend day, then the due date is considered + to be the next week day that isn't a holiday. + +</p> +<div class="btn-toolbar"> + <div class="btn-group"> + <%= link_to 'New holiday', new_admin_holiday_path, :class => "btn btn-primary", :id => 'new-holiday-button' %> + </div> + <div class="btn-group"> + <%= link_to 'Create holidays from suggestions or iCal feed', new_admin_holiday_import_path, :class => "btn btn-warning" %> + </div> +</div> + +<div id="existing-holidays"> + <% @years.each do |year| %> + <h2><%= year %></h2> + <table class="table table-striped table-condensed"> + <tbody> + <% @holidays_by_year[year].sort_by(&:day).each do |holiday| %> + <%= content_tag_for(:tr, holiday, prefix=nil, 'data-target' => edit_admin_holiday_path(holiday)) do %> + <%= render :partial => 'holiday', :locals => { :holiday => holiday }%> + <% end %> + <% end %> + </tbody> + </table> + <% end %> +</div> diff --git a/app/views/admin_holidays/new.html.erb b/app/views/admin_holidays/new.html.erb new file mode 100644 index 000000000..792c32f52 --- /dev/null +++ b/app/views/admin_holidays/new.html.erb @@ -0,0 +1,4 @@ +<% @title = 'New public holiday' %> +<h1><%= @title %></h1> + +<%= render :partial => 'new_form' %> diff --git a/app/views/admin_request/_incoming_message_actions.html.erb b/app/views/admin_incoming_message/_actions.html.erb index 22effcce5..4780ad910 100644 --- a/app/views/admin_request/_incoming_message_actions.html.erb +++ b/app/views/admin_incoming_message/_actions.html.erb @@ -1,6 +1,6 @@ <fieldset class="form-horizontal"> <legend>Actions</legend> - <%= form_tag admin_incoming_redeliver_path, :class => "form form-inline" do %> + <%= form_tag redeliver_admin_incoming_message_path(incoming_message), :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="url_title_<%= incoming_message.id %>">Redeliver message to one or more other requests</label> <div class="controls"> @@ -9,7 +9,6 @@ <% else %> <%= text_field_tag 'url_title', "", { :size => 20, :id => "url_title_#{incoming_message.id}" } %> <% end %> - <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id, :id => nil %> <%= submit_tag "Redeliver to another request", :class => "btn" %> <p class="help-block"><code>id</code> or <code>url_title</code>; you can supply more than one, separated by commas</p> </div> @@ -18,7 +17,10 @@ <div class="control-group"> <label class="control-label">Generate FOI officer upload URL</label> <div class="controls"> - <%= link_to 'Generate and take me there', admin_request_generate_upload_url_path(incoming_message.info_request, :incoming_message_id => incoming_message.id), :class => "btn" %> + <%= form_tag generate_upload_url_admin_request_path(incoming_message.info_request), :class => "form form-inline" do %> + <%= hidden_field_tag 'incoming_message_id', incoming_message.id, :id => nil %> + <%= submit_tag "Generate and take me there", :class => "btn" %> + <% end %> </div> </div> @@ -29,7 +31,7 @@ </div> </div> - <%= form_tag admin_incoming_destroy_path, :class => "form form-inline" do %> + <%= form_tag admin_incoming_message_path(incoming_message), :method => 'delete', :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="destroy_message_<%= incoming_message.id %>">Destroy message</label> <div class="controls"> @@ -44,7 +46,7 @@ <div class="control-group"> <label class="control-label">Inspect email</label> <div class="controls"> - <%= link_to "View raw email", admin_request_show_raw_email_path(incoming_message.raw_email_id), :class => "btn" %> + <%= link_to "View raw email", admin_raw_email_path(incoming_message.raw_email_id), :class => "btn" %> </div> </div> <% end %> diff --git a/app/views/admin_incoming_message/edit.html.erb b/app/views/admin_incoming_message/edit.html.erb index 1088edcab..5e172af76 100644 --- a/app/views/admin_incoming_message/edit.html.erb +++ b/app/views/admin_incoming_message/edit.html.erb @@ -1,8 +1,8 @@ <%= render :partial => 'intro', :locals => {:incoming_message => @incoming_message } %> -<%= render :partial => 'admin_request/incoming_message_actions', :locals => { :incoming_message => @incoming_message } %> +<%= render :partial => 'actions', :locals => { :incoming_message => @incoming_message } %> <fieldset class="form-horizontal"> <legend>Prominence</legend> - <%= form_tag admin_incoming_update_path(@incoming_message), :class => "form form-inline" do %> + <%= form_tag admin_incoming_message_path(@incoming_message), :method => 'put', :class => "form form-inline" do %> <div class="control-group"> <label class="control-label" for="incoming_message_prominence"> Prominence</label> diff --git a/app/views/admin_outgoing_message/edit.html.erb b/app/views/admin_outgoing_message/edit.html.erb index d5f5f43bf..d84a5ba66 100644 --- a/app/views/admin_outgoing_message/edit.html.erb +++ b/app/views/admin_outgoing_message/edit.html.erb @@ -2,7 +2,7 @@ <%= error_messages_for 'outgoing_message' %> -<%= form_tag admin_outgoing_update_path(@outgoing_message) do %> +<%= form_tag admin_outgoing_message_path(@outgoing_message), :method => 'put' do %> <div class="control-group"> <label class="control-label" for="outgoing_message_prominence"> Prominence</label> <div class="controls"> @@ -36,13 +36,12 @@ <% end %> <p> -<%= link_to 'Show', admin_request_show_path(@outgoing_message.info_request) %> | -<%= link_to 'List all', admin_request_list_path %> +<%= link_to 'Show', admin_request_path(@outgoing_message.info_request) %> | +<%= link_to 'List all', admin_requests_path %> </p> -<%= form_tag admin_outgoing_destroy_path do %> +<%= form_tag admin_outgoing_message_path(@outgoing_message), :method => 'delete' do %> <div> - <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %> <%= submit_tag "Destroy outgoing message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?" %> </div> <% end %> diff --git a/app/views/admin_public_body/_one_list.html.erb b/app/views/admin_public_body/_one_list.html.erb index 8f1d719ec..8d891d16c 100644 --- a/app/views/admin_public_body/_one_list.html.erb +++ b/app/views/admin_public_body/_one_list.html.erb @@ -4,7 +4,7 @@ <div class="accordion-heading accordion-toggle row"> <span class="item-title span6"> <a href="#body_<%=public_body.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a> - <%= link_to(public_body.name, admin_body_show_path(public_body), :title => "view full details")%> + <%= link_to(public_body.name, admin_body_path(public_body), :title => "view full details")%> </span> <span class="item-metadata span6"> <%= render :partial => 'tags', :locals => { :body => public_body} %> @@ -31,7 +31,7 @@ <% end %> </div> -<%= form_tag(admin_body_mass_tag_add_url, :method => "post", :class => "form form-inline" ) do %> +<%= form_tag(mass_tag_add_admin_bodies_path, :method => "post", :class => "form form-inline" ) do %> <p> <%= text_field_tag 'new_tag', params[:new_tag], { :size => 15, :id => "mass_add_tag_new_tag_" + table_name } %> <%= hidden_field_tag(:query, params[:query], { :id => "mass_add_tag_query_" + table_name } ) %> diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb index 11b7eec22..dcafbd270 100644 --- a/app/views/admin_public_body/edit.html.erb +++ b/app/views/admin_public_body/edit.html.erb @@ -3,7 +3,7 @@ <div class="row"> <div class="span8"> <div id="public_body_form"> - <%= form_for @public_body, :url => admin_body_update_path(@public_body), :html => { :class => "form form-horizontal" } do |f| %> + <%= form_for @public_body, :url => admin_body_path(@public_body), :method => 'put', :html => { :class => "form form-horizontal" } do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> <div class="form-actions"> <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p> @@ -13,15 +13,14 @@ <div class="row"> <div class="span8"> <div class="well"> - <%= link_to 'Show', admin_body_show_path(@public_body), :class => "btn" %> - <%= link_to 'List all', admin_body_list_path, :class => "btn" %> + <%= link_to 'Show', admin_bodies_path(@public_body), :class => "btn" %> + <%= link_to 'List all', admin_bodies_path, :class => "btn" %> </div> </div> </div> <% if @public_body.info_requests.empty? %> - <%= form_tag(admin_body_destroy_path(@public_body), :class => "form form-inline") do %> - <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %> + <%= form_tag(admin_body_path(@public_body), :class => "form form-inline", :method => 'delete') do %> <%= submit_tag _("Destroy {{name}}", :name => @public_body.name), :class => "btn btn-danger" %> (this is permanent!) <% end %> <% end %> diff --git a/app/views/admin_public_body/list.html.erb b/app/views/admin_public_body/index.html.erb index 3d7d9c4cd..861593bee 100644 --- a/app/views/admin_public_body/list.html.erb +++ b/app/views/admin_public_body/index.html.erb @@ -8,10 +8,10 @@ <div class="btn-toolbar"> <div class="btn-group"> - <%= link_to 'New public authority', admin_body_new_path, :class => "btn btn-primary" %> + <%= link_to 'New public authority', new_admin_body_path, :class => "btn btn-primary" %> </div> <div class="btn-group"> - <%= link_to 'Import from CSV file', admin_body_import_csv_path, :class => "btn btn-warning" %> + <%= link_to 'Import from CSV file', import_csv_admin_bodies_path, :class => "btn btn-warning" %> </div> </div> @@ -19,7 +19,7 @@ <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query" } %> <%= submit_tag "Search", :class => "btn" %> <% if !@query.nil? %> - <%= link_to 'Show all', admin_body_list_path, :class => "btn" %> + <%= link_to 'Show all', admin_bodies_path, :class => "btn" %> <% end %><br> (substring search in names and emails; exact match of tags) <% end %> diff --git a/app/views/admin_public_body/new.html.erb b/app/views/admin_public_body/new.html.erb index 24b27d7af..69b1f8503 100644 --- a/app/views/admin_public_body/new.html.erb +++ b/app/views/admin_public_body/new.html.erb @@ -4,7 +4,7 @@ <div class="row"> <div class="span8"> <div id="public_body_form"> - <%= form_for @public_body, :as => :public_body, :url => admin_body_create_path, :html => {:class => "form form-horizontal"} do |f| %> + <%= form_for @public_body, :as => :public_body, :url => admin_bodies_path, :html => {:class => "form form-horizontal"} do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> @@ -14,7 +14,7 @@ <% end %> <div class="row"> <div class="span8 well"> - <%= link_to 'List all', admin_body_list_path, :class => "btn" %> + <%= link_to 'List all', admin_bodies_path, :class => "btn" %> </div> </div> </div> diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb index f8161db26..40f341a22 100644 --- a/app/views/admin_public_body/show.html.erb +++ b/app/views/admin_public_body/show.html.erb @@ -45,7 +45,7 @@ </tr> </tbody> </table> -<%= link_to _("Edit"), admin_body_edit_path(@public_body), :class => "btn btn-primary" %> +<%= link_to _("Edit"), edit_admin_body_path(@public_body), :class => "btn btn-primary" %> <% unless @public_body.url_name.nil? %> <%=link_to _("Public page"), public_body_path(@public_body), :class => "btn" %> <% else %> diff --git a/app/views/admin_public_body_change_requests/edit.html.erb b/app/views/admin_public_body_change_requests/edit.html.erb index cc9c5b5d9..aaf457084 100644 --- a/app/views/admin_public_body_change_requests/edit.html.erb +++ b/app/views/admin_public_body_change_requests/edit.html.erb @@ -1,6 +1,6 @@ <h1><%=@title%></h1> -<%= form_tag admin_change_request_update_path(@change_request), :class => "form form-horizontal" do %> +<%= form_tag admin_change_request_path(@change_request), :method => 'put', :class => "form form-horizontal" do %> <%= render :partial => 'admin_public_body_change_requests/response'%> <div class="form-actions"> <%= submit_tag 'Close', :accesskey => 'c', :class => "btn btn-primary" %> diff --git a/app/views/admin_request/show_raw_email.html.erb b/app/views/admin_raw_email/show.html.erb index da22b6069..f88b00ef0 100644 --- a/app/views/admin_request/show_raw_email.html.erb +++ b/app/views/admin_raw_email/show.html.erb @@ -31,7 +31,7 @@ <tr> <td><strong>Authority:</strong></td> <td> - <%= link_to(info_request.public_body.name, admin_body_show_path(info_request.public_body)) %> + <%= link_to(info_request.public_body.name, admin_body_path(info_request.public_body)) %> </td> </tr> <tr> @@ -52,12 +52,12 @@ </p> <div> - <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %> + <%= render :partial => 'admin_incoming_message/actions', :locals => { :incoming_message => @raw_email.incoming_message } %> </div> <h2>Raw email</h2> -<p><%= link_to "Download", admin_request_download_raw_email_path(@raw_email) %></p> +<p><%= link_to "Download", admin_raw_email_path(@raw_email, :format => 'txt') %></p> <pre><%=h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre> diff --git a/app/views/admin_request/_some_annotations.html.erb b/app/views/admin_request/_some_annotations.html.erb index 7adcdc5bb..de470d26b 100644 --- a/app/views/admin_request/_some_annotations.html.erb +++ b/app/views/admin_request/_some_annotations.html.erb @@ -1,20 +1,20 @@ <% if comments.any? %> - <%= form_tag admin_user_modify_comment_visibility_path do %> + <%= form_tag modify_comment_visibility_admin_users_path do %> <div class="accordion" id="comments"> <% comments.each do |comment| %> <div class="accordion-group"> <div class="accordion-heading"> <%= check_box_tag 'comment_ids[]', comment.id %> - + <a href="#comment_<%= comment.id %>" data-toggle="collapse" data-parent="#comments"><%= chevron_right %></a> - - <%= link_to admin_request_edit_comment_path(comment) do %> + + <%= link_to edit_admin_comment_path(comment) do %> #<%= comment.id %> -- <%= h(comment.user.name) %> <%= admin_value(comment.created_at) %> <% end %> - + <%= comment_visibility(comment) %> <blockquote class="incoming-message"> @@ -58,4 +58,4 @@ <% end %> <% else %> <p>None yet.</p> -<% end %> +<% end %> diff --git a/app/views/admin_request/_some_requests.html.erb b/app/views/admin_request/_some_requests.html.erb index cff94956d..9a39cd0c0 100644 --- a/app/views/admin_request/_some_requests.html.erb +++ b/app/views/admin_request/_some_requests.html.erb @@ -4,10 +4,10 @@ <div class="accordion-heading accordion-toggle row"> <span class="item-title span6"> <a href="#request_<%=info_request.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a> - <%= link_to(info_request.title, admin_request_show_path(info_request), :title => "view full details") %> + <%= link_to(info_request.title, admin_request_path(info_request), :title => "view full details") %> </span> <span class="item-metadata span6"> - <%= user_admin_link_for_request(info_request) %> <%= arrow_right %> <%= link_to("#{info_request.public_body.name}", admin_body_show_path(info_request.public_body)) %>, <%= time_ago_in_words(info_request.updated_at) %> ago + <%= user_admin_link_for_request(info_request) %> <%= arrow_right %> <%= link_to("#{info_request.public_body.name}", admin_body_path(info_request.public_body)) %>, <%= time_ago_in_words(info_request.updated_at) %> ago </span> </div> <div id="request_<%=info_request.id%>" class="item-detail accordion-body collapse row"> diff --git a/app/views/admin_request/edit.html.erb b/app/views/admin_request/edit.html.erb index 552b31bbb..db0b54655 100644 --- a/app/views/admin_request/edit.html.erb +++ b/app/views/admin_request/edit.html.erb @@ -2,7 +2,7 @@ <%= error_messages_for 'info_request' %> -<%= form_tag admin_request_update_path(@info_request) do %> +<%= form_tag admin_request_path(@info_request), :method => :put do %> <p><label for="info_request_title"><strong>Title</strong></label> (warning: editing this will break URLs right now)<br/> <%= text_field 'info_request', 'title', :size => 50 %></p> @@ -43,15 +43,15 @@ <% end %> <p> -<%= link_to 'Show', admin_request_show_path(@info_request) %> | -<%= link_to 'List all', admin_request_list_path %> +<%= link_to 'Show', admin_request_path(@info_request) %> | +<%= link_to 'List all', admin_requests_path %> </p> <hr> <div class="well"> -<%= form_tag admin_request_destroy_path(@info_request) do %> +<%= form_tag admin_request_path(@info_request), :method => :delete do %> <p> <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely', :class => 'btn btn-danger' %> <br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It diff --git a/app/views/admin_request/list.html.erb b/app/views/admin_request/index.html.erb index 2bd3e3326..2bd3e3326 100644 --- a/app/views/admin_request/list.html.erb +++ b/app/views/admin_request/index.html.erb diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index 9c04badeb..dfb911ea7 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -2,8 +2,7 @@ <h1><%=@title%></h1> -<%= form_tag admin_request_move_request_path, { :class => "form form-horizontal" } do %> - <%= hidden_field_tag 'info_request_id', @info_request.id %> +<%= form_tag move_admin_request_path(@info_request), { :class => "form form-horizontal" } do %> <div class="accordion" id="info_request"> <div class="accordion-group"> <div class="accordion-heading"> @@ -16,7 +15,7 @@ <thead> <tr> <td colspan="2"> - <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %> + <%= link_to 'Edit metadata', edit_admin_request_path(@info_request), :class => "btn" %> </td> </tr> </thead> @@ -101,7 +100,7 @@ <tfoot> <tr> <td colspan="2"> - <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %> + <%= link_to 'Edit metadata', edit_admin_request_path(@info_request), :class => "btn" %> </td> </tr> </tfoot> @@ -117,11 +116,13 @@ FOI officer upload URL </label> <div class="controls"> - <%= link_to 'Generate URL', admin_request_generate_upload_url_path(@info_request), :class => "btn" %> + <%= form_tag generate_upload_url_admin_request_path(@info_request), :class => "form form-inline" do %> + <%= submit_tag "Generate URL", :class => "btn" %> + <% end %> <p class="help-block">(see also option to generate URLs for individual incoming messages below)</p> </div> </div> - <%= form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form", 'data-info-request-id' => @info_request.id.to_s do %> + <%= form_tag hide_admin_request_path(@info_request), :class => "form form-inline", :id => "hide_request_form", 'data-info-request-id' => @info_request.id.to_s do %> <div class="control-group"> <% if @info_request.is_external? %> <label class="control-label">Hide the request:</label> @@ -191,8 +192,7 @@ <tr> <td> <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %> - <%= form_tag admin_request_clarification_path, :class => "form form-inline admin-table-form admin-inline-form" do %> - <%= hidden_field_tag 'info_request_event_id', info_request_event.id, :id => nil %> + <%= form_tag admin_info_request_event_path(info_request_event), :method => 'put', :class => "form form-inline admin-table-form admin-inline-form" do %> <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %> <% end %> <% end %> @@ -233,7 +233,7 @@ <div class="accordion-group"> <div class="accordion-heading"> <a href="#outgoing_<%=outgoing_message.id%>" data-toggle="collapse" data-parent="#outgoing_messages"><%= chevron_right %></a> - <%= link_to admin_outgoing_edit_path(outgoing_message) do %> + <%= link_to edit_admin_outgoing_message_path(outgoing_message) do %> #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %> <% end %> <blockquote> @@ -245,8 +245,7 @@ <tbody> <tr> <td colspan="2"> - <%= form_tag admin_request_resend_path, :class => "admin-table-form" do %> - <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %> + <%= form_tag resend_admin_outgoing_message_path(outgoing_message), :class => "admin-table-form" do %> <%= submit_tag "Resend", :class => "btn" %> <% end %> </td> @@ -279,7 +278,7 @@ <div class="accordion-group"> <div class="accordion-heading"> <a href="#incoming_<%=incoming_message.id%>" data-toggle="collapse" data-parent="#incoming_messages"><%= chevron_right %></a> - <%= link_to admin_incoming_edit_path(incoming_message) do %> + <%= link_to edit_admin_incoming_message_path(incoming_message) do %> <%=incoming_message.id%> -- <%= h(incoming_message.mail_from) %> @@ -296,7 +295,7 @@ <thead> <tr> <td colspan="2" class="well"> - <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %> + <%= render :partial => 'admin_incoming_message/actions', :locals => { :incoming_message => incoming_message } %> </td> </tr> </thead> diff --git a/app/views/admin_track/_some_tracks.html.erb b/app/views/admin_track/_some_tracks.html.erb index e9facfb5d..c17350e4b 100644 --- a/app/views/admin_track/_some_tracks.html.erb +++ b/app/views/admin_track/_some_tracks.html.erb @@ -32,9 +32,8 @@ <% if include_destroy %> <tr> <td colspan="2"> - <%= form_tag admin_user_destroy_track_path, :class => "form form-inline admin-table-form" do %> + <%= form_tag admin_track_path(track_thing), :method => 'delete', :class => "form form-inline admin-table-form" do %> <div> - <%= hidden_field_tag 'track_id', track_thing.id %> <%= submit_tag "Destroy track", :class => "btn btn-warning" %> </div> <% end %> diff --git a/app/views/admin_track/list.html.erb b/app/views/admin_track/index.html.erb index 5e967a926..2b1dc5737 100644 --- a/app/views/admin_track/list.html.erb +++ b/app/views/admin_track/index.html.erb @@ -14,7 +14,7 @@ <h2>Current top tracks:</h2> <ol> <% for row in @popular %> - <li><%= link_to row['title'], admin_request_show_path(row['info_request_id']) %> (<%= row['count'] %> people following)</li> + <li><%= link_to row['title'], admin_request_path(row['info_request_id']) %> (<%= row['count'] %> people following)</li> <% end %> </ol> diff --git a/app/views/admin_user/_form.html.erb b/app/views/admin_user/_form.html.erb index f1edc0927..01273a657 100644 --- a/app/views/admin_user/_form.html.erb +++ b/app/views/admin_user/_form.html.erb @@ -41,7 +41,7 @@ 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 - <%= link_to 'banned users', admin_user_list_banned_path %> for examples</small> + <%= link_to 'banned users', banned_admin_users_path %> for examples</small> </div> </div> </div> diff --git a/app/views/admin_user/_user_table.html.erb b/app/views/admin_user/_user_table.html.erb index 57066bf3f..4fd90d5c6 100644 --- a/app/views/admin_user/_user_table.html.erb +++ b/app/views/admin_user/_user_table.html.erb @@ -7,7 +7,7 @@ <% if user.admin_level == "super" %> <span class="label">superuser</span> <% end %> - <%= link_to("#{h(user.name)}", admin_user_show_path(user))%> + <%= link_to("#{h(user.name)}", admin_user_path(user))%> <%= link_to("(#{h(user.email)})", "mailto:#{h(user.email)}")%> </span> <span class="item-metadata"> diff --git a/app/views/admin_user/list_banned.html.erb b/app/views/admin_user/banned.html.erb index e535415e6..ee17d9899 100644 --- a/app/views/admin_user/list_banned.html.erb +++ b/app/views/admin_user/banned.html.erb @@ -2,7 +2,7 @@ <h1><%=@title%></h1> -<p><%= link_to 'List all', admin_user_list_path %></p> +<p><%= link_to 'List all', admin_users_path %></p> <%= render :partial => 'user_table', :locals => { :users => @banned_users, :banned_column => true } %> diff --git a/app/views/admin_user/edit.html.erb b/app/views/admin_user/edit.html.erb index e641a13d6..ed1fb6e08 100644 --- a/app/views/admin_user/edit.html.erb +++ b/app/views/admin_user/edit.html.erb @@ -1,11 +1,11 @@ <h1><%=@title%></h1> -<%= form_tag admin_user_update_path(@admin_user), :class => "form form-horizontal" do %> +<%= form_tag admin_user_path(@admin_user), :method => 'put', :class => "form form-horizontal" do %> <%= render :partial => 'form' %> <div class="form-actions"> <%= submit_tag 'Save', :accesskey => 's', :class => "btn btn-primary" %> </div> <% end %> -<%= link_to 'Show', admin_user_show_path(@admin_user), :class => "btn" %> -<%= link_to 'List all', admin_user_list_path, :class => "btn" %> +<%= link_to 'Show', admin_user_path(@admin_user), :class => "btn" %> +<%= link_to 'List all', admin_users_path, :class => "btn" %> diff --git a/app/views/admin_user/list.html.erb b/app/views/admin_user/index.html.erb index b1238f87a..cfb34fd7b 100644 --- a/app/views/admin_user/list.html.erb +++ b/app/views/admin_user/index.html.erb @@ -5,7 +5,7 @@ <%= form_tag({}, :method => "get", :class => "form form-search") do %> <%= text_field_tag 'query', params[:query], { :size => 30, :class => "input-large search-query"} %> <%= submit_tag "Search", :class => "btn" %> (substring search, names and emails) - <%= link_to 'Banned users', admin_user_list_banned_path, :class => "btn btn-info" %> + <%= link_to 'Banned users', banned_admin_users_path, :class => "btn btn-info" %> <% end %> <%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %> diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb index 6d12aeff5..1e7d885c5 100644 --- a/app/views/admin_user/show.html.erb +++ b/app/views/admin_user/show.html.erb @@ -4,7 +4,7 @@ <% if @admin_user.profile_photo %> <div class="user_photo_on_admin"> - <%= form_tag admin_clear_profile_photo_path(@admin_user), :multipart => true, :class => "form" do %> + <%= form_tag clear_profile_photo_admin_user_path(@admin_user), :multipart => true, :class => "form" do %> <img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>"> <br> <%= submit_tag "Clear photo", :class => "btn btn-info" %> @@ -32,13 +32,13 @@ <%=link_to @admin_user.email, "mailto:#{h @admin_user.email}"%> <% elsif column_name == 'email_bounce_message' %> <% unless @admin_user.email_bounce_message.empty? %> - <%= link_to _("See bounce message"), admin_user_show_bounce_path(@admin_user.id) %> + <%= link_to _("See bounce message"), show_bounce_message_admin_user_path(@admin_user) %> <% end %> <% else %> <%=h admin_value(value)%> <% end %> <% if column_name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %> - <%= form_tag admin_user_clear_bounce_path(@admin_user), :class => "form form-inline" do %> + <%= form_tag clear_bounce_admin_user_path(@admin_user), :class => "form form-inline" do %> <input type="submit" name="action" value="Clear bounce" class="btn btn-info"> <% end %> <% end %> @@ -48,11 +48,13 @@ </tbody> </table> - -<%= link_to 'Edit', admin_user_edit_path(@admin_user), :class => "btn btn-primary" %> +<div class="btn-toolbar"> +<%= link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn btn-primary" %> <%= link_to 'Public page', user_path(@admin_user), :class => "btn" %> -<%= link_to "Log in as #{@admin_user.name} (also confirms their email)", admin_user_login_as_path(@admin_user), :class => "btn btn-info" %> - +</div> +<%= form_tag login_as_admin_user_path(@admin_user), :class => "form form-horizontal" do %> + <%= submit_tag "Log in as #{@admin_user.name} (also confirms their email)", :class => "btn btn-info" %> +<% end %> <hr> <h2>Track things</h2> diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb index cdcb3b85f..07017dabf 100644 --- a/app/views/comment/_single_comment.html.erb +++ b/app/views/comment/_single_comment.html.erb @@ -17,7 +17,7 @@ <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> - <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | + <%= link_to "Admin", edit_admin_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> diff --git a/app/views/comment/new.html.erb b/app/views/comment/new.html.erb index 578732cdb..48fe055ac 100644 --- a/app/views/comment/new.html.erb +++ b/app/views/comment/new.html.erb @@ -1,4 +1,5 @@ -<% @title = "Make an annotation on '" + h(@info_request.title) + "'" %> +<% @title = _("Add an annotation to “{{request_title}}”", + :request_title => h(@info_request.title)) %> <% if @existing_comment %> <div class="errorExplanation" id="errorExplanation"><ul> @@ -11,8 +12,10 @@ <%= foi_error_messages_for :comment %> -<h1><%= _('Add an annotation')%></h1> -<h2>to “<%=request_link(@info_request)%>”</h2> +<h1> + <%= _("Add an annotation to “{{request_title}}”", + :request_title => request_link(@info_request)) %> +</h1> <p> <%= _('Annotations are so anyone, including you, can help the requester with their request. For example:')%> diff --git a/app/views/contact_mailer/add_public_body.text.erb b/app/views/contact_mailer/add_public_body.text.erb index 5baa1fa1a..306a70432 100644 --- a/app/views/contact_mailer/add_public_body.text.erb +++ b/app/views/contact_mailer/add_public_body.text.erb @@ -13,7 +13,7 @@ <%= @change_request.notes %> <%= _('Add the authority:') %> -<%= admin_body_new_url(:change_request_id => @change_request.id, :only_path => false ) %> +<%= new_admin_body_url(:change_request_id => @change_request.id, :only_path => false ) %> <%= _('Close the request and respond:') %> -<%= admin_change_request_edit_url(:id => @change_request.id, :only_path => false ) %> +<%= edit_admin_change_request_url(@change_request, :only_path => false ) %> diff --git a/app/views/contact_mailer/update_public_body_email.text.erb b/app/views/contact_mailer/update_public_body_email.text.erb index 7d5a3dae0..e849463d0 100644 --- a/app/views/contact_mailer/update_public_body_email.text.erb +++ b/app/views/contact_mailer/update_public_body_email.text.erb @@ -10,7 +10,7 @@ <%= @change_request.notes %> <%= _('Update the address:') %> -<%= admin_body_edit_path(@change_request.public_body, :change_request_id => @change_request.id, :only_path => false) %> +<%= edit_admin_body_path(@change_request.public_body, :change_request_id => @change_request.id, :only_path => false) %> <%= _('Close the request and respond:') %> -<%= admin_change_request_edit_url(:id => @change_request.id, :only_path => false ) %> +<%= edit_admin_change_request_url(@change_request, :only_path => false ) %> diff --git a/app/views/general/exception_caught.html.erb b/app/views/general/exception_caught.html.erb index 8d78e2e92..21223dc1e 100644 --- a/app/views/general/exception_caught.html.erb +++ b/app/views/general/exception_caught.html.erb @@ -12,13 +12,10 @@ <%= submit_tag _("Search") %> <% end %> </li> - </ul> + </ul> <% else %> <h1><%= _("Sorry, there was a problem processing this page") %></h1> <p><%= _('You have found a bug. Please <a href="{{contact_url}}">contact us</a> to tell us about the problem', :contact_url => help_contact_path) %></p> <% end %> - <h2><%= _('Technical details') %></h2> - <p><strong><%= h(@exception_class ? @exception_class : _("Unknown")) %></strong></p> - <p><strong><%= h(@exception_message) %></strong></p> </div> diff --git a/app/views/general/search.html.erb b/app/views/general/search.html.erb index 3914a2f30..96c91b791 100644 --- a/app/views/general/search.html.erb +++ b/app/views/general/search.html.erb @@ -131,6 +131,7 @@ <div id="header_right"> <h2><%= _('Track this search')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> + <%= render :partial => 'track/rss_feed', :locals => { :track_thing => @track_thing, :location => 'main' } %> </div> <% end %> diff --git a/app/views/info_request_batch/_batch_sent.html.erb b/app/views/info_request_batch/_batch_sent.html.erb new file mode 100644 index 000000000..1bf51962f --- /dev/null +++ b/app/views/info_request_batch/_batch_sent.html.erb @@ -0,0 +1,18 @@ +<div id="notice"> + <p> + <%= _("Your requests will be <strong>sent</strong> shortly!") %> + </p> + + <p> + <%= _("<strong>We will email you</strong> when they have been sent. " \ + "We will also email you when there is a response to any of them, or " \ + "after {{late_number_of_days}} working days if the authorities still" \ + "haven't replied by then.", + :late_number_of_days => AlaveteliConfiguration::reply_late_after_days) %> + </p> + + <p> + <%= _("If you write about these requests (for example in a forum or a blog) " \ + "please link to this page.") %> + </p> +</div> diff --git a/app/views/info_request_batch/show.html.erb b/app/views/info_request_batch/show.html.erb index 8bb834b3c..b5db4ac52 100644 --- a/app/views/info_request_batch/show.html.erb +++ b/app/views/info_request_batch/show.html.erb @@ -1,4 +1,9 @@ <% @title = _("{{title}} - a batch request", :title => @info_request_batch.title) %> + +<% if flash[:batch_sent] %> + <%= render :partial => 'batch_sent' } %> +<% end %> + <div class="info_request_batch_intro"> <h1><%= @title %></h1> <% if @info_request_batch.sent_at %> diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 50abc59c3..56e6b3362 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -20,10 +20,14 @@ <% end %> <%= javascript_include_tag "application" %> + <% if @profile_photo_javascript %> <%= javascript_include_tag "profile-photos" %> <%= stylesheet_link_tag "jquery.Jcrop.css" %> <% end %> + <% if is_admin? %> + <%= javascript_include_tag "bootstrap-dropdown" %> + <% end %> <% if @feed_autodetect %> <% for feed in @feed_autodetect %> diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb index 011aea535..403216c6c 100644 --- a/app/views/public_body/show.html.erb +++ b/app/views/public_body/show.html.erb @@ -1,5 +1,16 @@ <% @title = h(@public_body.name) + _(" - view and make Freedom of Information requests") %> <div id="main_content"> + + <% if flash[:search_params] %> + <div class="back-to-results"> + <div class="message"> + <%= link_to select_authority_path(flash[:search_params]) do %> + <%= _('« Back to search results') %> + <% end %> + </div> + </div> + <% end %> + <div id="header_right"> <h2><%= _('Follow this authority')%></h2> @@ -12,6 +23,7 @@ </p> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + <%= render :partial => 'track/rss_feed', :locals => { :track_thing => @track_thing, :location => 'sidebar' } %> <%= render :partial => 'more_info', :locals => { :public_body => @public_body } %> </div> @@ -23,7 +35,7 @@ <%=@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"), admin_body_show_path(@public_body) %>) + (<%= link_to _("admin"), admin_body_path(@public_body) %>) <% end %> </p> @@ -91,7 +103,8 @@ <a name="results"></a> <% if @public_body.info_requests.size > 4 %> - <%= render :partial => 'request/request_filter_form' %> + <%= render :partial => 'request/request_search_form', + :locals => { :after_form_fields => render(:partial => 'request/request_filter_form') } %> <% end %> <% end %> diff --git a/app/views/request/_act.html.erb b/app/views/request/_act.html.erb index 1199cb4a2..878cdf4ff 100644 --- a/app/views/request/_act.html.erb +++ b/app/views/request/_act.html.erb @@ -1,7 +1,14 @@ <h2><%= _("Act on what you've learnt") %></h2> <div class="act_link"> - <% tweet_link = "https://twitter.com/share?" + {:url => request.url, :via => AlaveteliConfiguration::twitter_username, :text => "'#{@info_request.title}'", :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name)}.to_query %> + <% tweet_link = "https://twitter.com/share?" << { + :url => request.url, + :via => AlaveteliConfiguration.twitter_username, + :text => "'#{ @info_request.title }'", + :related => _('alaveteli_foi:The software that runs {{site_name}}', :site_name => site_name) + }.to_query + %> + <% link_to tweet_link do %> <%= image_tag "twitter-16.png", :alt => "twitter icon" %> <% end %> diff --git a/app/views/request/_incoming_correspondence.html.erb b/app/views/request/_incoming_correspondence.html.erb index f39d650d8..70bd25c7f 100644 --- a/app/views/request/_incoming_correspondence.html.erb +++ b/app/views/request/_incoming_correspondence.html.erb @@ -17,7 +17,7 @@ <p class="event_actions"> <% if !@user.nil? && @user.admin_page_links? %> - <%= link_to "Admin", admin_incoming_edit_path(incoming_message.id) %> | + <%= link_to "Admin", edit_admin_incoming_message_path(incoming_message.id) %> | <% end %> <%= link_to _("Link to this"), incoming_message_path(incoming_message), :class => "link_to_this" %> </p> diff --git a/app/views/request/_request_filter_form.html.erb b/app/views/request/_request_filter_form.html.erb index 090db01df..0983c8c57 100644 --- a/app/views/request/_request_filter_form.html.erb +++ b/app/views/request/_request_filter_form.html.erb @@ -1,41 +1,14 @@ -<%= render :partial => 'general/localised_datepicker' %> - -<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}) %> - <%= 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"> - <h3 class="title"><%= _("Showing") %></h3> - <div class="filter-request-types"> - <% statuses = [["all", _("all requests")], - ["successful", _("successful requests")], - ["unsuccessful", _("unsuccessful requests")], - ["awaiting", _("unresolved requests")]] %> - <% for status, label in statuses %> - <% if params[:view] != status %> - <% if params[:controller] == "public_body" %> - <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %> +<div class="list-filter-item"> + <h3 class="title"><%= _("Showing") %></h3> + <div class="filter-request-types"> + <% statuses = [["all", _("all requests")], + ["successful", _("successful requests")], + ["unsuccessful", _("unsuccessful requests")], + ["awaiting", _("unresolved requests")]] %> + <% statuses.each do |status, label| %> + <% if params[:view] != status %> + <% if params[:controller] == "public_body" %> + <%= link_to label, url_for(:controller => "public_body", :action => "show", :view => status, :url_name => @public_body.url_name) + "?" + request.query_string + '#results' %> <% else %> <%= link_to label, url_for(:controller => "request", :action => "list", :view => status) + "?" + request.query_string + '#results' %> <% end %> @@ -43,12 +16,6 @@ <%= label %> <% end %> <%= "|" unless statuses.last[0] == status %> - <% end %> - </div> - </div> - - <div class="list-filter-item"> - <%= submit_tag(_("Search")) %> - </div> -<% end %> + <% end %> + </div> </div> diff --git a/app/views/request/_request_search_form.html.erb b/app/views/request/_request_search_form.html.erb new file mode 100644 index 000000000..3f2f66950 --- /dev/null +++ b/app/views/request/_request_search_form.html.erb @@ -0,0 +1,35 @@ +<%= render :partial => 'general/localised_datepicker' %> + +<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}) %> + <%= 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) -%> + + <div class="list-filter-item"> + <%= submit_tag(_("Search")) %> + </div> +<% end %> +</div> diff --git a/app/views/request/_request_sent.html.erb b/app/views/request/_request_sent.html.erb new file mode 100644 index 000000000..5ce6f5317 --- /dev/null +++ b/app/views/request/_request_sent.html.erb @@ -0,0 +1,19 @@ +<div id="notice"> + <p> + <%= _("Your {{law_used_full}} request has been <strong>sent on its way</strong>!", + :law_used_full => @info_request.law_used_full) %> + </p> + + <p> + <%= _("<strong>We will email you</strong> when there is a response, or after " \ + "{{late_number_of_days}} working days if the authority still hasn't " \ + "replied by then.", + :late_number_of_days => AlaveteliConfiguration.reply_late_after_days) %> + </p> + + <p> + <%= _("If you write about this request (for example in a forum or a blog) " \ + "please link to this page, and add an annotation below telling people " \ + "about your writing.") %> + </p> +</div> diff --git a/app/views/request/_search_ahead.html.erb b/app/views/request/_search_ahead.html.erb index 1e65a5458..4fbe06ebc 100644 --- a/app/views/request/_search_ahead.html.erb +++ b/app/views/request/_search_ahead.html.erb @@ -1,14 +1,20 @@ -<div id="request_search_ahead_results"> - <% if !@xapian_requests.nil? %> - <% if @xapian_requests.results.size > 0 %> +<% unless @xapian_requests.nil? %> + <div id="request_search_ahead_results"> + <% if @xapian_requests.results.any? %> + <span class="close-button">X</span> <h3><%= _("Possibly related requests:") %></h3> - <% end %> - <% for result in @xapian_requests.results %> - <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> - <% end %> - <p> - <a id="body-site-search-link"><%= _("Or search in their website for this information.") %></a> - </p> - <% end %> -</div> + <% @xapian_requests.results.each do |result| %> + <%= render :partial => 'request/request_listing_short_via_event', + :locals => { :event => result[:model], + :info_request => result[:model].info_request } %> + <% end %> + + <p> + <a id="body-site-search-link"> + <%= _("Search in their website for this information →") %> + </a> + </p> + <% end %> + </div> +<% end %> diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb index 0f7965ffa..0d81ef111 100644 --- a/app/views/request/_sidebar.html.erb +++ b/app/views/request/_sidebar.html.erb @@ -10,6 +10,7 @@ :count => follower_count) %> </p> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user && @info_request.user == @user, :location => 'sidebar' } %> + <%= render :partial => 'track/rss_feed', :locals => { :track_thing => @track_thing, :location => 'sidebar' } %> </div> <% if @info_request.described_state != "attention_requested" %> <h2><%= _('Offensive? Unsuitable?') %></h2> diff --git a/app/views/request/details.html.erb b/app/views/request/details.html.erb index 3cb2f5afe..194820da6 100644 --- a/app/views/request/details.html.erb +++ b/app/views/request/details.html.erb @@ -1,5 +1,10 @@ -<% @title = _("Details of request '") + h(@info_request.title) + "'" %> -<h1><%= _("Details of request '") + request_link(@info_request) + "'" %></h1> +<% @title = _("Details of request “{{request_title}}”", + :request_title => h(@info_request.title)) %> + +<h1> + <%= _("Details of request “{{request_title}}”", + :request_title => request_link(@info_request)) %> +</h1> <h2><%= _('Event history') %></h2> diff --git a/app/views/request/followup_preview.html.erb b/app/views/request/followup_preview.html.erb index 55afc0245..83978a2f5 100644 --- a/app/views/request/followup_preview.html.erb +++ b/app/views/request/followup_preview.html.erb @@ -3,7 +3,7 @@ <div id="followup"> <%= form_for(@outgoing_message, :html => { :id => 'preview_form' }, :url => (@incoming_message.nil? ? show_response_no_followup_url(:id => @info_request.id) : show_response_url(:id => @info_request.id, :incoming_message_id => @incoming_message.id)) + "#followup" ) do |o| %> - + <% if @internal_review %> <h1><%= _('Now preview your message asking for an internal review') %></h1> <% else %> @@ -20,7 +20,7 @@ <div class="correspondence" id="outgoing-0"> <p class="preview_subject"> <strong><%= _('To:') %></strong> <%=h OutgoingMailer.name_for_followup(@info_request, @incoming_message) %> - <br><strong><%= _('Subject:') %></strong> <%=h OutgoingMailer.subject_for_followup(@info_request, @outgoing_message) %> + <br><strong><%= _('Subject:') %></strong> <%= OutgoingMailer.subject_for_followup(@info_request, @outgoing_message, :html => true) %> </p> <div class="correspondence_text"> diff --git a/app/views/request/list.html.erb b/app/views/request/list.html.erb index a465f03ba..75cb463ef 100644 --- a/app/views/request/list.html.erb +++ b/app/views/request/list.html.erb @@ -1,13 +1,14 @@ - <div id="header_left"> - <h1><%=@title%></h1> - <%= render :partial => 'request/request_filter_form' %> + <h1><%= @title %></h1> + <%= render :partial => 'request/request_search_form', + :locals => { :after_form_fields => render(:partial => 'request/request_filter_form') } %> </div> <div id="header_right"> <h2><%= _("Follow these requests") %></h2> <% if @track_thing %> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> + <%= render :partial => 'track/rss_feed', :locals => { :track_thing => @track_thing, :location => 'main' } %> <% end %> </div> diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 7f1332464..51224129e 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -1,19 +1,33 @@ <% unless @batch %> <script type="text/javascript"> $(document).ready(function(){ - // Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin: + // Avoid triggering too often (on each keystroke) by using the + // debounce jQuery plugin: // http://benalman.com/projects/jquery-throttle-debounce-plugin/ $("#typeahead_search").keypress($.debounce( 300, function() { - $("#typeahead_response").load("<%=search_ahead_url%>?q="+encodeURI(this.value), function() { - // When following links in typeahead results, open new tab/window - $("#typeahead_response a").attr("target","_blank"); - - // Update the public body site search link - $("#body-site-search-link").attr("href", "http://www.google.com/#q="+encodeURI($("#typeahead_search").val())+ - "+site:<%= @info_request.public_body.calculated_home_page %>"); + if ( $('#request_search_ahead_results').text().trim().length > 0) { + $('#typeahead_response').slideUp('fast'); + } + + $("#typeahead_response").load("<%= search_ahead_url %>?q="+encodeURI(this.value)+ + "&requested_from=<%= @info_request.public_body.url_name %>"+ + "&per_page=3", function() { + + if ( $('#request_search_ahead_results').text().trim().length > 0) { + $('#typeahead_response').hide().slideDown('fast'); + + // When following links in typeahead results, open new + // tab/window + $("#typeahead_response a").attr("target","_blank"); + + // Update the public body site search link + $("#body-site-search-link").attr("href", "http://www.google.com/#q="+encodeURI($("#typeahead_search").val())+ + "+site:<%= @info_request.public_body.calculated_home_page %>"); + + $('.close-button').click(function() { $(this).parent().hide() }); + } }); })); - }); </script> <% end %> diff --git a/app/views/request/preview.html.erb b/app/views/request/preview.html.erb index 0265d0328..ddd5ab30c 100644 --- a/app/views/request/preview.html.erb +++ b/app/views/request/preview.html.erb @@ -23,7 +23,7 @@ <% else %> <%=h(@info_request.public_body.name)%> <% end %> - <br><strong><%= _('Subject:') %></strong> <%=h @info_request.email_subject_request %> + <br><strong><%= _('Subject:') %></strong> <%= @info_request.email_subject_request %> </p> <div class="correspondence_text"> diff --git a/app/views/request/show.html.erb b/app/views/request/show.html.erb index 153b0b861..78e022aa9 100644 --- a/app/views/request/show.html.erb +++ b/app/views/request/show.html.erb @@ -2,6 +2,11 @@ :title => h(@info_request.title), :public_body => (@info_request.public_body.name)) %> +<% if flash[:request_sent] %> + <%= render :partial => 'request_sent', + :locals => { :info_request => @info_request } %> +<% end %> + <% if @info_request.prominence == 'hidden' %> <p id="hidden_request"> <%= _('This request has prominence \'hidden\'. You can only see it because you are logged @@ -37,9 +42,9 @@ :user => request_user_link(@info_request, _('An anonymous user')), :law_used_full => h(@info_request.law_used_full), :user_admin_link => user_admin_link_for_request(@info_request, _('external'), _('admin')), - :request_admin_url => admin_request_show_url(@info_request), + :request_admin_url => admin_request_url(@info_request), :public_body_link => public_body_link(@info_request.public_body), - :public_body_admin_url => admin_body_show_url(@info_request.public_body)) %> + :public_body_admin_url => admin_body_url(@info_request.public_body)) %> <% else %> <%= _('{{user}} made this {{law_used_full}} request', :user=>request_user_link(@info_request, _('An anonymous user')), @@ -51,19 +56,20 @@ <p id="request_status" class="request_icon_line icon_<%= @info_request.calculate_status %>"> <% if @info_request.awaiting_description %> <% if @is_owning_user && !@info_request.is_external? && !@render_to_file %> - <%= _('Please <strong>answer the question above</strong> so we know whether the ')%> - <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'recent response contains', 'recent responses contain') %> <%= _('useful information.') %> + <%= n_('Please <strong>answer the question above</strong> so we know whether the recent response contains useful information.', + 'Please <strong>answer the question above</strong> so we know whether the recent responses contain useful information.', + @new_responses_count) %> <% else %> <%= _('This request has an <strong>unknown status</strong>.') %> <% if @old_unclassified %> - <%= _('We\'re waiting for someone to read') %> - <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> - <%= _('and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?') %> + <%= n_("We're waiting for someone to read a recent response and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?", + "We're waiting for someone to read recent responses and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that?", + @new_responses_count) %> <% else %> - <%= _('We\'re waiting for') %> - <%= user_link_for_request(@info_request) %> <%= _('to read') %> - <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> - <%= _('and update the status.') %> + <%= n_("We're waiting for {{user}} to read a recent response and update the status.", + "We're waiting for {{user}} to read recent responses and update the status.", + @new_responses_count, + :user => user_link_for_request(@info_request)) %> <% end %> <% end %> <% elsif @status == 'waiting_response' %> diff --git a/app/views/request/show_response.html.erb b/app/views/request/show_response.html.erb index ace86cf4c..7571f147b 100644 --- a/app/views/request/show_response.html.erb +++ b/app/views/request/show_response.html.erb @@ -35,7 +35,7 @@ </dt> <dd> <%= _('To do that please send a private email to ') %><%=h(@postal_email_name)%> - <<%=link_to h(@postal_email), "mailto:" + @postal_email%>> + <<%=mail_to h(@postal_email) %>> <%= _('containing your postal address, and asking them to reply to this request. Or you could phone them.') %> diff --git a/app/views/track/_rss_feed.html.erb b/app/views/track/_rss_feed.html.erb new file mode 100644 index 000000000..4be46ffa9 --- /dev/null +++ b/app/views/track/_rss_feed.html.erb @@ -0,0 +1,4 @@ +<div class="feed_link feed_link_<%= location %>"> + <%= link_to image_tag('feed-16.png', :alt => "RSS icon"), do_track_path(track_thing, 'feed') %> + <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_path(track_thing, 'feed') %> +</div> diff --git a/app/views/track/_tracking_links.html.erb b/app/views/track/_tracking_links.html.erb index 5419ec605..8e0b07167 100644 --- a/app/views/track/_tracking_links.html.erb +++ b/app/views/track/_tracking_links.html.erb @@ -19,11 +19,6 @@ <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %> <% end %> </div> - - <div class="feed_link feed_link_<%=location%>"> - <%= link_to image_tag('feed-16.png', :alt => "RSS icon"), do_track_path(track_thing, 'feed') %> - <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_path(track_thing, 'feed') %> - </div> <% end %> diff --git a/app/views/user/_signin.html.erb b/app/views/user/_signin.html.erb index afc55d249..e86791aaf 100644 --- a/app/views/user/_signin.html.erb +++ b/app/views/user/_signin.html.erb @@ -14,11 +14,11 @@ <p> <label class="form_label" for="user_signin_password"><%= _('Password:')%></label> - <%= password_field 'user_signin', 'password', { :size => 15, :tabindex => 20 } %> + <%= password_field 'user_signin', 'password', { :size => 15, :tabindex => 20, :autocomplete => 'off' } %> </p> <p class="form_note"> - <%= link_to _('Forgotten your password?'), signchangepassword_path + "?pretoken=" + h(params[:token]), :tabindex => 30 %> + <%= link_to _('Forgotten your password?'), signchangepassword_path(:pretoken => h(params[:token])), :tabindex => 30 %> </p> <p class="form_checkbox"> diff --git a/app/views/user/show.html.erb b/app/views/user/show.html.erb index b23f74326..7c8d52568 100644 --- a/app/views/user/show.html.erb +++ b/app/views/user/show.html.erb @@ -34,6 +34,7 @@ <% if !@track_thing.nil? %> <h2><%= _('Track this person')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %> + <%= render :partial => 'track/rss_feed', :locals => { :track_thing => @track_thing, :location => 'sidebar' } %> <% end %> <% if !@xapian_requests.nil? %> <h2><%= _('On this page')%></h2> @@ -66,7 +67,7 @@ <p class="subtitle"> <%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= @display_user.created_at.year %> <% if !@user.nil? && @user.admin_page_links? %> - (<%= link_to "admin", admin_user_show_path(@display_user) %>) + (<%= link_to "admin", admin_user_path(@display_user) %>) <% end %> </p> diff --git a/app/views/user/sign.html.erb b/app/views/user/sign.html.erb index e8c5d5a58..5536e6c73 100644 --- a/app/views/user/sign.html.erb +++ b/app/views/user/sign.html.erb @@ -1,52 +1,51 @@ - <% if !@post_redirect.nil? && @post_redirect.reason_params[:user_name] %> <% @title = _("Sign in") %> <div id="sign_alone"> - <p id="sign_in_reason"> - <% if @post_redirect.reason_params[:web].empty? %> - <%= _('Please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>. - <% else %> - <%= @post_redirect.reason_params[:web] %>, - <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>. - <% end %> - </p> - <% if @post_redirect.post_params["controller"] == "admin_general" %> - <% unless AlaveteliConfiguration::disable_emergency_user %> - <p id="superuser_message"><%= _("Don't have a superuser account yet?") %> <%= link_to _("Sign in as the emergency user"), @post_redirect.uri + "?emergency=1" %></p> + <p id="sign_in_reason"> + <% if @post_redirect.reason_params[:web].empty? %> + <%= _('Please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>. + <% else %> + <%= @post_redirect.reason_params[:web] %>, + <%= _('please sign in as ')%><%= link_to h(@post_redirect.reason_params[:user_name]), @post_redirect.reason_params[:user_url] %>. <% end %> - <% end %> + </p> - <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => true } %> + <% if @post_redirect.post_params["controller"] == "admin_general" %> + <% unless AlaveteliConfiguration::disable_emergency_user %> + <p id="superuser_message"><%= _("Don't have a superuser account yet?") %> <%= link_to _("Sign in as the emergency user"), @post_redirect.uri + "?emergency=1" %></p> + <% end %> + <% end %> + <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => true } %> </div> - <% else %> <% @title = _('Sign in or make a new account') %> <div id="sign_together"> - <% if !@post_redirect.nil? %> - <p id="sign_in_reason"> - <% if @post_redirect.reason_params[:web].empty? %> - <%= _('Please sign in or make a new account.') %> - <% else %> - <%= _('{{reason}}, please sign in or make a new account.', :reason => @post_redirect.reason_params[:web]) %> - <% end %> - </p> - <% end %> + <% if !@post_redirect.nil? %> + <p id="sign_in_reason"> + <% if @post_redirect.reason_params[:web].empty? %> + <%= _('Please sign in or make a new account.') %> + <% else %> + <%= _('{{reason}}, please sign in or make a new account.', :reason => @post_redirect.reason_params[:web]) %> + <% end %> + </p> + <% end %> <div id="left_half"> - <h1><%= _('Sign in') %></h1> - <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %> + <h1><%= _('Sign up') %></h1> + <%= render :partial => 'signup' %> </div> + <div id="middle_strip"> - <%= _('- or -') %> + <%= _('- or -') %> </div> + <div id="right_half"> - <h1><%= _('Sign up') %></h1> - <%= render :partial => 'signup' %> + <h1><%= _('Sign in') %></h1> + <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %> </div> + <div style="clear:both"></div> </div> - <% end %> - diff --git a/app/views/user/signchangeemail.html.erb b/app/views/user/signchangeemail.html.erb index 7308179f4..a99bcb785 100644 --- a/app/views/user/signchangeemail.html.erb +++ b/app/views/user/signchangeemail.html.erb @@ -23,7 +23,7 @@ <p> <label class="form_label" for="signchangeemail_password"> <%= _('Your password:')%></label> - <%= password_field 'signchangeemail', 'password', { :size => 15 } %> + <%= password_field 'signchangeemail', 'password', { :size => 15, :autocomplete => 'off' } %> </p> <p class="form_note"> diff --git a/app/views/user/signchangepassword.html.erb b/app/views/user/signchangepassword.html.erb index 51bcb466d..60f5d2c62 100644 --- a/app/views/user/signchangepassword.html.erb +++ b/app/views/user/signchangepassword.html.erb @@ -13,12 +13,12 @@ <p> <label class="form_label" for="user_password"><%= _('New password:')%></label> - <%= password_field 'user', 'password', { :size => 15 } %> + <%= password_field 'user', 'password', { :size => 15, :autocomplete => 'off' } %> </p> <p> <label class="form_label" for="user_password_confirmation"><%= _('New password: (again)')%></label> - <%= password_field 'user', 'password_confirmation', { :size => 15 } %> + <%= password_field 'user', 'password_confirmation', { :size => 15, :autocomplete => 'off' } %> </p> <div class="form_button"> |