aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_censor_rule/_form.html.erb75
-rw-r--r--app/views/admin_censor_rule/_form.rhtml40
-rw-r--r--app/views/admin_censor_rule/_show.html.erb (renamed from app/views/admin_censor_rule/_show.rhtml)12
-rw-r--r--app/views/admin_censor_rule/edit.html.erb18
-rw-r--r--app/views/admin_censor_rule/edit.rhtml16
-rw-r--r--app/views/admin_censor_rule/new.html.erb11
-rw-r--r--app/views/admin_censor_rule/new.rhtml9
-rw-r--r--app/views/admin_general/_admin_navbar.html.erb22
-rw-r--r--app/views/admin_general/_change_request_summary.html.erb60
-rw-r--r--app/views/admin_general/debug.html.erb (renamed from app/views/admin_general/debug.rhtml)17
-rw-r--r--app/views/admin_general/index.html.erb215
-rw-r--r--app/views/admin_general/index.rhtml109
-rw-r--r--app/views/admin_general/stats.html.erb60
-rw-r--r--app/views/admin_general/stats.rhtml38
-rw-r--r--app/views/admin_general/timeline.html.erb (renamed from app/views/admin_general/timeline.rhtml)34
-rw-r--r--app/views/admin_incoming_message/_intro.html.erb3
-rw-r--r--app/views/admin_incoming_message/edit.html.erb26
-rw-r--r--app/views/admin_outgoing_message/edit.html.erb50
-rw-r--r--app/views/admin_public_body/_form.html.erb102
-rw-r--r--app/views/admin_public_body/_form.rhtml65
-rw-r--r--app/views/admin_public_body/_locale_selector.rhtml10
-rw-r--r--app/views/admin_public_body/_one_list.html.erb44
-rw-r--r--app/views/admin_public_body/_one_list.rhtml29
-rw-r--r--app/views/admin_public_body/_tag_help.html.erb16
-rw-r--r--app/views/admin_public_body/_tag_help.rhtml18
-rw-r--r--app/views/admin_public_body/_tags.html.erb12
-rw-r--r--app/views/admin_public_body/_tags.rhtml11
-rw-r--r--app/views/admin_public_body/edit.html.erb34
-rw-r--r--app/views/admin_public_body/edit.rhtml30
-rw-r--r--app/views/admin_public_body/import_csv.html.erb (renamed from app/views/admin_public_body/import_csv.rhtml)37
-rw-r--r--app/views/admin_public_body/list.html.erb42
-rw-r--r--app/views/admin_public_body/list.rhtml40
-rw-r--r--app/views/admin_public_body/missing_scheme.html.erb (renamed from app/views/admin_public_body/missing_scheme.rhtml)0
-rw-r--r--app/views/admin_public_body/new.html.erb25
-rw-r--r--app/views/admin_public_body/new.rhtml22
-rw-r--r--app/views/admin_public_body/show.html.erb93
-rw-r--r--app/views/admin_public_body/show.rhtml83
-rw-r--r--app/views/admin_public_body_change_requests/_response.html.erb15
-rw-r--r--app/views/admin_public_body_change_requests/add_accepted.txt.erb9
-rw-r--r--app/views/admin_public_body_change_requests/edit.html.erb8
-rw-r--r--app/views/admin_public_body_change_requests/update_accepted.txt.erb7
-rw-r--r--app/views/admin_request/_incoming_message_actions.html.erb45
-rw-r--r--app/views/admin_request/_incoming_message_actions.rhtml26
-rw-r--r--app/views/admin_request/_some_annotations.html.erb48
-rw-r--r--app/views/admin_request/_some_requests.html.erb32
-rw-r--r--app/views/admin_request/_some_requests.rhtml31
-rw-r--r--app/views/admin_request/_tags.html.erb (renamed from app/views/admin_request/_tags.rhtml)0
-rw-r--r--app/views/admin_request/edit.html.erb (renamed from app/views/admin_request/edit.rhtml)20
-rw-r--r--app/views/admin_request/edit_comment.html.erb (renamed from app/views/admin_request/edit_comment.rhtml)8
-rw-r--r--app/views/admin_request/edit_outgoing.rhtml33
-rw-r--r--app/views/admin_request/hidden_user_explanation.html.erb10
-rw-r--r--app/views/admin_request/hidden_user_explanation.rhtml9
-rw-r--r--app/views/admin_request/list.html.erb13
-rw-r--r--app/views/admin_request/list.rhtml15
-rw-r--r--app/views/admin_request/list_old_unclassified.rhtml16
-rw-r--r--app/views/admin_request/show.html.erb346
-rw-r--r--app/views/admin_request/show.rhtml230
-rw-r--r--app/views/admin_request/show_raw_email.html.erb63
-rw-r--r--app/views/admin_request/show_raw_email.rhtml37
-rw-r--r--app/views/admin_track/_some_tracks.html.erb74
-rw-r--r--app/views/admin_track/_some_tracks.rhtml31
-rw-r--r--app/views/admin_track/list.html.erb20
-rw-r--r--app/views/admin_track/list.rhtml39
-rw-r--r--app/views/admin_user/_form.html.erb75
-rw-r--r--app/views/admin_user/_form.rhtml27
-rw-r--r--app/views/admin_user/_user_table.html.erb47
-rw-r--r--app/views/admin_user/_user_table.rhtml22
-rw-r--r--app/views/admin_user/edit.html.erb11
-rw-r--r--app/views/admin_user/edit.rhtml23
-rw-r--r--app/views/admin_user/list.html.erb13
-rw-r--r--app/views/admin_user/list.rhtml15
-rw-r--r--app/views/admin_user/list_banned.html.erb (renamed from app/views/admin_user/list_banned.rhtml)2
-rw-r--r--app/views/admin_user/show.html.erb102
-rw-r--r--app/views/admin_user/show.rhtml74
-rw-r--r--app/views/admin_user/show_bounce_message.html.erb (renamed from app/views/admin_user/show_bounce_message.rhtml)0
-rw-r--r--app/views/api/request_events.atom.builder4
-rw-r--r--app/views/comment/_comment_form.html.erb (renamed from app/views/comment/_comment_form.rhtml)6
-rw-r--r--app/views/comment/_single_comment.html.erb (renamed from app/views/comment/_single_comment.rhtml)10
-rw-r--r--app/views/comment/_single_comment.text.erb2
-rw-r--r--app/views/comment/new.html.erb (renamed from app/views/comment/new.rhtml)6
-rw-r--r--app/views/comment/preview.html.erb (renamed from app/views/comment/preview.rhtml)2
-rw-r--r--app/views/contact_mailer/add_public_body.text.erb19
-rw-r--r--app/views/contact_mailer/from_admin_message.rhtml2
-rw-r--r--app/views/contact_mailer/from_admin_message.text.erb1
-rw-r--r--app/views/contact_mailer/to_admin_message.rhtml11
-rw-r--r--app/views/contact_mailer/to_admin_message.text.erb11
-rw-r--r--app/views/contact_mailer/update_public_body_email.text.erb16
-rw-r--r--app/views/contact_mailer/user_message.text.erb (renamed from app/views/contact_mailer/user_message.rhtml)2
-rw-r--r--app/views/general/_advanced_search_tips.html.erb (renamed from app/views/general/_advanced_search_tips.rhtml)37
-rw-r--r--app/views/general/_before_body_end.html.erb (renamed from app/views/general/_before_body_end.rhtml)0
-rw-r--r--app/views/general/_before_head_end.html.erb (renamed from app/views/general/_before_head_end.rhtml)0
-rw-r--r--app/views/general/_credits.html.erb (renamed from app/views/general/_credits.rhtml)0
-rw-r--r--app/views/general/_custom_state_descriptions.html.erb (renamed from app/views/general/_custom_state_descriptions.rhtml)0
-rw-r--r--app/views/general/_custom_state_transitions_complete.html.erb (renamed from app/views/general/_custom_state_transitions_complete.rhtml)0
-rw-r--r--app/views/general/_custom_state_transitions_pending.html.erb (renamed from app/views/general/_custom_state_transitions_pending.rhtml)0
-rw-r--r--app/views/general/_footer.html.erb8
-rw-r--r--app/views/general/_footer.rhtml6
-rw-r--r--app/views/general/_frontpage_bodies_list.html.erb (renamed from app/views/general/_frontpage_bodies_list.rhtml)9
-rw-r--r--app/views/general/_frontpage_intro_sentence.html.erb (renamed from app/views/general/_frontpage_intro_sentence.rhtml)2
-rw-r--r--app/views/general/_frontpage_new_request.html.erb (renamed from app/views/general/_frontpage_new_request.rhtml)0
-rw-r--r--app/views/general/_frontpage_requests_list.html.erb (renamed from app/views/general/_frontpage_requests_list.rhtml)9
-rw-r--r--app/views/general/_frontpage_search_box.html.erb (renamed from app/views/general/_frontpage_search_box.rhtml)2
-rw-r--r--app/views/general/_header.html.erb37
-rw-r--r--app/views/general/_locale_switcher.html.erb (renamed from app/views/general/_locale_switcher.rhtml)4
-rw-r--r--app/views/general/_localised_datepicker.html.erb (renamed from app/views/general/_localised_datepicker.rhtml)10
-rw-r--r--app/views/general/_orglink.html.erb2
-rw-r--r--app/views/general/_orglink.rhtml2
-rw-r--r--app/views/general/_popup_banner.html.erb (renamed from app/views/admin_general/_admin_navbar.rhtml)0
-rw-r--r--app/views/general/_popup_banner.rhtml1
-rw-r--r--app/views/general/_stylesheet_includes.html.erb22
-rw-r--r--app/views/general/_stylesheet_includes.rhtml21
-rw-r--r--app/views/general/_topnav.html.erb (renamed from app/views/general/_topnav.rhtml)14
-rw-r--r--app/views/general/blog.html.erb (renamed from app/views/general/blog.rhtml)18
-rw-r--r--app/views/general/custom_css.rhtml1
-rw-r--r--app/views/general/exception_caught.html.erb (renamed from app/views/general/exception_caught.rhtml)4
-rw-r--r--app/views/general/frontpage.html.erb (renamed from app/views/general/frontpage.rhtml)3
-rw-r--r--app/views/general/search.html.erb (renamed from app/views/general/search.rhtml)59
-rw-r--r--app/views/help/_sidebar.html.erb (renamed from app/views/help/_sidebar.rhtml)0
-rw-r--r--app/views/help/_why_they_should_reply_by_email.html.erb (renamed from app/views/help/_why_they_should_reply_by_email.rhtml)0
-rw-r--r--app/views/help/about.html.erb (renamed from app/views/help/about.rhtml)0
-rw-r--r--app/views/help/alaveteli.html.erb (renamed from app/views/help/alaveteli.rhtml)0
-rw-r--r--app/views/help/api.html.erb (renamed from app/views/help/api.rhtml)26
-rw-r--r--app/views/help/contact.html.erb (renamed from app/views/help/contact.rhtml)4
-rw-r--r--app/views/help/credits.html.erb (renamed from app/views/help/credits.rhtml)0
-rw-r--r--app/views/help/officers.html.erb (renamed from app/views/help/officers.rhtml)11
-rw-r--r--app/views/help/privacy.html.erb (renamed from app/views/help/privacy.rhtml)7
-rw-r--r--app/views/help/requesting.html.erb (renamed from app/views/help/requesting.rhtml)4
-rw-r--r--app/views/help/unhappy.html.erb (renamed from app/views/help/unhappy.rhtml)4
-rw-r--r--app/views/holiday/due_date.html.erb (renamed from app/views/holiday/due_date.rhtml)0
-rw-r--r--app/views/info_request_batch/_info_request_batch.html.erb15
-rw-r--r--app/views/info_request_batch/show.html.erb25
-rw-r--r--app/views/info_request_batch_mailer/batch_sent.text.erb15
-rw-r--r--app/views/layouts/_favicon.html.erb1
-rw-r--r--app/views/layouts/admin.html.erb37
-rw-r--r--app/views/layouts/admin.rhtml39
-rw-r--r--app/views/layouts/contact_mailer.html.erb (renamed from app/views/layouts/contact_mailer.rhtml)0
-rw-r--r--app/views/layouts/default.html.erb (renamed from app/views/layouts/default.rhtml)85
-rw-r--r--app/views/layouts/no_chrome.html.erb (renamed from app/views/layouts/no_chrome.rhtml)22
-rw-r--r--app/views/layouts/outgoing_mailer.html.erb (renamed from app/views/layouts/outgoing_mailer.rhtml)0
-rw-r--r--app/views/layouts/request_mailer.html.erb (renamed from app/views/layouts/request_mailer.rhtml)0
-rw-r--r--app/views/layouts/user_mailer.html.erb (renamed from app/views/layouts/user_mailer.rhtml)0
-rw-r--r--app/views/outgoing_mailer/_followup_footer.text.erb (renamed from app/views/outgoing_mailer/_followup_footer.rhtml)0
-rw-r--r--app/views/outgoing_mailer/followup.text.erb (renamed from app/views/outgoing_mailer/followup.rhtml)4
-rw-r--r--app/views/outgoing_mailer/initial_request.text.erb (renamed from app/views/outgoing_mailer/initial_request.rhtml)4
-rw-r--r--app/views/public_body/_alphabet.html.erb3
-rw-r--r--app/views/public_body/_alphabet.rhtml3
-rw-r--r--app/views/public_body/_body_listing.html.erb (renamed from app/views/public_body/_body_listing.rhtml)0
-rw-r--r--app/views/public_body/_body_listing_single.html.erb (renamed from app/views/public_body/_body_listing_single.rhtml)15
-rw-r--r--app/views/public_body/_list_sidebar_extra.html.erb6
-rw-r--r--app/views/public_body/_list_sidebar_extra.rhtml6
-rw-r--r--app/views/public_body/_search_ahead.html.erb (renamed from app/views/public_body/_search_ahead.rhtml)11
-rw-r--r--app/views/public_body/list.html.erb (renamed from app/views/public_body/list.rhtml)18
-rw-r--r--app/views/public_body/show.html.erb (renamed from app/views/public_body/show.rhtml)80
-rw-r--r--app/views/public_body/statistics.html.erb75
-rw-r--r--app/views/public_body/view_email.html.erb (renamed from app/views/public_body/view_email.rhtml)12
-rw-r--r--app/views/public_body/view_email_captcha.html.erb (renamed from app/views/public_body/view_email_captcha.rhtml)2
-rw-r--r--app/views/public_body_change_requests/new.html.erb61
-rw-r--r--app/views/reports/new.html.erb26
-rw-r--r--app/views/request/_act.html.erb15
-rw-r--r--app/views/request/_after_actions.html.erb (renamed from app/views/request/_after_actions.rhtml)16
-rw-r--r--app/views/request/_bubble.html.erb (renamed from app/views/request/_bubble.rhtml)14
-rw-r--r--app/views/request/_correspondence.html.erb12
-rw-r--r--app/views/request/_correspondence.rhtml80
-rw-r--r--app/views/request/_describe_state.html.erb (renamed from app/views/request/_describe_state.rhtml)15
-rw-r--r--app/views/request/_followup.html.erb (renamed from app/views/request/_followup.rhtml)32
-rw-r--r--app/views/request/_hidden_correspondence.html.erb13
-rw-r--r--app/views/request/_hidden_correspondence.rhtml33
-rw-r--r--app/views/request/_hidden_correspondence.text.erb5
-rw-r--r--app/views/request/_incoming_correspondence.html.erb26
-rw-r--r--app/views/request/_incoming_correspondence.text.erb12
-rw-r--r--app/views/request/_list_results.html.erb12
-rw-r--r--app/views/request/_next_actions.html.erb (renamed from app/views/request/_next_actions.rhtml)0
-rw-r--r--app/views/request/_other_describe_state.html.erb (renamed from app/views/request/_other_describe_state.rhtml)3
-rw-r--r--app/views/request/_outgoing_correspondence.html.erb18
-rw-r--r--app/views/request/_outgoing_correspondence.text.erb8
-rw-r--r--app/views/request/_request_filter_form.html.erb (renamed from app/views/request/_request_filter_form.rhtml)2
-rw-r--r--app/views/request/_request_listing.html.erb (renamed from app/views/request/_request_listing.rhtml)0
-rw-r--r--app/views/request/_request_listing_short_via_event.html.erb (renamed from app/views/request/_request_listing_short_via_event.rhtml)6
-rw-r--r--app/views/request/_request_listing_single.html.erb (renamed from app/views/request/_request_listing_single.rhtml)10
-rw-r--r--app/views/request/_request_listing_via_event.html.erb (renamed from app/views/request/_request_listing_via_event.rhtml)8
-rw-r--r--app/views/request/_resent_outgoing_correspondence.html.erb16
-rw-r--r--app/views/request/_resent_outgoing_correspondence.text.erb2
-rw-r--r--app/views/request/_restricted_correspondence.html.erb18
-rw-r--r--app/views/request/_search_ahead.html.erb (renamed from app/views/request/_search_ahead.rhtml)0
-rw-r--r--app/views/request/_sidebar.html.erb58
-rw-r--r--app/views/request/_sidebar.rhtml68
-rw-r--r--app/views/request/_sidebar_request_listing.html.erb (renamed from app/views/request/_sidebar_request_listing.rhtml)0
-rw-r--r--app/views/request/_summary_suggestion.html.erb (renamed from app/views/request/_summary_suggestion.rhtml)0
-rw-r--r--app/views/request/_view_html_prefix.html.erb (renamed from app/views/request/_view_html_prefix.rhtml)6
-rw-r--r--app/views/request/_view_html_stylesheet.html.erb1
-rw-r--r--app/views/request/_view_html_stylesheet.rhtml1
-rw-r--r--app/views/request/_wall_listing.html.erb (renamed from app/views/request/_wall_listing.rhtml)6
-rw-r--r--app/views/request/batch_not_allowed.html.erb1
-rw-r--r--app/views/request/describe_state_message.html.erb30
-rw-r--r--app/views/request/details.html.erb (renamed from app/views/request/details.rhtml)4
-rw-r--r--app/views/request/followup_bad.html.erb (renamed from app/views/request/followup_bad.rhtml)12
-rw-r--r--app/views/request/followup_preview.html.erb (renamed from app/views/request/followup_preview.rhtml)4
-rw-r--r--app/views/request/hidden.html.erb19
-rw-r--r--app/views/request/hidden.rhtml19
-rw-r--r--app/views/request/hidden_correspondence.html.erb4
-rw-r--r--app/views/request/list.html.erb24
-rw-r--r--app/views/request/list.rhtml34
-rw-r--r--app/views/request/new.html.erb194
-rw-r--r--app/views/request/new.rhtml154
-rw-r--r--app/views/request/new_bad_contact.html.erb (renamed from app/views/request/new_bad_contact.rhtml)0
-rw-r--r--app/views/request/new_please_describe.html.erb (renamed from app/views/request/new_please_describe.rhtml)4
-rw-r--r--app/views/request/preview.html.erb62
-rw-r--r--app/views/request/preview.rhtml48
-rw-r--r--app/views/request/select_authorities.html.erb77
-rw-r--r--app/views/request/select_authority.html.erb (renamed from app/views/request/select_authority.rhtml)49
-rw-r--r--app/views/request/show.html.erb (renamed from app/views/request/show.rhtml)30
-rw-r--r--app/views/request/show.text.erb17
-rw-r--r--app/views/request/show_response.html.erb (renamed from app/views/request/show_response.rhtml)12
-rw-r--r--app/views/request/similar.html.erb (renamed from app/views/request/similar.rhtml)15
-rw-r--r--app/views/request/simple_correspondence.rhtml45
-rw-r--r--app/views/request/upload_response.html.erb (renamed from app/views/request/upload_response.rhtml)6
-rw-r--r--app/views/request_game/play.html.erb (renamed from app/views/request_game/play.rhtml)8
-rw-r--r--app/views/request_mailer/comment_on_alert.text.erb (renamed from app/views/request_mailer/comment_on_alert.rhtml)0
-rw-r--r--app/views/request_mailer/comment_on_alert_plural.text.erb (renamed from app/views/request_mailer/comment_on_alert_plural.rhtml)0
-rw-r--r--app/views/request_mailer/external_response.rhtml1
-rw-r--r--app/views/request_mailer/external_response.text.erb1
-rw-r--r--app/views/request_mailer/fake_response.rhtml1
-rw-r--r--app/views/request_mailer/fake_response.text.erb1
-rw-r--r--app/views/request_mailer/new_response.text.erb (renamed from app/views/request_mailer/new_response.rhtml)4
-rw-r--r--app/views/request_mailer/new_response_reminder_alert.text.erb (renamed from app/views/request_mailer/new_response_reminder_alert.rhtml)2
-rw-r--r--app/views/request_mailer/not_clarified_alert.text.erb (renamed from app/views/request_mailer/not_clarified_alert.rhtml)0
-rw-r--r--app/views/request_mailer/old_unclassified_updated.text.erb (renamed from app/views/request_mailer/old_unclassified_updated.rhtml)0
-rw-r--r--app/views/request_mailer/overdue_alert.text.erb (renamed from app/views/request_mailer/overdue_alert.rhtml)2
-rw-r--r--app/views/request_mailer/requires_admin.text.erb (renamed from app/views/request_mailer/requires_admin.rhtml)6
-rw-r--r--app/views/request_mailer/stopped_responses.text.erb (renamed from app/views/request_mailer/stopped_responses.rhtml)0
-rw-r--r--app/views/request_mailer/very_overdue_alert.text.erb (renamed from app/views/request_mailer/very_overdue_alert.rhtml)2
-rw-r--r--app/views/track/_tracking_links.html.erb (renamed from app/views/track/_tracking_links.rhtml)12
-rw-r--r--app/views/track/atom_feed.atom.erb2
-rw-r--r--app/views/track_mailer/event_digest.text.erb (renamed from app/views/track_mailer/event_digest.rhtml)8
-rw-r--r--app/views/user/_change_receive_email.html.erb (renamed from app/views/user/_change_receive_email.rhtml)2
-rw-r--r--app/views/user/_show_user_info.html.erb (renamed from app/views/user/_show_user_info.rhtml)10
-rw-r--r--app/views/user/_signin.html.erb (renamed from app/views/user/_signin.rhtml)4
-rw-r--r--app/views/user/_signup.html.erb (renamed from app/views/user/_signup.rhtml)20
-rw-r--r--app/views/user/_user_listing_single.html.erb (renamed from app/views/user/_user_listing_single.rhtml)4
-rw-r--r--app/views/user/bad_token.html.erb (renamed from app/views/user/bad_token.rhtml)0
-rw-r--r--app/views/user/banned.html.erb (renamed from app/views/user/banned.rhtml)0
-rw-r--r--app/views/user/confirm.html.erb (renamed from app/views/user/confirm.rhtml)0
-rw-r--r--app/views/user/contact.html.erb (renamed from app/views/user/contact.rhtml)2
-rw-r--r--app/views/user/no_cookies.html.erb (renamed from app/views/user/no_cookies.rhtml)4
-rw-r--r--app/views/user/rate_limited.html.erb (renamed from app/views/user/rate_limited.rhtml)2
-rw-r--r--app/views/user/river.html.erb (renamed from app/views/user/river.rhtml)0
-rw-r--r--app/views/user/set_crop_profile_photo.html.erb (renamed from app/views/user/set_crop_profile_photo.rhtml)4
-rw-r--r--app/views/user/set_draft_profile_photo.html.erb (renamed from app/views/user/set_draft_profile_photo.rhtml)6
-rw-r--r--app/views/user/set_profile_about_me.html.erb (renamed from app/views/user/set_profile_about_me.rhtml)4
-rw-r--r--app/views/user/show.html.erb (renamed from app/views/user/show.rhtml)39
-rw-r--r--app/views/user/sign.html.erb (renamed from app/views/user/sign.rhtml)4
-rw-r--r--app/views/user/signchangeemail.html.erb (renamed from app/views/user/signchangeemail.rhtml)2
-rw-r--r--app/views/user/signchangeemail_confirm.html.erb (renamed from app/views/user/signchangeemail_confirm.rhtml)0
-rw-r--r--app/views/user/signchangepassword.html.erb (renamed from app/views/user/signchangepassword.rhtml)2
-rw-r--r--app/views/user/signchangepassword_confirm.html.erb (renamed from app/views/user/signchangepassword_confirm.rhtml)0
-rw-r--r--app/views/user/signchangepassword_send_confirm.html.erb (renamed from app/views/user/signchangepassword_send_confirm.rhtml)2
-rw-r--r--app/views/user/signin_successful.html.erb (renamed from app/views/user/signin_successful.rhtml)0
-rw-r--r--app/views/user/wall.html.erb19
-rw-r--r--app/views/user/wall.rhtml16
-rw-r--r--app/views/user/wrong_user.html.erb (renamed from app/views/user/wrong_user.rhtml)0
-rw-r--r--app/views/user/wrong_user_unknown_email.html.erb8
-rw-r--r--app/views/user/wrong_user_unknown_email.rhtml8
-rw-r--r--app/views/user_mailer/already_registered.text.erb (renamed from app/views/user_mailer/already_registered.rhtml)4
-rw-r--r--app/views/user_mailer/changeemail_already_used.text.erb (renamed from app/views/user_mailer/changeemail_already_used.rhtml)0
-rw-r--r--app/views/user_mailer/changeemail_confirm.text.erb (renamed from app/views/user_mailer/changeemail_confirm.rhtml)2
-rw-r--r--app/views/user_mailer/confirm_login.text.erb (renamed from app/views/user_mailer/confirm_login.rhtml)4
266 files changed, 3437 insertions, 2273 deletions
diff --git a/app/views/admin_censor_rule/_form.html.erb b/app/views/admin_censor_rule/_form.html.erb
new file mode 100644
index 000000000..5035238d6
--- /dev/null
+++ b/app/views/admin_censor_rule/_form.html.erb
@@ -0,0 +1,75 @@
+<%= error_messages_for 'censor_rule' %>
+
+<div class="well">
+ <%=_("Applies to")%>
+ <% unless info_request.nil? %>
+ <%= request_both_links(info_request) %>
+ <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
+ <% end %>
+ <% unless user.nil? %>
+ <%= user_both_links(user) %>
+ <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
+<% end %>
+</div>
+
+<div class="control-group">
+ <label for="censor_rule_regexp" class="control-label">Is it regexp replacement?</label>
+ <div class="controls">
+ <%= check_box 'censor_rule', 'regexp' %>
+ <div class="help-block">
+ Leave unchecked if you are not sure about this
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="censor_rule_text" class="control-label">Text</label>
+ <div class="controls">
+ <%= text_field 'censor_rule', 'text', :class => "span3" %>
+ <div class="help-block">
+ that you want to remove, case sensitive
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="censor_rule_replacement" class="control-label">Replacement</label>
+ <div class="controls">
+ <%= text_field 'censor_rule', 'replacement', :class => "span3" %>
+ <div class="help-block">
+ put it in <strong>[square brackets]</strong>, e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="censor_rule_last_edit_comment" class="control-label">Comment for this edit</label>
+ <div class="controls">
+ <%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :class => "span6" %>
+ <div class="help-block">
+ put purpose of the rule, and why the change
+ </div>
+ </div>
+</div>
+
+<div class="row">
+ <div class="span10 offset2">
+ <div class="alert alert-info">
+ <h3>Warning and notes:</h3>
+ <p> This does replace text in binary files, but for
+ most formats only in a naive way. It works well on surprisingly many Word documents. Notably
+ it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
+ which works on some PDFs. Please <strong>carefully check</strong> all attachments have
+ changed in the way you expect, and haven't become corrupted.
+ </p>
+ <p>You may need to manually rebuild the search index afterwards. You can redact
+ things by individual request or by user by adding the censor rule from the
+ appropriate page. If you need to redact across a whole
+ authority, it will be easy enough to make code changes to add it, so do ask.
+ </p>
+ <p>
+ <strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to.
+ </p>
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_censor_rule/_form.rhtml b/app/views/admin_censor_rule/_form.rhtml
deleted file mode 100644
index ac43de704..000000000
--- a/app/views/admin_censor_rule/_form.rhtml
+++ /dev/null
@@ -1,40 +0,0 @@
-<%= error_messages_for 'censor_rule' %>
-
-<p>Applies to:
- <% if !info_request.nil? %>
- <%=request_both_links(info_request)%> request
- <%= hidden_field 'censor_rule', 'info_request_id', { :value => info_request.id } %>
- <% end %>
- <% if !user.nil? %>
- <%=user_both_links(user)%> user
- <%= hidden_field 'censor_rule', 'user_id', { :value => user.id } %>
- <% end %>
-</p>
-
-<p><label for="censor_rule_regexp">Is it regexp replacement?</label> (Leave unchecked if you are not sure about this)<br/>
-<%= check_box 'censor_rule', 'regexp' %></p>
-
-<p><label for="censor_rule_text">Text</label> (that you want to remove, case sensitive)<br/>
-<%= text_field 'censor_rule', 'text', :size => 60 %></p>
-
-<p><label for="censor_rule_replacement">Replacement</label> (put it in <strong>[square brackets]</strong>, e.g. [personal information removed]. applies to text in emails and HTML conversions of binaries; binaries themselves must stay the same length and the replacement is just a bunch of 'x's)<br/>
-<%= text_field 'censor_rule', 'replacement', :size => 60 %></p>
-
-<p><label for="censor_rule_last_edit_comment">Comment for this edit</label> (put purpose of the rule, and why the change)<br/>
-<%= text_area 'censor_rule', 'last_edit_comment', :rows => 2, :cols => 60 %></p>
-
-<p><strong>Warning and notes:</strong> This does replace text in binary files, but for
-most formats only in a naive way. It works well on surprisingly many Word documents. Notably
-it doesn't even do UCS-2 (unicode sometimes used in Word). There is also special code
-which works on some PDFs. Please <strong>carefully check</strong> all attachments have
-changed in the way you expect, and haven't become corrupted.
-</p>
-
-<p>You may need to manually rebuild the search index afterwards. You can redact
-things by individual request or by user by adding the censor rule from the
-appropriate page. If you need to redact across a whole
-authority, it will be easy enough to make code changes to add it, so do ask.
-</p>
-<p><strong>Regexp rules that are hard to process will really slow down request display.</strong> Please only use regexps if you really need to.
-</p>
-
diff --git a/app/views/admin_censor_rule/_show.rhtml b/app/views/admin_censor_rule/_show.html.erb
index 363c3fb6f..0d4cece93 100644
--- a/app/views/admin_censor_rule/_show.rhtml
+++ b/app/views/admin_censor_rule/_show.html.erb
@@ -1,6 +1,6 @@
<% if censor_rules.size > 0 %>
- <table>
+ <table class="table table-condensed">
<tr>
<th>Id</th>
<% for column in CensorRule.content_columns %>
@@ -16,7 +16,7 @@
<td><%=h censor_rule.send(column) %></td>
<% end %>
<td>
- <%= link_to "Edit", '../../censor/edit/' + censor_rule.id.to_s %>
+ <%= link_to "Edit", admin_rule_edit_path(censor_rule) %>
</td>
</tr>
<% end %>
@@ -26,14 +26,10 @@
<% end %>
<% if defined? info_request %>
- <p>
- <%= link_to "New censor rule", '../../censor/new?info_request_id=' + info_request.id.to_s %> (for this request only)
- </p>
+ <%= link_to "New censor rule (for this request only)", admin_rule_new_path(:info_request_id => info_request.id), :class => "btn btn-info" %>
<% end %>
<% if defined? user %>
- <p>
- <%= link_to "New censor rule", '../../censor/new?user_id=' + user.id.to_s %> (for all requests by this user)
- </p>
+ <%= link_to "New censor rule", admin_rule_new_path(:user_id => user.id), :class => "btn btn-info" %> <span class="label label-info">for all requests by this user</span>
<% end %>
diff --git a/app/views/admin_censor_rule/edit.html.erb b/app/views/admin_censor_rule/edit.html.erb
new file mode 100644
index 000000000..230446ed3
--- /dev/null
+++ b/app/views/admin_censor_rule/edit.html.erb
@@ -0,0 +1,18 @@
+<% @title = 'Edit censor rule' %>
+
+<h1><%=@title%></h1>
+
+<%= form_tag admin_rule_update_path(@censor_rule), :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) %>
+ <div class="form-actions">
+ Permanent! --&gt; <%= submit_tag "Destroy rule", :class => "btn btn-primary" %>
+ </div>
+<% end %>
+
diff --git a/app/views/admin_censor_rule/edit.rhtml b/app/views/admin_censor_rule/edit.rhtml
deleted file mode 100644
index e34e022a0..000000000
--- a/app/views/admin_censor_rule/edit.rhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-<% @title = 'Edit censor rule' %>
-
-<h1><%=@title%></h1>
-
-<% form_tag '../update/' + @censor_rule.id.to_s do %>
- <%= render :partial => 'form', :locals => { :info_request => @censor_rule.info_request, :user => @censor_rule.user } %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
-<% end %>
-
-<% form_tag('../destroy/' + @censor_rule.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:censor_rule_id, @censor_rule.id) %>
- Permanent! --&gt; <%= submit_tag "Destroy rule" %>
- </p>
-<% end %>
-
diff --git a/app/views/admin_censor_rule/new.html.erb b/app/views/admin_censor_rule/new.html.erb
new file mode 100644
index 000000000..77d22990c
--- /dev/null
+++ b/app/views/admin_censor_rule/new.html.erb
@@ -0,0 +1,11 @@
+<% @title = _('New censor rule') %>
+
+<h1><%=@title%></h1>
+
+<%= form_tag admin_rule_create_path, :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>
+<% end %>
+
diff --git a/app/views/admin_censor_rule/new.rhtml b/app/views/admin_censor_rule/new.rhtml
deleted file mode 100644
index c6b8cea6a..000000000
--- a/app/views/admin_censor_rule/new.rhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-<% @title = 'New censor rule' %>
-
-<h1><%=@title%></h1>
-
-<% form_tag 'create' do %>
- <%= render :partial => 'form', :locals => { :info_request => @info_request, :user => @user } %>
- <p><%= submit_tag "Create" %></p>
-<% end %>
-
diff --git a/app/views/admin_general/_admin_navbar.html.erb b/app/views/admin_general/_admin_navbar.html.erb
new file mode 100644
index 000000000..5cc740f70
--- /dev/null
+++ b/app/views/admin_general/_admin_navbar.html.erb
@@ -0,0 +1,22 @@
+<div class="admin">
+ <div class="navbar navbar-fixed-top navbar-inverse">
+ <div class="navbar-inner">
+ <div class="container">
+ <%= link_to 'Alaveteli', frontpage_path, :class => "brand" %>
+ <div class="nav-collapse">
+ <ul class="nav">
+ <li><%= link_to 'Summary', admin_general_index_path %></li>
+ <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 '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><%= link_to 'Log out', signout_path %></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_general/_change_request_summary.html.erb b/app/views/admin_general/_change_request_summary.html.erb
new file mode 100644
index 000000000..bec49c12c
--- /dev/null
+++ b/app/views/admin_general/_change_request_summary.html.erb
@@ -0,0 +1,60 @@
+<table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td>
+ <b>Authority</b>
+ </td>
+ <td>
+ <%= @change_request.get_public_body_name %>
+ </td>
+ </tr>
+
+ <% if @change_request.public_body %>
+ <tr>
+ <td>
+ <b>Current address</b>
+ </td>
+ <td>
+ <%= @change_request.public_body.request_email %>
+ </td>
+ </tr>
+ <% end %>
+
+ <tr>
+ <td>
+ <b>Suggested address</b>
+ </td>
+ <td>
+ <%= @change_request.public_body_email %>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Source</b>
+ </td>
+ <td>
+ <%= @change_request.source_url %>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Requested by</b>
+ </td>
+ <td>
+ <%= @change_request.get_user_name %> (<%= @change_request.get_user_email %>)
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <b>Requested on</b>
+ </td>
+ <td>
+ <%= I18n.l(@change_request.created_at, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= "#{time_ago_in_words(@change_request.created_at)} ago" %>)
+ </td>
+ </tr>
+ </tbody>
+</table>
diff --git a/app/views/admin_general/debug.rhtml b/app/views/admin_general/debug.html.erb
index 99488ba0c..bf984c2e1 100644
--- a/app/views/admin_general/debug.rhtml
+++ b/app/views/admin_general/debug.html.erb
@@ -2,14 +2,18 @@
<h1><%=@title%></h1>
-<p>You are <%= h @admin_current_user %></p>
+<p>You are <%= h @http_auth_user %></p>
<h2>Version numbers</h2>
<p>
Alaveteli version: <%= link_to @current_version, @github_origin + @current_version %>
<br>
-Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
+<% if @current_branch == "(no branch)" %>
+ Alaveteli branch: (no branch)
+<% else %>
+ Alaveteli branch: <%= link_to @current_branch, @github_origin + @current_branch %>
+<% end %>
<br>
Alaveteli commit: <%= link_to @current_commit, @github_origin + @current_commit %>
<br>
@@ -17,18 +21,13 @@ RUBY_VERSION <%=h RUBY_VERSION %>
<br>
Rails::VERSION::STRING <%=h Rails::VERSION::STRING%>
<br>
-TMail::VERSION::STRING <%=h TMail::VERSION::STRING%>
-<br>
Xapian::version_string <%=h Xapian::version_string%>
-<br>
-Spec::VERSION::STRING <%=h Spec::VERSION::STRING%>
</p>
<h2>Configuration</h2>
-<p>environment: <%=h Rails::configuration.environment %>
-<br>environment_path: <%=h Rails::configuration.environment_path %>
-<br>framework_paths: <%=h Rails::configuration.framework_paths.to_yaml %>
+<p>Rails env: <%=h Rails.env %>
+<br>Rails root: <%=h Rails.root %>
</p>
<h2>Environment variables</h2>
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb
new file mode 100644
index 000000000..2202663be
--- /dev/null
+++ b/app/views/admin_general/index.html.erb
@@ -0,0 +1,215 @@
+<% @title = "Summary" %>
+
+<div class="row">
+ <div class="span12">
+ <h1><%=@title%></h1>
+
+ <ul>
+ <li><%=@public_body_count%> public authorities</li>
+ <li>
+ <%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
+ <%=@incoming_message_count%> incoming messages
+ </li>
+ <li><%=@user_count%> users, <%=@track_thing_count%> tracked things</li>
+ <li><%=@comment_count%> annotations</li>
+ </ul>
+ </div>
+</div>
+
+<hr>
+
+<div class="row">
+ <div class="span12">
+ <h1>Things to do</h1>
+ </div>
+</div>
+
+<div class="accordion" id="things-to-do">
+ <% if @holding_pen_messages.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#holding-pen" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@holding_pen_messages.size%></span><%= chevron_right %> Put misdelivered responses with the right request</a>
+ </div>
+ <div id="holding-pen" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for message in @holding_pen_messages %>
+ <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) %>
+ <% else %>
+ <%= link_to excerpt(message.get_body_for_quoting, "", 60), admin_request_show_raw_email_path(message.raw_email_id) %>
+ <% end %>
+ </td>
+ <td class="span2">
+ <%=simple_date(message.sent_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @error_message_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#error-messages" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@error_message_requests.size%></span> <%= chevron_right %>Fix these delivery and other errors</a>
+ </div>
+ <div id="error-messages" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @error_message_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.info_request_events.last.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @attention_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#attention-messages" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@attention_requests.size%></span><%= chevron_right %> Review requests marked by users as requiring your attention
+</a>
+ </div>
+ <div id="attention-messages" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @attention_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.info_request_events.last.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @requires_admin_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#requires-admin" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@requires_admin_requests.size%></span><%= chevron_right %> These require administrator attention</a>
+ </div>
+ <div id="requires-admin" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @requires_admin_requests %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.info_request_events.last.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @blank_contacts.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#blank-contacts" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@blank_contacts.size%></span><%= chevron_right %> Find missing FOI email for these public authorities (try phoning!)</a>
+ </div>
+ <div id="blank-contacts" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @blank_contact in @blank_contacts %>
+ <tr>
+ <td class="link">
+ <%= public_body_both_links(@blank_contact) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@blank_contact.updated_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @old_unclassified.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#unclassified" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%=@old_unclassified.size%></span><%= chevron_right %> Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response</a>
+ </div>
+ <div id="unclassified" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% for @request in @old_unclassified %>
+ <tr>
+ <td class="link">
+ <%= request_both_links(@request) %>
+ </td>
+ <td class="span2">
+ <%=simple_date(@request.get_last_public_response_event.created_at)%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+
+ </table>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @new_body_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#new-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @new_body_requests.size %></span><%= chevron_right %> Add new authorities</a>
+ </div>
+ <div id="new-authorities" class="accordion-body collapse">
+ <% for @change_request in @new_body_requests %>
+ <%= render :partial => 'change_request_summary'%>
+ <%= 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') %>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @body_update_requests.size > 0 %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" href="#update-authorities" data-toggle="collapse" data-parent="things-to-do"><span class="label label-important"><%= @body_update_requests.size %></span><%= chevron_right %> Update authorities</a>
+ </div>
+ <div id="update-authorities" class="accordion-body collapse">
+ <% for @change_request in @body_update_requests %>
+ <%= render :partial => 'change_request_summary' %>
+ <%= 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') %>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+</div>
+
+<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 && @attention_requests.size == 0 && @new_body_requests.size == 0 && @body_update_requests.size == 0 %>
+ <div class="row">
+ <div class="span12 alert alert-success">
+ No pending administration required.
+ </div>
+ </div>
+<% end %>
diff --git a/app/views/admin_general/index.rhtml b/app/views/admin_general/index.rhtml
deleted file mode 100644
index 48bd7f694..000000000
--- a/app/views/admin_general/index.rhtml
+++ /dev/null
@@ -1,109 +0,0 @@
-<% @title = "Summary" %>
-
-<h1><%=@title%></h1>
-
-<ul>
-<li><%=@public_body_count%> public authorities</li>
-<li><%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages,
- <%=@incoming_message_count%> incoming messages
-</li>
-<li><%=@user_count%> users, <%=@track_thing_count%> tracked things</li>
-<li><%=@comment_count%> annotations</li>
-</ul>
-
-<hr>
-
-<h1>Things to do</h1>
-
-<% if @holding_pen_messages.size > 0 %>
- <h3>Put misdelivered responses with the right request (<%=@holding_pen_messages.size%> total)</h3>
-
- <ul>
- <% for message in @holding_pen_messages %>
- <li>
- <% if message.get_body_for_quoting.strip.size == 0 %>
- <%= link_to "(no body)", "request/show_raw_email/" + message.raw_email_id.to_s %>
- <% else %>
- <%= link_to excerpt(message.get_body_for_quoting, "", 60), "request/show_raw_email/" + message.raw_email_id.to_s %>
- <% end %>
- (<%=simple_date(message.sent_at)%>)
- </li>
- <% end %>
- </ul>
-
-<% end %>
-
-<% if @error_message_requests.size > 0 %>
- <h3>Fix these delivery and other errors (<%=@error_message_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @error_message_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @attention_requests.size > 0 %>
- <h3>Review requests which have been marked as requiring your attention by users (<%=@error_message_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @attention_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-
-<% if @requires_admin_requests.size > 0 %>
- <h3>These require administrator attention (<%=@requires_admin_requests.size%> total)</h3>
-
- <ul>
- <% for @request in @requires_admin_requests %>
- <li>
- <%= request_both_links(@request)%>
- &ndash; <%=simple_date(@request.get_last_event.created_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @blank_contacts.size > 0 %>
- <h3>Find missing FOI email for these public authorities (try phoning!) (<%=@blank_contacts.size%> total)</h3>
- <ul>
- <% for @blank_contact in @blank_contacts %>
- <li>
- <%= public_body_both_links(@blank_contact)%>
- &ndash; <%=simple_date(@blank_contact.updated_at)%>
- </li>
- <% end %>
- </ul>
-<% end %>
-
-<% if @old_unclassified.size > 0 %>
- <h3>Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response</h3>
-
- <ul>
- <% for @request in @old_unclassified %>
- <li>
- <%= request_both_links(@request) %>
- &ndash; <%=simple_date(@request.get_last_response_event.created_at)%>
- </li>
- <% end %>
- </ul>
-
- <p>(<%= link_to "Full list", admin_url("unclassified") %>, or play public
- <%= link_to "Categorisation game", main_url(play_url(:only_path => true)) %>)
- </p>
-<% end %>
-
-<% if @holding_pen_messages.size == 0 && @old_unclassified.size == 0 && @requires_admin_requests.size == 0 && @blank_contacts.size == 0 %>
- <p>No pending administration required.</p>
-<% end %>
-
-
diff --git a/app/views/admin_general/stats.html.erb b/app/views/admin_general/stats.html.erb
new file mode 100644
index 000000000..27dc25ee0
--- /dev/null
+++ b/app/views/admin_general/stats.html.erb
@@ -0,0 +1,60 @@
+<% @title = "Statistics" %>
+<div class="hero-unit">
+ <h2><%=@public_body_count%> public authorities</h2>
+ <h2><%=@info_request_count%> requests, <%=@outgoing_message_count%> outgoing messages, <%=@incoming_message_count%> incoming messages</h2>
+ <h2><%=@user_count%> users, <%=@track_thing_count%> tracked things</h2>
+ <h2><%=@comment_count%> annotations</h2>
+</div>
+
+<div class="row">
+ <div class="span12">
+ <h1>Statistics</h1>
+ <h2>Chart of requests (excluding backpaged)</h2>
+ <img src="/foi-live-creation.png" alt="Chart of requests">
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>State of requests (includes backpaged)</h2>
+ <div class="container">
+ <% for state, count in @request_by_state %>
+ <div class="row">
+ <div class="span1">
+ <span class="label label-info"><%=count%></span>
+ </div>
+ <div class="span4">
+ <%=state%>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Chart of users</h2>
+ <img src="/foi-user-use.png" alt="Chart of users">
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Tracks by type</h2>
+ <div class="container">
+ <% for state, count in @tracks_by_type %>
+ <div class="row">
+ <div class="span1">
+ <span class="label label-info"><%=count%></span>
+ </div>
+ <div class="span4">
+ <%=state%>
+ </div>
+ </div>
+ <% end %>
+ </div>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h2>Web analytics</h2>
+ </div>
+</div>
diff --git a/app/views/admin_general/stats.rhtml b/app/views/admin_general/stats.rhtml
deleted file mode 100644
index b22adb581..000000000
--- a/app/views/admin_general/stats.rhtml
+++ /dev/null
@@ -1,38 +0,0 @@
-<% @title = "Statistics" %>
-
-<h1>Statistics</h1>
-
-<h2>Chart of requests (excluding backpaged)</h2>
-
-<p>
- <img src="<%= main_url("/foi-live-creation.png")%>">
-</p>
-
-<h2>State of requests (includes backpaged)</h2>
-
-<table>
-<% for state, count in @request_by_state %>
-<tr> <td><%=state %></td><td><%= count %></td> </tr>
-<% end %>
-</table>
-
-<h2>Chart of users</h2>
-
-<p>
- <img src="<%= main_url("/foi-user-use.png")%>">
-</p>
-
-<h2>Tracks by type</h2>
-
-<table>
-<% for state, count in @tracks_by_type %>
-<tr> <td><%=state %></td><td><%= count %></td> </tr>
-<% end %>
-</table>
-
-<h2>Web analytics</h2>
-
-
-</p>
-
-
diff --git a/app/views/admin_general/timeline.rhtml b/app/views/admin_general/timeline.html.erb
index e84539970..c4ea4849b 100644
--- a/app/views/admin_general/timeline.rhtml
+++ b/app/views/admin_general/timeline.html.erb
@@ -1,14 +1,19 @@
<% @title = "Timeline" %>
-
-<h1><%=h @events_title%></h1>
-
-<p>
-<a href="?hour=1">Hour</a>
-| <a href="?day=1">Day</a>
-| <a href="?">2 days</a>
-| <a href="?week=1">Week</a>
-| <a href="?month=1">Month</a>
-| <a href="?all=1">All time</a></p>
+<div class="btn-toolbar">
+ <div class="btn-group">
+ <%= link_to "Hour", admin_timeline_path(:hour => 1), :class => "btn" %>
+ <%= link_to "Day", admin_timeline_path(:day => 1), :class => "btn" %>
+ <%= link_to "2 days", admin_timeline_path, :class => "btn" %>
+ <%= link_to "Week", admin_timeline_path(:week => 1), :class => "btn" %>
+ <%= link_to "Month", admin_timeline_path(:month => 1), :class => "btn" %>
+ <%= link_to "All time", admin_timeline_path(:all => 1), :class => "btn" %>
+ </div>
+</div>
+<div class="row">
+ <div class="span12">
+ <h1><%=h @events_title%></h1>
+ </div>
+</div>
<% last_date = nil %>
<% for event, event_at in @events %>
@@ -29,7 +34,7 @@
<%= request_both_links(event.info_request) %>
<% if event.event_type == 'edit' %>
was edited by administrator <strong><%=h event.params[:editor] %></strong>.
- <% for p in ['title', 'prominence', 'described_state', 'awaiting_description']
+ <% for p in ['title', 'described_state', 'awaiting_description']
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] %>'. <%
end
@@ -72,7 +77,7 @@
<% elsif event.event_type == 'response' %>
<% incoming_message = event.incoming_message %>
received
- <%= link_to 'a response', main_url(incoming_message_url(incoming_message)) %>
+ <%= link_to 'a response', incoming_message_path(incoming_message) %>
from <%=h event.info_request.public_body.name %>.
<% elsif event.event_type == 'sent' %>
was initially sent to <%=h event.params[:email]%> at <%=h event.info_request.public_body.name %>.
@@ -83,7 +88,7 @@
<% elsif event.event_type == 'comment' %>
had an annotation posted by <%=h event.comment.user.name %>.
<% elsif event.event_type == 'status_update' %>
- had its status updated by <%=h User.find(event.params[:user_id]).name %> from '<%= h event.params[:old_described_state] %>' to '<%= h event.params[:described_state] %>'.
+ had its status updated by <%= event.params[:user_id] ? User.find(event.params[:user_id]).name : event.params[:script] %> from '<%= h event.params[:old_described_state] %>' to '<%= h event.params[:described_state] %>'.
<% else %>
had '<%=event.event_type%>' done to it, parameters <%=h event.params_yaml%>.
<% end %>
@@ -92,8 +97,7 @@
was created/updated by administrator <strong><%=h event.last_edit_editor %></strong>
<% end %>
<% end %>
+<%= will_paginate(@events, :class => 'paginator') %>
<% if not @events.empty? %>
</p>
<% end %>
-<%= will_paginate(@events) %>
-
diff --git a/app/views/admin_incoming_message/_intro.html.erb b/app/views/admin_incoming_message/_intro.html.erb
new file mode 100644
index 000000000..1d5585f11
--- /dev/null
+++ b/app/views/admin_incoming_message/_intro.html.erb
@@ -0,0 +1,3 @@
+<% @title = "Incoming message #{incoming_message.id} of FOI request '#{incoming_message.info_request.title}'" %>
+<h1>Incoming message <%= incoming_message.id %></h1>
+<p>FOI request: <%= request_both_links(incoming_message.info_request) %></p>
diff --git a/app/views/admin_incoming_message/edit.html.erb b/app/views/admin_incoming_message/edit.html.erb
new file mode 100644
index 000000000..1088edcab
--- /dev/null
+++ b/app/views/admin_incoming_message/edit.html.erb
@@ -0,0 +1,26 @@
+<%= render :partial => 'intro', :locals => {:incoming_message => @incoming_message } %>
+<%= render :partial => 'admin_request/incoming_message_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 %>
+
+ <div class="control-group">
+ <label class="control-label" for="incoming_message_prominence"> Prominence</label>
+ <div class="controls">
+ <%= select('incoming_message', "prominence", IncomingMessage.prominence_states) %>
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="incoming_message_prominence_reason">Reason for prominence</label>
+ <div class="controls">
+ <%= text_area "incoming_message", "prominence_reason", :rows => 5, :class => "span6" %>
+ </div>
+ </div>
+
+ <div class="form-actions" >
+ <%= submit_tag 'Save', :class => "btn" %>
+ </div>
+
+ <% end %>
+</fieldset>
diff --git a/app/views/admin_outgoing_message/edit.html.erb b/app/views/admin_outgoing_message/edit.html.erb
new file mode 100644
index 000000000..d5f5f43bf
--- /dev/null
+++ b/app/views/admin_outgoing_message/edit.html.erb
@@ -0,0 +1,50 @@
+<h1>Edit outgoing message</h1>
+
+<%= error_messages_for 'outgoing_message' %>
+
+<%= form_tag admin_outgoing_update_path(@outgoing_message) do %>
+ <div class="control-group">
+ <label class="control-label" for="outgoing_message_prominence"> Prominence</label>
+ <div class="controls">
+ <%= select('outgoing_message', "prominence", OutgoingMessage.prominence_states) %>
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="outgoing_message_prominence_reason">Reason for prominence</label>
+ <div class="controls">
+ <%= text_area "outgoing_message", "prominence_reason", :rows => 5, :class => "span6" %>
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="outgoing_message_body">Body of message</label>
+ <div class="controls">
+ <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %>
+ </div>
+
+ <p><strong>Note:</strong> This is mainly to be used to excise information
+ that users inadvertently put in their messages, not realising it would be
+ public. It will already have been sent to the public authority, and their
+ reply may also include that information and be automatically published on
+ this site. You could also use this to edit a message before resending it, but
+ only the edited version will be shown on the public page if you do that.</p>
+
+<div class="form-actions" >
+<%= submit_tag 'Save', :accesskey => 's', :class => 'btn' %>
+</div>
+<% end %>
+
+<p>
+<%= link_to 'Show', admin_request_show_path(@outgoing_message.info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
+</p>
+
+<%= form_tag admin_outgoing_destroy_path 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/_form.html.erb b/app/views/admin_public_body/_form.html.erb
new file mode 100644
index 000000000..2da13ab01
--- /dev/null
+++ b/app/views/admin_public_body/_form.html.erb
@@ -0,0 +1,102 @@
+<%= error_messages_for 'public_body' %>
+
+<!--[form:public_body]-->
+
+<div id="div-locales">
+ <ul class="locales nav nav-tabs">
+ <% I18n.available_locales.each_with_index do |locale, i| %>
+ <li><a href="#div-locale-<%=locale.to_s%>" data-toggle="tab" ><%=locale_name(locale.to_s) || _("Default locale")%></a></li>
+ <% end %>
+ </ul>
+ <div class="tab-content">
+<%
+ for locale in I18n.available_locales do
+ if locale==I18n.default_locale # The default locale is submitted as part of the bigger object...
+ prefix = 'public_body'
+ object = @public_body
+ else # ...but additional locales go "on the side"
+ prefix = "public_body[translated_versions][]"
+ object = @public_body.new_record? ?
+ PublicBody::Translation.new :
+ @public_body.find_translation_by_locale(locale.to_s) || PublicBody::Translation.new
+ end
+%>
+ <%= fields_for prefix, object do |t| %>
+ <div class="tab-pane" id="div-locale-<%=locale.to_s%>">
+ <div class="control-group">
+ <%= t.hidden_field :locale, :value => locale.to_s %>
+ <label for="<%= form_tag_id(t.object_name, :name, locale) %>" class="control-label">Name</label>
+ <div class="controls">
+ <%= t.text_field :name, :id => form_tag_id(t.object_name, :name, locale), :class => "span4" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :short_name, locale) %>", class="control-label"><%=_("Short name")%></label>
+ <div class="controls">
+ <%= t.text_field :short_name, :id => form_tag_id(t.object_name, :short_name, locale), :class => "span2" %>
+ <p class="help-block"><%=_("Only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL – don't worry about breaking URLs through renaming, as the history is used to redirect")%></p>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :request_email, locale) %>" class="control-label"><%=_("Request email")%></label>
+ <div class="controls">
+ <%= t.text_field :request_email, :id => form_tag_id(t.object_name, :request_email, locale), :class => "span3" %>
+ <p class="help-block"><%=_("set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA")%></p>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>" class="control-label"><%=_("Publication scheme URL")%></label>
+ <div class="controls">
+ <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale), :class => "span3" %>
+ </div>
+ </div>
+ <div class="control-group">
+ <label for="<%= form_tag_id(t.object_name, :notes, locale) %>" class="control-label"><%=_("Public notes")%></label>
+ <div class="controls">
+ <%= t.text_area :notes, :rows => 3, :id => form_tag_id(t.object_name, :notes, locale), :class => "span6" %>
+ <p class="help-block">
+ HTML, for users to consider when making FOI requests to the authority
+ </p>
+ </div>
+ </div>
+ </div>
+<%
+ end
+ end
+%>
+ </div>
+</div>
+
+<h3>Common Fields</h3>
+<div class="control-group">
+ <label for="public_body_tag_string" class="control-label"><%=_("Tags")%></label>
+ <div class="controls">
+ <%= f.text_field :tag_string, :class => "span4" %>
+ <p class="help-block">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</p>
+ </div>
+</div>
+<div class="control-group">
+ <label for="public_body_home_page" class="control-label"><%=_("Home page")%></label>
+ <div class="controls">
+ <%= f.text_field :home_page, :class => "span4" %>
+ <p class="help-block">(of whole authority, not just their FOI page; set to <strong>blank</strong> (empty string) to guess it from the email)</p>
+ </div>
+</div>
+<div class="control-group">
+ <label for="public_body_disclosure_log" class="control-label"><%=_("Disclosure log URL")%></label>
+ <div class="controls">
+ <%= f.text_field :disclosure_log, :size => 60, :class => "span4" %>
+ </div>
+</div>
+<div class="control-group">
+ <label for="public_body_last_edit_comment" class="control-label"><strong>Comment</strong> for this edit</label>
+ <div class="controls">
+ <%= f.text_area :last_edit_comment, :rows => 3, :class => "span6" %></p>
+ <p class="help-block">put URL or other source of new info</p>
+ </div>
+</div>
+<% if @change_request %>
+ <%= render :partial => 'admin_public_body_change_requests/response' %>
+
+<% end %>
+<!--[eoform:public_body]-->
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml
deleted file mode 100644
index 0d6ae51e2..000000000
--- a/app/views/admin_public_body/_form.rhtml
+++ /dev/null
@@ -1,65 +0,0 @@
-<%= error_messages_for 'public_body' %>
-
-<!--[form:public_body]-->
-
-<div id="div-locales">
- <ul>
- <% for locale in I18n.available_locales do %>
- <li><a href="#div-locale-<%=locale.to_s%>"><%=locale_name(locale.to_s)%></a></li>
- <% end %>
- </ul>
-
-<%
- for locale in I18n.available_locales do
- if locale==I18n.default_locale # The default locale is submitted as part of the bigger object...
- prefix = 'public_body'
- object = @public_body
- else # ...but additional locales go "on the side"
- prefix = "public_body[translated_versions][]"
- object = @public_body.new_record? ?
- PublicBody::Translation.new :
- @public_body.translation(locale.to_s) || PublicBody::Translation.new
- end
-
- fields_for prefix, object do |t|
-%>
- <div id="div-locale-<%=locale.to_s%>">
- <%= t.hidden_field :locale, :value => locale.to_s %>
-
- <p><label for="<%= form_tag_id(t.object_name, :name, locale) %>">Name</label><br/>
- <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :short_name, locale) %>">Short name <small>(only put in abbreviations which are really used, otherwise leave blank. Short or long name is used in the URL - don't worry about breaking URLs through renaming, as the history is used to redirect)</small></label><br/>
- <%= t.text_field :short_name, :size => 60, :id => form_tag_id(t.object_name, :short_name, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :request_email, locale) %>">Request email <small>(set to <strong>blank</strong> (empty string) if can't find an address; these emails are <strong>public</strong> as anyone can view with a CAPTCHA)</small></label><br/>
- <%= t.text_field :request_email, :size => 40, :id => form_tag_id(t.object_name, :request_email, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :publication_scheme, locale) %>">Publication scheme URL</label><br/>
- <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :disclosure_log, locale) %>">Disclosure log URL</label><br/>
- <%= t.text_field :disclosure_log, :size => 60, :id => form_tag_id(t.object_name, :disclosure_log, locale) %></p>
-
- <p><label for="<%= form_tag_id(t.object_name, :notes, locale) %>">Public notes</label> <small>(HTML, for users to consider when making FOI requests to the authority)</small><br/>
- <%= t.text_area :notes, :rows => 3, :cols => 60, :id => form_tag_id(t.object_name, :notes, locale) %></p>
- </div>
-<%
- end
- end
-%>
-</div>
-
-<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/>
-
-<%= 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/>
-<%= 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/>
-<%= 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/_locale_selector.rhtml b/app/views/admin_public_body/_locale_selector.rhtml
deleted file mode 100644
index 5ef79f2df..000000000
--- a/app/views/admin_public_body/_locale_selector.rhtml
+++ /dev/null
@@ -1,10 +0,0 @@
-<div id="locale_switcher">
-<%= _('Edit language version:') %>
-<% for possible_locale in @locales %>
- <% if possible_locale == @locale %>
- <%= possible_locale %>
- <% else %>
- <a href="?show_locale=<%=possible_locale%>"><%= possible_locale %></a>
- <% end %>
-<% end %>
-</div>
diff --git a/app/views/admin_public_body/_one_list.html.erb b/app/views/admin_public_body/_one_list.html.erb
new file mode 100644
index 000000000..8f1d719ec
--- /dev/null
+++ b/app/views/admin_public_body/_one_list.html.erb
@@ -0,0 +1,44 @@
+<div class="accordion" id="bodies">
+ <% for public_body in bodies %>
+ <div class="accordion-group">
+ <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")%>
+ </span>
+ <span class="item-metadata span6">
+ <%= render :partial => 'tags', :locals => { :body => public_body} %>
+ </span>
+ </div>
+ <div id="body_<%=public_body.id%>" class="item-detail accordion-body collapse row">
+ <% public_body.for_admin_column do |name, value, type| %>
+ <div>
+ <span class="span6">
+ <b><%=name%></b>
+ </span>
+ <span class="span6">
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>&nbsp;
+ <% end %>
+ </span>
+ </div>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+</div>
+
+<%= form_tag(admin_body_mass_tag_add_url, :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 } ) %>
+ <%= hidden_field_tag(:page, params[:page], { :id => "mass_add_page_" + table_name } ) %>
+ <%= hidden_field_tag(:table_name, table_name, { :id => "mass_add_tag_table_name_" + table_name } ) %>
+ <%= submit_tag "Add tag to all", :class => "btn btn-primary" %>
+ (in table just above)
+ </p>
+<% end %>
+
diff --git a/app/views/admin_public_body/_one_list.rhtml b/app/views/admin_public_body/_one_list.rhtml
deleted file mode 100644
index e0d2399d0..000000000
--- a/app/views/admin_public_body/_one_list.rhtml
+++ /dev/null
@@ -1,29 +0,0 @@
-<table>
- <tr>
- <th>Name</th>
- <th>Tags</th>
- <% for column in PublicBody.content_columns.map { |c| c.human_name } - [ "Name", "Last edit comment" ] %>
- <th><%= column %></th>
- <% end %>
- </tr>
-<% for public_body in bodies %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= public_body_both_links(public_body) %></td>
- <td><%= render :partial => 'tags', :locals => { :body => public_body} %></td>
- <% for column in PublicBody.content_columns.map { |c| c.name } - [ "name", "last_edit_comment" ] %>
- <td><%=h public_body.send(column) %></td>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-<% form_tag(admin_url("body/mass_tag_add"), :method => "post", :class => "forms_on_one_line" ) 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 } ) %>
- <%= hidden_field_tag(:page, params[:page], { :id => "mass_add_page_" + table_name } ) %>
- <%= hidden_field_tag(:table_name, table_name, { :id => "mass_add_tag_table_name_" + table_name } ) %>
- <%= submit_tag "Add tag to all" %> (in table just above)
- </p>
-<% end %>
-
diff --git a/app/views/admin_public_body/_tag_help.html.erb b/app/views/admin_public_body/_tag_help.html.erb
new file mode 100644
index 000000000..b64e65877
--- /dev/null
+++ b/app/views/admin_public_body/_tag_help.html.erb
@@ -0,0 +1,16 @@
+<h2>List of tags</h2>
+<% first_row = true %>
+<% for row in PublicBodyCategories::get().with_headings() %>
+ <% if row.instance_of?(Array) %>
+ <% if row[0] != 'other' %>
+ <strong><%= row[0] %></strong>=<%= row[1] %>
+ <br/>
+ <% end %>
+ <% elsif row != 'Miscellaneous' %>
+ <% if not first_row %>
+ <% else %>
+ <% first_row = false %>
+ <% end %>
+ <h3><%=h row%></h3>
+ <% end %>
+<% end %>
diff --git a/app/views/admin_public_body/_tag_help.rhtml b/app/views/admin_public_body/_tag_help.rhtml
deleted file mode 100644
index 0d0f84dda..000000000
--- a/app/views/admin_public_body/_tag_help.rhtml
+++ /dev/null
@@ -1,18 +0,0 @@
-<div id="tag_help">
- <h2>List of tags</h2>
- <% first_row = true %>
- <% for row in PublicBodyCategories::get().with_headings() %>
- <% if row.instance_of?(Array) %>
- <% if row[0] != 'other' %>
- <strong><%= row[0] %></strong>=<%= row[1] %>
- <br/>
- <% end %>
- <% elsif row != 'Miscellaneous' %>
- <% if not first_row %>
- <% else %>
- <% first_row = false %>
- <% end %>
- <h3><%=h row%></h3>
- <% end %>
- <% end %>
-</div> \ No newline at end of file
diff --git a/app/views/admin_public_body/_tags.html.erb b/app/views/admin_public_body/_tags.html.erb
new file mode 100644
index 000000000..26526f304
--- /dev/null
+++ b/app/views/admin_public_body/_tags.html.erb
@@ -0,0 +1,12 @@
+<% for t in body.tags %>
+ <span class="label label-info tag">
+ <% if t.value %>
+ <%= link_to(h(t.name), list_public_bodies_path(:tag => t.name)) %>:<%= link_to(h(t.value), list_public_bodies_path(:tag => t.name_and_value)) %>
+ <% else %>
+ <%= link_to(h(t.name), list_public_bodies_path(:tag => t.name)) %>
+ <% end %>
+ </span>
+<% end %>
+
+
+
diff --git a/app/views/admin_public_body/_tags.rhtml b/app/views/admin_public_body/_tags.rhtml
deleted file mode 100644
index 85dc942fd..000000000
--- a/app/views/admin_public_body/_tags.rhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<% for t in body.tags %>
- <% if t.value %>
- <%= link_to(h(t.name), main_url(list_public_bodies_url(:tag => t.name, :only_path => true))) %>:<%= link_to(h(t.value), main_url(list_public_bodies_url(:tag => t.name_and_value, :only_path => true))) %>
- <% else %>
- <%= link_to(h(t.name), main_url(list_public_bodies_url(:tag => t.name, :only_path => true))) %>
- <% end %>
- (<a href="<%= admin_url('body/list') %>?query=<%= h(t.name)%>">admin</a>)
-<% end %>
-
-
-
diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb
new file mode 100644
index 000000000..11b7eec22
--- /dev/null
+++ b/app/views/admin_public_body/edit.html.erb
@@ -0,0 +1,34 @@
+<h1><%=@title%></h1>
+
+<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| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+ <div class="form-actions">
+ <%= f.submit 'Save', :accesskey => 's', :class => "btn btn-success" %></p>
+ </div>
+ <% end %>
+
+ <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" %>
+ </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 } ) %>
+ <%= submit_tag _("Destroy {{name}}", :name => @public_body.name), :class => "btn btn-danger" %> (this is permanent!)
+ <% end %>
+ <% end %>
+ </div>
+
+ </div>
+ <div class="span4">
+ <%= render :partial => 'tag_help' %>
+ </div>
+</div>
diff --git a/app/views/admin_public_body/edit.rhtml b/app/views/admin_public_body/edit.rhtml
deleted file mode 100644
index b19477a6b..000000000
--- a/app/views/admin_public_body/edit.rhtml
+++ /dev/null
@@ -1,30 +0,0 @@
-<h1><%=@title%></h1>
-
-<script type="text/javascript">
- $(function() {
- $("#div-locales").tabs();
- });
-</script>
-
-<%= render :partial => 'tag_help' %>
-
-<div id="public_body_form">
- <% form_tag '../update/' + @public_body.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
- <% end %>
-
- <p>
- <%= link_to 'Show', '../show/' + @public_body.id.to_s %> |
- <%= link_to 'List all', '../list' %>
- </p>
-
- <% if @public_body.info_requests.size == 0 %>
- <% form_tag('../destroy/' + @public_body.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:public_body_id, { :value => @public_body.id } ) %>
- <%= submit_tag "Destroy " + @public_body.name %> (this is permanent!)
- </p>
- <% end %>
- <% end %>
-</div>
diff --git a/app/views/admin_public_body/import_csv.rhtml b/app/views/admin_public_body/import_csv.html.erb
index 1c6100838..18341ecf1 100644
--- a/app/views/admin_public_body/import_csv.rhtml
+++ b/app/views/admin_public_body/import_csv.html.erb
@@ -9,18 +9,18 @@
<pre id="error"><%=@errors %></pre>
<% end %>
-<% form_tag 'import_csv', :multipart => true do %>
+<%= form_tag 'import_csv', :multipart => true do %>
<p>
- <% if @original_csv_file && @temporary_csv_file %>
- CSV file:
- <%= @original_csv_file %>
- <%= hidden_field_tag :original_csv_file, @original_csv_file %>
- <%= hidden_field_tag :temporary_csv_file, @temporary_csv_file %>
- <%= link_to 'Clear current file', 'import_csv', :class => "btn btn-warning" %>
- <% else %>
- <label for="csv_file">CSV file:</label>
- <%= file_field_tag :csv_file, :size => 40 %>
- <% end %>
+ <% if @original_csv_file && @temporary_csv_file %>
+ CSV file:
+ <%= @original_csv_file %>
+ <%= hidden_field_tag :original_csv_file, @original_csv_file %>
+ <%= hidden_field_tag :temporary_csv_file, @temporary_csv_file %>
+ <%= link_to 'Clear current file', 'import_csv', :class => "btn btn-warning" %>
+ <% else %>
+ <label for="csv_file">CSV file:</label>
+ <%= file_field_tag :csv_file, :size => 40 %>
+ <% end %>
</p>
<p>
@@ -31,15 +31,16 @@
<p>
<label for="tag_behaviour">What to do with existing tags?</label>
<%= select_tag 'tag_behaviour',
- "<option value='add' selected>Add new tags to existing ones</option>
- <option value='replace'>Replace existing tags with new ones</option>".html_safe
+ raw("<option value='add' selected>Add new tags to existing ones</option>
+ <option value='replace'>Replace existing tags with new ones</option>")
%>
</p>
- <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; additionally, translated values are supported by
- adding the locale name to the field name, e.g. 'name.es', 'name.de'... Example:
+ <p><strong>CSV file format:</strong>The first row should be a list
+ of fields, starting with '#'. The fields 'name' 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>
<blockquote>
@@ -57,7 +58,7 @@
actually altering the database. Choose <strong>upload</strong> to actually
make the changes. In either case, you will be shown any errors, or details
of the changes. When uploading, any changes since last import will be
- overwritten - e.g. email addresses changed back.
+ overwritten – e.g. email addresses changed back.
</p>
<p><strong>Note:</strong> The import tag will also be added to the imported bodies
diff --git a/app/views/admin_public_body/list.html.erb b/app/views/admin_public_body/list.html.erb
new file mode 100644
index 000000000..3d7d9c4cd
--- /dev/null
+++ b/app/views/admin_public_body/list.html.erb
@@ -0,0 +1,42 @@
+<% if @query.nil? %>
+ <% @title = _('Listing public authorities') %>
+<% else %>
+ <% @title = _("Listing public authorities matching '{{query}}'", :query => @query ) %>
+<% end %>
+
+<h1><%=@title%></h1>
+
+<div class="btn-toolbar">
+ <div class="btn-group">
+ <%= link_to 'New public authority', admin_body_new_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" %>
+ </div>
+</div>
+
+<%= 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" %>
+ <% if !@query.nil? %>
+ <%= link_to 'Show all', admin_body_list_path, :class => "btn" %>
+ <% end %><br>
+ (substring search in names and emails; exact match of tags)
+<% end %>
+
+
+<% if @public_bodies_by_tag.size > 0 %>
+ <h2>Exact tag matches (<%= @public_bodies_by_tag.size %> total)</h2>
+ <%= render :partial => 'one_list', :locals => { :bodies => @public_bodies_by_tag, :table_name => 'exact' } %>
+<% end %>
+
+<% if @public_bodies.size > 0 %>
+ <% if @query.nil? %>
+ <h2>All authorities</h2>
+ <% else %>
+ <h2>Substring search matches (<%= @public_bodies.total_entries %> total)</h2>
+ <% end %>
+ <%= render :partial => 'one_list', :locals => { :bodies => @public_bodies, :table_name => 'substring' } %>
+<% end %>
+
+<%= will_paginate(@public_bodies, :class => "paginator") %>
diff --git a/app/views/admin_public_body/list.rhtml b/app/views/admin_public_body/list.rhtml
deleted file mode 100644
index c28060604..000000000
--- a/app/views/admin_public_body/list.rhtml
+++ /dev/null
@@ -1,40 +0,0 @@
-<% if @query.nil? %>
- <% @title = 'Listing public authorities' %>
-<% else %>
- <% @title = "Listing public authorities matching '" + @query + "'" %>
-<% end %>
-
-<h1><%=@title%></h1>
-
-<p>
- <% if !@query.nil? %>
- <%= link_to 'Show all', 'list' %> |
- <% end %>
- <%= link_to 'New public authority', 'new' %>
- | <%= link_to 'Import from CSV file', 'import_csv' %>
-</p>
-
-<% form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search in names and emails; exact match of tags)
- </p>
-<% end %>
-
-
-<% if @public_bodies_by_tag.size > 0 %>
- <h2>Exact tag matches (<%= @public_bodies_by_tag.size %> total)</h2>
- <%= render :partial => 'one_list', :locals => { :bodies => @public_bodies_by_tag, :table_name => 'exact' } %>
-<% end %>
-
-<% if @public_bodies.size > 0 %>
- <% if @query.nil? %>
- <h2>All authorities</h2>
- <% else %>
- <h2>Substring search matches (<%= @public_bodies.total_entries %> total)</h2>
- <% end %>
- <%= render :partial => 'one_list', :locals => { :bodies => @public_bodies, :table_name => 'substring' } %>
-<% end %>
-
-<%= will_paginate(@public_bodies) %>
-
diff --git a/app/views/admin_public_body/missing_scheme.rhtml b/app/views/admin_public_body/missing_scheme.html.erb
index 2ea55ae00..2ea55ae00 100644
--- a/app/views/admin_public_body/missing_scheme.rhtml
+++ b/app/views/admin_public_body/missing_scheme.html.erb
diff --git a/app/views/admin_public_body/new.html.erb b/app/views/admin_public_body/new.html.erb
new file mode 100644
index 000000000..24b27d7af
--- /dev/null
+++ b/app/views/admin_public_body/new.html.erb
@@ -0,0 +1,25 @@
+<% @title = 'New public authority' %>
+
+<h1><%=@title%></h1>
+<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| %>
+ <%= render :partial => 'form', :locals => {:f => f} %>
+
+
+ <div class="form-actions">
+ <%= f.submit "Create", :class => "btn btn-primary" %>
+ </div>
+ <% end %>
+ <div class="row">
+ <div class="span8 well">
+ <%= link_to 'List all', admin_body_list_path, :class => "btn" %>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="span4">
+ <%= render :partial => 'tag_help' %>
+ </div>
+</div>
diff --git a/app/views/admin_public_body/new.rhtml b/app/views/admin_public_body/new.rhtml
deleted file mode 100644
index 047d5a5bb..000000000
--- a/app/views/admin_public_body/new.rhtml
+++ /dev/null
@@ -1,22 +0,0 @@
-<% @title = 'New public authority' %>
-
-<h1><%=@title%></h1>
-
-<script type="text/javascript">
- $(function() {
- $("#div-locales").tabs();
- });
-</script>
-
-<%= render :partial => 'tag_help' %>
-
-<div id="public_body_form">
- <% form_tag './create/' + @public_body.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag "Create" %></p>
- <% end %>
-
- <p>
- <%= link_to 'List all', 'list' %>
- </p>
-</div>
diff --git a/app/views/admin_public_body/show.html.erb b/app/views/admin_public_body/show.html.erb
new file mode 100644
index 000000000..f8161db26
--- /dev/null
+++ b/app/views/admin_public_body/show.html.erb
@@ -0,0 +1,93 @@
+<% @title = _("Public authority – {{name}}", :name => h(@public_body.name)) %>
+
+<h1><%=@title%></h1>
+
+<table class="table table-striped table-condensed">
+ <tbody>
+ <% @public_body.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column_name %>
+ <%= link_to(h(value), value) %>
+ <% elsif column_name == 'request_email' %>
+ <%= link_to(h(value), "mailto:#{value}") %>
+ <% unless @public_body.is_requestable? %>
+ <%=_("not requestable due to: {{reason}}", :reason => h(@public_body.not_requestable_reason))%><% if @public_body.is_followupable? %>; <%=_("but followupable")%><% end %>
+ <% end %>
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td>
+ <b><%=_("Calculated home page")%></b>
+ </td>
+ <td>
+ <% unless @public_body.calculated_home_page.nil? %>
+ <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
+ <% else %>
+ <%=_("*unknown*")%>
+ <% end %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Tags")%></b>
+ </td>
+ <td>
+ <%= render :partial => 'tags', :locals => { :body => @public_body} %>
+ </td>
+ </tr>
+ </tbody>
+</table>
+<%= link_to _("Edit"), admin_body_edit_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 %>
+ <%=_("Public page not available")%>
+<% end %>
+<hr>
+<h2>History</h2>
+<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
+<% versions = @public_body.reverse_sorted_versions; versions.each_with_index do |historic_public_body, i| %>
+ <div class="row">
+ <div class="span2">
+ <b>
+ <%= _("Version {{version}}", :version => historic_public_body.version)%>
+ </b>
+ </div>
+ <div class="span4">
+ <%= I18n.l(historic_public_body.updated_at, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(historic_public_body.updated_at)) %>)
+ </div>
+ <% if i == versions.length - 1 %>
+ <div class="span6">
+ <p>“<%= h(historic_public_body.last_edit_comment) %>”</p>
+ <ul>
+ <li><%=_("This is the first version.")%></li>
+ </ul>
+ </div>
+ <% else %>
+ <div class="span6">
+ <p>“<%= h(historic_public_body.last_edit_comment) %>”</p>
+ <ul>
+ <% historic_public_body.compare(versions[i+1]) do |change| %>
+ <li><%= _("{{thing_changed}} was changed from <code>{{from_value}}</code> to <code>{{to_value}}</code>", :thing_changed => change[:name], :from_value => (change[:from] or "-"), :to_value => (change[:to] or "-")) %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
+ </div>
+<% end %>
+<hr>
+<h2>Requests</h2>
+<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @info_requests } %>
+<%= will_paginate(@info_requests, :class => "paginator") %>
+<hr>
+<h2>Track things</h2>
+<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things, :include_destroy => true } %>
diff --git a/app/views/admin_public_body/show.rhtml b/app/views/admin_public_body/show.rhtml
deleted file mode 100644
index cee306988..000000000
--- a/app/views/admin_public_body/show.rhtml
+++ /dev/null
@@ -1,83 +0,0 @@
-<% @title = "Public authority - " + h(@public_body.name) %>
-
-<h1><%=@title%></h1>
-
-<p>
-<%
- columns = PublicBody.content_columns + [] # force dup
- columns.delete_if {|c| ['last_edit_comment'].include?(c.name)}
-
- for column in columns %>
- <b><%= column.human_name %>:</b>
- <% if ['home_page', 'publication_scheme', 'disclosure_log'].include? column.name %>
- <%= link_to(h(@public_body.send(column.name)), @public_body.send(column.name)) %>
- <% elsif column.name == 'request_email' %>
- <%= link_to(h(@public_body.send(column.name)), "mailto:#{@public_body.send(column.name)}") %>
- <% if !@public_body.is_requestable? %>
- (not requestable due to: <%=h @public_body.not_requestable_reason %><% if @public_body.is_followupable? %>; but followupable<% end %>)
- <% end %>
- <% else %>
- <%=h @public_body.send(column.name) %>
- <% end %>
- <br/>
-<% end %>
-<b>Calculated home page:</b>
-<% if !@public_body.calculated_home_page.nil? %>
- <%= link_to(h(@public_body.calculated_home_page), @public_body.calculated_home_page) %>
-<% else %>
- *unknown*
-<% end %>
-<br/><b>Tags:</b> <%= render :partial => 'tags', :locals => { :body => @public_body} %>
-<br/>
-</p>
-
-<p>
- <%=
- # url_name can be missing if the name hasn't been set for this locale
- if !@public_body.url_name.nil?
- link_to 'Public page', main_url(public_body_url(@public_body))
- else
- 'Public page not available'
- end
- %>
- | <%= link_to 'Edit', '../edit/' + @public_body.id.to_s %>
-</p>
-
-<h2>History</h2>
-<table border="1">
-<tr>
-<th>Updated at</th>
-<%
- history_columns = PublicBody.content_columns + [] # force dup
- history_columns.delete_if {|c| ['created_at', 'updated_at', 'first_letter', 'api_key'].include?(c.name)}
- for column in history_columns %>
- <th><%= column.human_name %></th>
-<% end %>
-</tr>
-<%# There may be an option to versions() to specify order, but I can't find it. TB 2009-03-09 %>
-<% for historic_public_body in @public_body.reverse_sorted_versions %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h historic_public_body.updated_at %></td>
- <% for column in history_columns %>
- <%
- value = h(historic_public_body.send(column.name))
- if column.name == 'last_edit_comment'
- value = historic_public_body.last_edit_comment_for_html_display
- end
- # Highlight entries which have changed since previous version
- changed = (!['version', 'last_edit_editor', 'last_edit_comment'].include?(column.name)) && ((historic_public_body.send(column.name) != @public_body.sorted_versions[historic_public_body.version - 2].send(column.name)) || (historic_public_body.version == 1)) %>
- <td <%= changed ? ' class="entry_changed" '.html_safe: '' %> >
- <%=value%>
- </td>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-<h2>Requests</h2>
-<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @public_body.info_requests } %>
-
-<h2>Track things</h2>
-<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @public_body.track_things } %>
-
-
diff --git a/app/views/admin_public_body_change_requests/_response.html.erb b/app/views/admin_public_body_change_requests/_response.html.erb
new file mode 100644
index 000000000..7fda8b7f8
--- /dev/null
+++ b/app/views/admin_public_body_change_requests/_response.html.erb
@@ -0,0 +1,15 @@
+<h3>Response to change request (will be emailed to user):</h3>
+<%= hidden_field_tag 'change_request_id', @change_request.id %>
+<div class="control-group" id="change_request_user_subject">
+ <label for="change_request_user_subject_field" class="control-label">Subject of email:</label>
+ <div class="controls">
+ <%= text_field_tag "subject", (params[:subject] || @change_request.default_response_subject), {:id => "change_request_user_subject_field", :class => "span6"} %>
+ </div>
+</div>
+
+<div class="control-group" id="change_request_user_response">
+ <label for="change_request_user_response_field" class="control-label">Response</label>
+ <div class="controls">
+ <%= text_area_tag "response", (params[:response] || h(@change_request_user_response)), {:id => "change_request_user_response_field", :rows => 10, :class => 'span6'} %>
+ </div>
+</div>
diff --git a/app/views/admin_public_body_change_requests/add_accepted.txt.erb b/app/views/admin_public_body_change_requests/add_accepted.txt.erb
new file mode 100644
index 000000000..fb22466b0
--- /dev/null
+++ b/app/views/admin_public_body_change_requests/add_accepted.txt.erb
@@ -0,0 +1,9 @@
+<%= _("Dear {{user_name}},", :user_name => @change_request.get_user_name) %>
+
+<%= _("Thanks for your suggestion to add {{public_body_name}}. It's been added to the site here:", :public_body_name => @change_request.public_body_name) %>
+
+<%= _("[Authority URL will be inserted here]")%>
+
+<%= _("Yours,") %>
+
+<%= _("The {{site_name}} team.", :site_name => site_name) %>
diff --git a/app/views/admin_public_body_change_requests/edit.html.erb b/app/views/admin_public_body_change_requests/edit.html.erb
new file mode 100644
index 000000000..cc9c5b5d9
--- /dev/null
+++ b/app/views/admin_public_body_change_requests/edit.html.erb
@@ -0,0 +1,8 @@
+<h1><%=@title%></h1>
+
+<%= form_tag admin_change_request_update_path(@change_request), :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" %>
+ </div>
+<% end %>
diff --git a/app/views/admin_public_body_change_requests/update_accepted.txt.erb b/app/views/admin_public_body_change_requests/update_accepted.txt.erb
new file mode 100644
index 000000000..9c29c959b
--- /dev/null
+++ b/app/views/admin_public_body_change_requests/update_accepted.txt.erb
@@ -0,0 +1,7 @@
+<%= _("Dear {{user_name}},", :user_name => @change_request.get_user_name) %>
+
+<%= _("Thanks for your suggestion to update the email address for {{public_body_name}} to {{public_body_email}}. This has now been done and any new requests will be sent to the new address.", :public_body_name => @change_request.public_body.name, :public_body_email => @change_request.public_body_email) %>
+
+<%= _("Yours,") %>
+
+<%= _("The {{site_name}} team.", :site_name => site_name) %>
diff --git a/app/views/admin_request/_incoming_message_actions.html.erb b/app/views/admin_request/_incoming_message_actions.html.erb
new file mode 100644
index 000000000..4cf099b53
--- /dev/null
+++ b/app/views/admin_request/_incoming_message_actions.html.erb
@@ -0,0 +1,45 @@
+<fieldset class="form-horizontal">
+ <legend>Actions</legend>
+ <%= form_tag admin_incoming_redeliver_path, :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">
+ <% if @info_requests && @info_requests.size == 1 %>
+ <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20, :id => "url_title_#{incoming_message.id}" } %>
+ <% 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>
+ </div>
+ <% end %>
+ <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" %>
+ </div>
+ </div>
+
+ <%= form_tag admin_incoming_destroy_path, :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">
+ <%= hidden_field_tag 'incoming_message_id', incoming_message.id, :id => nil %>
+ <%= submit_tag "Destroy message", :class => "btn btn-danger", :confirm => "This is permanent! Are you sure?", :id => "destroy_message_#{incoming_message.id}" %>
+ </div>
+ </div>
+ <% end %>
+
+ <% if @raw_email.nil? %>
+ <%# we're not on the raw_email page itself %>
+ <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" %>
+ </div>
+ </div>
+ <% end %>
+
+</fieldset>
diff --git a/app/views/admin_request/_incoming_message_actions.rhtml b/app/views/admin_request/_incoming_message_actions.rhtml
deleted file mode 100644
index 569132861..000000000
--- a/app/views/admin_request/_incoming_message_actions.rhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<% form_tag '../redeliver_incoming' do %>
- <div>
- id or url_title of request (or a list of requests, comma-separated):
- <% if @info_requests && @info_requests.size == 1 %>
- <%= text_field_tag 'url_title', @info_requests[0].url_title, { :size => 20 } %>
- <% else %>
- <%= text_field_tag 'url_title', "", { :size => 20 } %>
- <% end %>
- <%= hidden_field_tag 'redeliver_incoming_message_id', incoming_message.id %>
- <%= submit_tag "Redeliver to another request" %>
- </div>
-<% end %>
-
-<p>
-<%= link_to 'FOI officer upload URL', '../generate_upload_url/' + incoming_message.info_request.id.to_s + "?incoming_message_id=" + incoming_message.id.to_s %>
-</p>
-
-<% form_tag '../destroy_incoming' do %>
- <div>
- <%= hidden_field_tag 'incoming_message_id', incoming_message.id %>
- Warning, this is permanent! ---&gt;
- <%= submit_tag "Destroy message" %>
- </div>
-<% end %>
-
-
diff --git a/app/views/admin_request/_some_annotations.html.erb b/app/views/admin_request/_some_annotations.html.erb
new file mode 100644
index 000000000..dfd46f828
--- /dev/null
+++ b/app/views/admin_request/_some_annotations.html.erb
@@ -0,0 +1,48 @@
+<% if comments.size > 0 %>
+ <div class="accordion" id="comments">
+ <% for comment in comments %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#comment_<%=comment.id%>" data-toggle="collapse" data-parent="#comments"><%= chevron_right %></a>
+ <%= link_to admin_request_edit_comment_path(comment) do %>
+ #<%=comment.id%>
+ --
+ <%=h(comment.user.name)%>
+ <%=admin_value(comment.created_at)%>
+ <% end %>
+ <blockquote class="incoming-message">
+ <%= truncate(comment.body, :length => 400) %>
+ </blockquote>
+ </div>
+ <div id="comment_<%=comment.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td colspan="2">
+ By <%= user_both_links(comment.user) %>
+ </td>
+ </tr>
+ <% comment.for_admin_column do |name, value, type, column_name |%>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name == 'body' && !comment.visible %>
+ <s><%=h comment.send(column_name) %></s>
+ <% else %>
+ <%=h comment.send(column_name) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+ </div>
+<% else %>
+ <p>None yet.</p>
+<% end %>
+
diff --git a/app/views/admin_request/_some_requests.html.erb b/app/views/admin_request/_some_requests.html.erb
new file mode 100644
index 000000000..cff94956d
--- /dev/null
+++ b/app/views/admin_request/_some_requests.html.erb
@@ -0,0 +1,32 @@
+<div class="accordion" id="requests">
+ <% for info_request in info_requests %>
+ <div class="accordion-group">
+ <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") %>
+ </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
+ </span>
+ </div>
+ <div id="request_<%=info_request.id%>" class="item-detail accordion-body collapse row">
+ <% info_request.for_admin_column do | name, value, type | %>
+ <div>
+ <span class="span6">
+ <%= h name %>
+ </span>
+ <span class="span6">
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </span>
+ </div>
+ <% end %>
+ </div>
+ </div>
+ <% end %>
+</div>
diff --git a/app/views/admin_request/_some_requests.rhtml b/app/views/admin_request/_some_requests.rhtml
deleted file mode 100644
index dc11e0f55..000000000
--- a/app/views/admin_request/_some_requests.rhtml
+++ /dev/null
@@ -1,31 +0,0 @@
-<table>
- <tr>
- <th>Title</th>
- <th>Authority</th>
- <th>User</th>
- <% for column in InfoRequest.content_columns.map { |c| c.human_name } - [ "Url title", "Title" ] %>
- <th><%= column %></th>
- <% end %>
- </tr>
-
-<% for info_request in info_requests %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= request_both_links(info_request) %></td>
- <td><%= public_body_both_links(info_request.public_body) %></td>
- <% if info_request.is_external? %>
- <% if info_request.external_user_name.nil? %>
- <td><i><%= _("Anonymous user") %></i></td>
- <% else %>
- <td><%= h(info_request.external_user_name) %></td>
- <% end %>
- <% else %>
- <td><%= user_both_links(info_request.user) %></td>
- <% end %>
- <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %>
- <td><%=h info_request.send(column) %></td>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-
diff --git a/app/views/admin_request/_tags.rhtml b/app/views/admin_request/_tags.html.erb
index 22fbf13c8..22fbf13c8 100644
--- a/app/views/admin_request/_tags.rhtml
+++ b/app/views/admin_request/_tags.html.erb
diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.html.erb
index 8fa2a1fe2..0e9c68aea 100644
--- a/app/views/admin_request/edit.rhtml
+++ b/app/views/admin_request/edit.html.erb
@@ -2,7 +2,7 @@
<%= error_messages_for 'info_request' %>
-<% form_tag '../update/' + @info_request.id.to_s do %>
+<%= form_tag admin_request_update_path(@info_request) 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>
@@ -22,16 +22,14 @@
</p>
<p><label for="info_request_described_state"><strong>Described state</strong></label>
- <%= select( 'info_request', "described_state", InfoRequest.enumerate_states ) %>;
+ <%= select( 'info_request', "described_state", InfoRequest.enumerate_states) %>
<label for="info_request_awaiting_description"><strong>Awaiting description</strong></label>
- <%= select('info_request', "awaiting_description", [["Yes - needs state updating",true],["No - state is up to date",false]]) %>
+ <%= select('info_request', "awaiting_description", [["Yes – needs state updating",true],["No – state is up to date",false]]) %>
<br/>(don't forget to change 'awaiting description' when you set described state)<br/>
</p>
-
- <p><label for="info_request_comments_allowed"><strong>Are comments allowed?</strong></label>
- <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %>
- </p>
-
+ <p><label for="info_request_comments_allowed"><strong>Are comments allowed?</strong></label>
+ <%= select('info_request', "comments_allowed", [["Yes – comments allowed", true], ["No – comments disabled", false]]) %>
+ </p>
<p><label for="info_request_tag_string"><strong>Tags</strong> <small>(space separated, can use key:value)</small></label><br/>
<%= text_field 'info_request', 'tag_string', :size => 60 %></p>
@@ -45,13 +43,13 @@
<% end %>
<p>
-<%= link_to 'Show', '../show/' + @info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
+<%= link_to 'Show', admin_request_show_path(@info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
</p>
<hr>
-<% form_tag '../destroy/' + @info_request.id.to_s do %>
+<%= form_tag admin_request_destroy_path(@info_request) do %>
<p>
<strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely' %>
<br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It
diff --git a/app/views/admin_request/edit_comment.rhtml b/app/views/admin_request/edit_comment.html.erb
index ee43e849a..2cf49a4a8 100644
--- a/app/views/admin_request/edit_comment.rhtml
+++ b/app/views/admin_request/edit_comment.html.erb
@@ -2,13 +2,13 @@
<%= error_messages_for 'comment' %>
-<% form_tag '../update_comment/' + @comment.id.to_s do %>
+<%= form_tag admin_request_update_comment_path(@comment) 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>
- <%= select('comment', "visible", [["Yes - show comment",true],["No - hide comment",false]]) %>
+ <%= select('comment', "visible", [["Yes – show comment",true],["No – hide comment",false]]) %>
</p>
@@ -16,7 +16,7 @@
<% end %>
<p>
-<%= link_to 'Show', '../show/' + @comment.info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
+<%= link_to 'Show', admin_request_show_path(@comment.info_request) %> |
+<%= link_to 'List all', admin_request_list_path %>
</p>
diff --git a/app/views/admin_request/edit_outgoing.rhtml b/app/views/admin_request/edit_outgoing.rhtml
deleted file mode 100644
index 4932cb52f..000000000
--- a/app/views/admin_request/edit_outgoing.rhtml
+++ /dev/null
@@ -1,33 +0,0 @@
-<h1>Edit outgoing message</h1>
-
-<%= error_messages_for 'outgoing_message' %>
-
-<% form_tag '../update_outgoing/' + @outgoing_message.id.to_s do %>
-
- <p><label for="outgoing_message_body">Body of message</label><br/>
- <%= text_area 'outgoing_message', 'body', :rows => 10, :cols => 60 %></p>
-
- <p><strong>Note:</strong> This is mainly to be used to excise information
- that users inadvertently put in their messages, not realising it would be
- public. It will already have been sent to the public authority, and their
- reply may also include that information and be automatically published on
- this site. You could also use this to edit a message before resending it, but
- only the edited version will be shown on the public page if you do that.</p>
-
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
-<% end %>
-
-<p>
-<%= link_to 'Show', '../show/' + @outgoing_message.info_request.id.to_s %> |
-<%= link_to 'List all', '../list' %>
-</p>
-
-<% form_tag '../destroy_outgoing' do %>
- <div>
- <%= hidden_field_tag 'outgoing_message_id', @outgoing_message.id %>
- Warning, this is permanent! ---&gt;
- <%= submit_tag "Destroy outgoing message" %>
- </div>
-<% end %>
-
-
diff --git a/app/views/admin_request/hidden_user_explanation.html.erb b/app/views/admin_request/hidden_user_explanation.html.erb
new file mode 100644
index 000000000..d0a5d727d
--- /dev/null
+++ b/app/views/admin_request/hidden_user_explanation.html.erb
@@ -0,0 +1,10 @@
+<%= _("Dear {{name}},", :name => name_to) %>
+
+<%= _("Your request '{{request}}' at {{url}} has been reviewed by moderators.", :request => info_request.title.html_safe, :url => info_request_url) %>
+
+<%= reason == 'not_foi' ? _("We consider it is not a valid FOI request, and have therefore hidden it from other users.") : _("We consider it to be vexatious, and have therefore hidden it from other users.") %> <%= _("You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further.") %>
+
+<%= _("Yours,") %>
+
+<%= _("The {{site_name}} team.", :site_name => site_name) %>
+
diff --git a/app/views/admin_request/hidden_user_explanation.rhtml b/app/views/admin_request/hidden_user_explanation.rhtml
deleted file mode 100644
index 64387ffee..000000000
--- a/app/views/admin_request/hidden_user_explanation.rhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-Dear <%= name_to %>,
-
-Your request '<%= info_request.title %>' at <%= info_request_url %> has been reviewed by moderators.
-
-We consider it <% if reason == 'not_foi' %>is not a valid FOI request<% else %>to be vexatious<% end%>, and have therefore hidden it from other users. You will still be able to view it while logged in to the site. Please reply to this email if you would like to discuss this decision further.
-
-Yours,
-
-The <%= site_name %> team.
diff --git a/app/views/admin_request/list.html.erb b/app/views/admin_request/list.html.erb
new file mode 100644
index 000000000..2bd3e3326
--- /dev/null
+++ b/app/views/admin_request/list.html.erb
@@ -0,0 +1,13 @@
+<% @title = _("Listing FOI requests") %>
+
+<h1><%=@title%></h1>
+
+<%= 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, titles only)
+<% end %>
+
+<%= render :partial => 'some_requests', :locals => { :info_requests => @info_requests } %>
+
+<%= will_paginate(@info_requests, :class => "paginator") %>
+
diff --git a/app/views/admin_request/list.rhtml b/app/views/admin_request/list.rhtml
deleted file mode 100644
index cb328543e..000000000
--- a/app/views/admin_request/list.rhtml
+++ /dev/null
@@ -1,15 +0,0 @@
-<% @title = 'Listing FOI/EIR requests' %>
-
-<h1><%=@title%></h1>
-
-<% form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search, titles only)
- </p>
-<% end %>
-
-<%= render :partial => 'some_requests', :locals => { :info_requests => @info_requests } %>
-
-<%= will_paginate(@info_requests) %>
-
diff --git a/app/views/admin_request/list_old_unclassified.rhtml b/app/views/admin_request/list_old_unclassified.rhtml
deleted file mode 100644
index 2e75c2174..000000000
--- a/app/views/admin_request/list_old_unclassified.rhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-<% @title = "Unclassified responses" %>
-
-<h1><%=@title%></h1>
-
-<p>Classify responses that are still unclassified <%=InfoRequest::OLD_AGE_IN_DAYS.inspect %> after response:</p>
-<ul>
-<% for @request in @info_requests %>
- <li>
- <%= request_both_links(@request) %>
- &ndash; <%=simple_date(@request.get_last_response_event.created_at)%>
- </li>
-<% end %>
-</ul>
-<%= will_paginate(@info_requests) %>
-
-
diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb
new file mode 100644
index 000000000..2589e52b4
--- /dev/null
+++ b/app/views/admin_request/show.html.erb
@@ -0,0 +1,346 @@
+<% @title = _("FOI request – {{title}}", :title => h(@info_request.title)) %>
+
+<h1><%=@title%></h1>
+
+<%= form_tag admin_request_move_request_path, { :class => "form form-horizontal" } do %>
+ <%= hidden_field_tag 'info_request_id', @info_request.id %>
+ <div class="accordion" id="info_request">
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <span class="item-title">
+ <a href="#metadata_<%=@info_request.id%>" data-toggle="collapse" data-parent="#info_request"><%= chevron_down %></a>Request metadata
+ </span>
+ </div>
+ <div id="metadata_<%=@info_request.id%>" class="accordion-body collapse in">
+ <table class="table table-striped table-condensed">
+ <thead>
+ <tr>
+ <td colspan="2">
+ <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th>Public page:</th>
+ <td><%= link_to request_url(@info_request), request_path(@info_request) %></td>
+ </tr>
+ <% @info_request.for_admin_column do |name, value, type, column_name|%>
+ <tr>
+ <td>
+ <b><%= name %>:</b>
+ </td>
+ <td>
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>
+ <% end %>
+ <% if column_name == 'described_state' %>
+ <ul>
+ <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li>
+ <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li>
+ <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li>
+ <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li>
+ </ul>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td>
+ <b>Created by</b>
+ </td>
+ <td>
+ <% if @info_request.is_external? %>
+ <%= link_to(eye, @info_request.external_url, :title => "view URL of original request on external website") %>
+ <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API)
+ <% else %>
+ <%= user_both_links(@info_request.user) %>
+ <%= link_to _("move..."), "#", :class => "btn btn-mini btn-warning toggle-hidden" %>
+ <div style="display:none;">
+ <strong>url_name of new user:</strong>
+ <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to user", :class => "btn btn-info" %>
+ </div>
+ <% end %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b>Public authority:</b>
+ </td>
+ <td>
+ <%= public_body_both_links(@info_request.public_body) %>
+ <%= link_to "move...", "#", :class => "btn btn-mini btn-warning toggle-hidden" %>
+ <div style="display:none;">
+ <strong>url_name of new authority:</strong>
+ <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
+ <%= submit_tag "Move request to authority", :class => "btn btn-info" %>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Incoming email address")%></b>
+ </td>
+ <td>
+ <%= link_to h(@info_request.incoming_email), "mailto:#{@info_request.incoming_email}" %>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <b><%=_("Tags")%></b>
+ </td>
+ <td>
+ <%= render :partial => 'tags', :locals => { :info_request => @info_request} %>
+ </td>
+ </tr>
+ </tbody>
+ <tfoot>
+ <tr>
+ <td colspan="2">
+ <%= link_to 'Edit metadata', admin_request_edit_path(@info_request), :class => "btn" %>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+ </div>
+ </div>
+ </div>
+<% end %>
+<fieldset class="form-horizontal">
+ <legend>Actions</legend>
+ <div class="control-group">
+ <label class="control-label">
+ FOI officer upload URL
+ </label>
+ <div class="controls">
+ <%= link_to 'Generate URL', admin_request_generate_upload_url_path(@info_request), :class => "btn" %>
+ <p class="help-block">(see also option to general 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 %>
+ <div class="control-group">
+ <% if @info_request.is_external? %>
+ <label class="control-label">Hide the request:</label>
+ <% else %>
+ <label class="control-label">Hide the request and notify the user:</label>
+ <% end %>
+
+ <div class="controls" id="request_hidden_user_explanation_reasons">
+ <% if ['hidden', 'requester_only'].include? @info_request.prominence %>
+ <p class="help-block">This request has already been hidden</p>
+ <% else %>
+ <label class="radio inline">
+ <%= radio_button_tag "reason", "not_foi" %> <%= _("Not a valid FOI request") %>
+ </label>
+ <label class="radio inline">
+ <%= radio_button_tag "reason", "vexatious" %> <%= _("A vexatious request") %>
+ </label>
+ <% end %>
+ </div>
+ </div>
+
+ <% if !['hidden', 'requester_only'].include? @info_request.prominence %>
+ <% if ! @info_request.is_external? %>
+
+ <div class="control-group" id="request_hidden_user_subject">
+ <label for="request_hidden_user_subject_field" class="control-label">Subject of email:</label>
+ <div class="controls">
+ <%= text_field_tag "subject", _("Your request on {{site_name}} hidden", :site_name => site_name), {:id => "request_hidden_user_subject_field", :cols => 100} %>
+ </div>
+ </div>
+
+ <div class="control-group" id="request_hidden_user_explanation">
+ <label for="request_hidden_user_explanation_field" class="control-label">Reason for hiding the request (will be emailed to user):</label>
+ <div class="controls">
+ <%= text_area_tag "explanation", h(@request_hidden_user_explanation), {:id => "request_hidden_user_explanation_field"} %>
+ </div>
+ </div>
+
+ <% end %>
+ <div class="form-actions" id="request_hide_button">
+ <%= submit_tag _("Hide request"), :class => "btn" %>
+ </div>
+ <% end %>
+ <% end %>
+</fieldset>
+
+<hr>
+<h2>Events</h2>
+<div class="accordion" id="events">
+ <% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <span class="item-title">
+ <a href="#event_<%=info_request_event.id%>" data-toggle="collapse" data-parent="#events"><%= chevron_right %></a>
+ <%= _("Event {{id}}", :id => info_request_event.id) %>:
+ <strong>
+ <%=h info_request_event.event_type.humanize %><% if !info_request_event.calculated_state.nil? %>; state: <%= info_request_event.calculated_state %><% end %>
+ </strong>
+ <em>
+ <%= info_request_event.created_at%>
+ </em>
+ </span>
+ </div>
+ <div id="event_<%=info_request_event.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <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 %>
+ <%= submit_tag "Was clarification request", :class => "btn btn-mini btn-primary" %>
+ <% end %>
+ <% end %>
+ </td>
+ <td></td>
+ </tr>
+
+ <% info_request_event.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=h name%></b>
+ </td>
+ <td>
+ <% if column_name == 'params_yaml' %>
+ <%= info_request_event.params_yaml_as_html.html_safe %>
+ <% elsif value.nil? %>
+ nil
+ <% elsif %w(text string).include?(type) %>
+ <%=h value.humanize %>
+ <% elsif type == 'datetime' %>
+ <%= admin_date value %>
+ <% else %>
+ <%=h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+</div>
+<hr>
+<h2>Outgoing messages</h2>
+<div class="accordion" id="outgoing_messages">
+ <% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
+ <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 %>
+ #<%= outgoing_message.id %> -- <%= outgoing_message.status.humanize %> <%= outgoing_message.message_type.humanize %>
+ <% end %>
+ <blockquote>
+ <%= truncate(outgoing_message.body, :length => 400) %>
+ </blockquote>
+ </div>
+ <div id="outgoing_<%=outgoing_message.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <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 %>
+ <%= submit_tag "Resend", :class => "btn" %>
+ <% end %>
+ </td>
+ </tr>
+ <% outgoing_message.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td class="span3">
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name == 'body' %>
+ <%= simple_format(truncate(h(outgoing_message.body), :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden" )).html_safe) %>
+ <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div>
+ <% else %>
+ <%= admin_value(value) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+</div>
+<hr>
+<h2>Incoming messages</h2>
+<div class="accordion" id="incoming_messages">
+ <% for incoming_message in @info_request.incoming_messages %>
+ <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 %>
+ <%=incoming_message.id%>
+ --
+ <%= h(incoming_message.mail_from) %>
+ <%=_("at")%> <%=admin_value(incoming_message.sent_at)%>
+ <% end %>
+ <blockquote class="incoming-message">
+ <% if !incoming_message.cached_main_body_text_folded.nil? %>
+ <%= truncate(incoming_message.cached_main_body_text_folded.gsub('FOLDED_QUOTED_SECTION', ''), :length => 400) %>
+ <% end %>
+ </blockquote>
+ </div>
+ <div id="incoming_<%=incoming_message.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <thead>
+ <tr>
+ <td colspan="2" class="well">
+ <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
+ </td>
+ </tr>
+ </thead>
+ <tbody>
+ <% incoming_message.for_admin_column do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=name%></b>
+ </td>
+ <td>
+ <% if column_name =~ /^cached_.*?$/ %>
+ <%= simple_format( truncate(h(value), :length => 400, :omission => link_to("...", "#", :class => "toggle-hidden")).html_safe) %>
+ <div style="display:none;"><%= simple_format(value) %></div>
+ <% else %>
+ <%= simple_format(value.to_s) %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+</div>
+<hr>
+<h2>Annotations</h2>
+
+<%= render :partial => 'admin_request/some_annotations' , :locals => { :comments => @info_request.comments } %>
+
+<hr>
+<h2>Mail server delivery logs</h2>
+
+<p><i>(Lines containing the request incoming email address, updated hourly.)</i></p>
+
+<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %>
+ <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> -->
+ <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre>
+<% end %>
+<% if @info_request.mail_server_logs.size == 0 %>
+ <p>None (perhaps this is an old or a very new request)</p>
+<% end %>
+
+<hr>
+<h2>Censor rules</h2>
+<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>
+
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
deleted file mode 100644
index 2541fd323..000000000
--- a/app/views/admin_request/show.rhtml
+++ /dev/null
@@ -1,230 +0,0 @@
-<% @title = "FOI request - " + h(@info_request.title) %>
-<%= javascript_include_tag :defaults %>
-
-<h1><%=@title%></h1>
-
-<% form_tag '../move_request', { :class => "inline" } do %>
-<p>
-<%= hidden_field_tag 'info_request_id', @info_request.id %>
-<% for column in InfoRequest.content_columns %>
- <strong><%= column.human_name %>:</strong> <%=h @info_request.send(column.name) %>
- <% if column.name == 'described_state' %>
- <strong>Calculated status:</strong> <%= @info_request.calculate_status %>
- <br/><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %>
- <strong>Date response required by:</strong> <%= @info_request.date_response_required_by %>
- <strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %>
- <% end %>
- <% if ![ 'allow_new_responses_from' ].include?(column.name) %>
- <br/>
- <% end %>
-<% end %>
- <strong>Created by:</strong>
- <% if @info_request.is_external? %>
- <%= @info_request.public_body.name %> on behalf of <%= (@info_request.user_name || _('an anonymous user'))%> (using API)
- <% else %>
- <%= user_both_links(@info_request.user) %>
- <% end %>
-
- <span>
- <span>
- (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
- </span>
- <span style="display:none;">
- <strong>url_name of new user:</strong>
- <%= text_field_tag 'user_url_name', "", { :size => 20 } %>
- <%= submit_tag "Move request to user" %>
- </span>
- </span>
- <br>
-<strong>Public authority:</strong> <%= public_body_both_links(@info_request.public_body) %>
- <span>
- <span>
- (<%= link_to_function("move...", "$(this).up(1).childElements().invoke('toggle')") %>)
- </span>
- <span style="display:none;">
- <strong>url_name of new authority:</strong>
- <%= text_field_tag 'public_body_url_name', "", { :size => 20 } %>
- <%= submit_tag "Move request to authority" %>
- </span>
- </span>
- <br>
-<strong>Incoming email address:</strong> <%= link_to h(@info_request.incoming_email), "mailto:" + @info_request.incoming_email %> <br>
-<b>Tags:</b> <%= render :partial => 'tags', :locals => { :info_request => @info_request} %> <br>
-</p>
-<% end %>
-
-<p>
- <%= link_to 'Public page', main_url(request_url(@info_request)) %>
- | <%= link_to 'Edit', '../edit/' + @info_request.id.to_s %>
- | <%= link_to 'FOI officer upload URL', '../generate_upload_url/' + @info_request.id.to_s %> (see also links on incoming messages below)
-</p>
-
-<h2>Events</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in InfoRequestEvent.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for info_request_event in @info_request.info_request_events.find(:all, :order => "created_at, id") %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h info_request_event.id %></td>
- <% for column in InfoRequestEvent.content_columns %>
- <td>
- <% if column.name == 'params_yaml' %>
- <%= info_request_event.params_yaml_as_html %>
- <% elsif column.text? %>
- <%=h (info_request_event.send(column.name) || '').gsub(/_/,' ') %>
- <% else %>
- <%=h info_request_event.send(column.name) %>
- <% end %>
- </td>
- <% end %>
- <td>
- <% if info_request_event.described_state != 'waiting_clarification' and info_request_event.event_type == 'response' %>
- <% form_tag '../mark_event_as_clarification' do %>
- <div>
- <%= hidden_field_tag 'info_request_event_id', info_request_event.id %>
- <%= submit_tag "Was clarification request" %>
- </div>
- <% end %>
- <% end %>
- </td>
- </tr>
-<% end %>
-</table>
-
-<h2>Outgoing messages</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in OutgoingMessage.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for outgoing_message in @info_request.outgoing_messages.find(:all, :order => 'created_at') %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h outgoing_message.id %></td>
- <% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
-
- <% if column == 'body' %>
- <td>
- <div><%= simple_format( truncate(outgoing_message.body, :length => 400,
- :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
- )) %></div>
- <div style="display:none;"><%= simple_format( outgoing_message.body ) %></div>
- </td>
- <% else %>
- <td><%= simple_format( outgoing_message.send(column) ) %></td>
- <% end %>
-
- <% end %>
- <td>
- <% form_tag '../resend' do %>
- <div>
- <%= hidden_field_tag 'outgoing_message_id', outgoing_message.id %>
- <%= submit_tag "Resend" %>
- </div>
- <% end %>
- <%= link_to "Edit", '../edit_outgoing/' + outgoing_message.id.to_s %>
- </td>
- </tr>
-<% end %>
-</table>
-
-<h2>Incoming messages</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in IncomingMessage.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
-<% for incoming_message in @info_request.incoming_messages.find(:all, :order => 'created_at') %>
- <tr class="<%= cycle('odd', 'even') %>" id="incoming-<%=incoming_message.id.to_s%>">
- <td><%=h incoming_message.id %></td>
- <% for column in IncomingMessage.content_columns.map { |c| c.name } %>
- <% if column =~ /^cached_.*?$/ %>
- <td>
- <div><%= simple_format( truncate(incoming_message.send(column), :length => 400,
- :omission => link_to_function("...", "$(this).up('td').childElements().invoke('toggle')")
- )) %></div>
- <div style="display:none;"><%= simple_format( incoming_message.send(column) ) %></div>
- </td>
- <% else %>
- <td><%= simple_format( incoming_message.send(column) ) %></td>
- <% end %>
- <% end %>
- <td>
- <% if !incoming_message.raw_email_id.nil? %>
- <p>
- <%= link_to "View raw email", "../show_raw_email/" + incoming_message.raw_email_id.to_s %>
- </p>
- <% end %>
- <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => incoming_message } %>
- </td>
- </tr>
-<% end %>
-</table>
-
-<h2>Annotations</h2>
-
-<% if @info_request.comments.size > 0 %>
- <table>
- <tr>
- <th>Id</th>
- <th>Posted by</th>
- <% for column in Comment.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Actions</th>
- </tr>
-
- <% for comment in @info_request.comments %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h comment.id %></td>
- <td><%= user_both_links(comment.user) %></td>
- <% for column in Comment.content_columns.map { |c| c.name } %>
- <% if column == 'body' && !comment.visible %>
- <td><s><%=h comment.send(column) %></s></td>
- <% else %>
- <td><%=h comment.send(column) %></td>
- <% end %>
- <% end %>
- <td>
- <%= link_to "Edit", '../edit_comment/' + comment.id.to_s %>
- </td>
- </tr>
- <% end %>
- </table>
-<% else %>
- <p>None yet.</p>
-<% end %>
-
-
-
-<h2>Mail server delivery logs</h2>
-
-<p><i>(Lines containing the request incoming email address, updated hourly.)</i></p>
-
-<% for mail_server_log_done_id, mail_server_logs in @info_request.mail_server_logs.group_by(&:mail_server_log_done_id) %>
- <!-- <h3><%=h mail_server_logs[0].mail_server_log_done.filename %></h3> -->
- <pre><% for mail_server_log in mail_server_logs %><%=h mail_server_log.line%><% end %></pre>
-<% end %>
-<% if @info_request.mail_server_logs.size == 0 %>
- <p>None (perhaps this is an old or a very new request)</p>
-<% end %>
-
-<h2>Censor rules</h2>
-<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @info_request.censor_rules, :info_request => @info_request } %>
-
diff --git a/app/views/admin_request/show_raw_email.html.erb b/app/views/admin_request/show_raw_email.html.erb
new file mode 100644
index 000000000..da22b6069
--- /dev/null
+++ b/app/views/admin_request/show_raw_email.html.erb
@@ -0,0 +1,63 @@
+<%= render :partial => 'admin_incoming_message/intro', :locals => { :incoming_message => @raw_email.incoming_message } %>
+
+ <% if @holding_pen %>
+ <br>This is in the holding pen because: <strong><%= @rejected_reason %></strong>
+ <% if @public_bodies.size > 0 %>
+ <br>Guessed authority:
+ <% @public_bodies.each do |public_body| %>
+ <%=public_body_both_links(public_body)%>
+ <% end %>
+ (based on From: email domain)
+ <% end %>
+ <% if @info_requests.size > 0 %>
+ <div class="accordion" id="guessed-requests">
+ Guessed request:
+ <% @info_requests.each do |info_request| %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#info_request_<%= info_request.id %>" data-toggle="collapse"><i class="icon-chevron-right"></i></a>
+ <%=request_both_links(info_request)%>
+ </div>
+ <div class="accordion-body collapse" id="info_request_<%= info_request.id %>">
+ <table class="table table-striped table-condensed">
+ <tr>
+ <td><strong>Last outgoing message:</strong></td>
+ <td><%= info_request.outgoing_messages.last.body %></td>
+ </tr>
+ <tr>
+ <td><strong>Created by:</strong></td>
+ <td><%= user_admin_link_for_request(info_request) %></td>
+ </tr>
+ <tr>
+ <td><strong>Authority:</strong></td>
+ <td>
+ <%= link_to(info_request.public_body.name, admin_body_show_path(info_request.public_body)) %>
+ </td>
+ </tr>
+ <tr>
+ <td><strong>url_title:</strong></td>
+ <td><%= info_request.url_title %></td>
+ </tr>
+ </table>
+ <p>
+ This request was guessed because it has an incoming email address of <strong><%= info_request.incoming_email %></strong> and this incoming message was sent to <strong><%= @raw_email.incoming_message.mail.to %></strong>.
+ </p>
+ </div>
+ </div>
+ <% end %>
+ (based on id, not hash, in To/Cc email)
+ </div>
+ <% end %>
+ <% end %>
+</p>
+
+<div>
+ <%= render :partial => '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>
+
+<pre><%=h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre>
+
diff --git a/app/views/admin_request/show_raw_email.rhtml b/app/views/admin_request/show_raw_email.rhtml
deleted file mode 100644
index ea0d6017e..000000000
--- a/app/views/admin_request/show_raw_email.rhtml
+++ /dev/null
@@ -1,37 +0,0 @@
-<% @title = 'Incoming message ' + @raw_email.incoming_message.id.to_s + ' of FOI request \'' + h(@raw_email.incoming_message.info_request.title) + "'" %>
-
-<h1>Incoming message <%=@raw_email.incoming_message.id.to_s %></h1>
-
-<p>
- FOI request: <%= request_both_links(@raw_email.incoming_message.info_request) %>
- <% if @holding_pen %>
- <br>This is in the holding pen because: <strong><%= @rejected_reason %></strong>
- <% if @public_bodies.size > 0 %>
- <br>Guessed authority:
- <% for public_body in @public_bodies %>
- <%=public_body_both_links(public_body)%>
- <% end %>
- (based on From: email domain)
- <% end %>
- <% if @info_requests.size > 0 %>
- <br>Guessed request:
- <% for info_request in @info_requests %>
- <%=request_both_links(info_request)%>
- <% end %>
- (based on id, not hash, in To/Cc email)
- <% end %>
- <% end %>
-</p>
-
-<h2>Actions</h2>
-
-<div>
- <%= render :partial => 'incoming_message_actions', :locals => { :incoming_message => @raw_email.incoming_message } %>
-</div>
-
-<h2>Raw email</h2>
-
-<p><%= link_to "Download", "../download_raw_email/" + @raw_email.id.to_s %></p>
-
-<pre><%= h(@raw_email.data).gsub(/\n/, '<br>').html_safe %></pre>
-
diff --git a/app/views/admin_track/_some_tracks.html.erb b/app/views/admin_track/_some_tracks.html.erb
new file mode 100644
index 000000000..e9facfb5d
--- /dev/null
+++ b/app/views/admin_track/_some_tracks.html.erb
@@ -0,0 +1,74 @@
+<% include_destroy = include_destroy || false %>
+<% if track_things.empty? %>
+ <div class="row">
+ <div class="span12">
+ <%=_("No tracked things found.")%>
+ </div>
+ </div>
+<% else %>
+ <div class="accordion" id="tracks">
+ <% for track_thing in track_things %>
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a href="#track_<%=track_thing.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <%=track_thing.id%>:
+ <% if track_thing.public_body_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, public_body_path(track_thing.public_body) %>
+ <% elsif track_thing.info_request_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, request_path(track_thing.info_request) %>
+ <% elsif track_thing.tracked_user_id %>
+ <%= link_to "<code>#{h track_thing.track_query}</code>".html_safe, user_path(track_thing.tracked_user) %>
+ <% else %>
+ <code><%=h track_thing.track_query%></code>
+ <% end %>
+ <% if @admin_user.nil? %>
+ <%# Do not show this on the list of tracks on the user page, because it’s rather repetitive there %>
+ tracked by <%= user_both_links track_thing.tracking_user %>
+ <% end %>
+ </div>
+ <div id="track_<%=track_thing.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% if include_destroy %>
+ <tr>
+ <td colspan="2">
+ <%= form_tag admin_user_destroy_track_path, :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 %>
+ </td>
+ </tr>
+
+ <% end %>
+ <% TrackThing.content_columns.each do |column| %>
+ <tr>
+ <td>
+ <b><%=column.human_name%></b>
+ </td>
+ <td>
+ <% if column.type.to_s == 'datetime' %>
+ <%= I18n.l(track_thing.send(column.name), :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(track_thing.send(column.name))) %>)
+ <% elsif column.name == 'track_medium' and track_thing.track_medium == 'feed' %>
+ <%= link_to track_thing.track_medium, atom_feed_path(:track_id => track_thing.id) %>
+ <% else %>
+ <%= h track_thing.send(column.name)%>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ <tr>
+ <td><b><%=_("Items sent in last month")%></b></td>
+ <td><%= track_thing.track_things_sent_emails.size %></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+ </div>
+<% end %>
+</table>
+
diff --git a/app/views/admin_track/_some_tracks.rhtml b/app/views/admin_track/_some_tracks.rhtml
deleted file mode 100644
index 72ee5fd95..000000000
--- a/app/views/admin_track/_some_tracks.rhtml
+++ /dev/null
@@ -1,31 +0,0 @@
-<table>
- <tr>
- <th>Id</th>
- <th>User</th>
- <% for column in TrackThing.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Items sent by email (in last month)</th>
- <th>Actions</th>
- </tr>
-
-<% for track_thing in track_things %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h track_thing.id %></td>
- <td><%=user_both_links(track_thing.tracking_user) %></td>
- <% for column in TrackThing.content_columns.map { |c| c.name } %>
- <td><%=h track_thing.send(column) %></td>
- <% end %>
- <td><%= track_thing.track_things_sent_emails.size %></td>
- <td>
- <% form_tag '../../user/destroy_track' do %>
- <div>
- <%= hidden_field_tag 'track_id', track_thing.id %>
- <%= submit_tag "Destroy track" %>
- </div>
- <% end %>
- </td>
- </tr>
-<% end %>
-</table>
-
diff --git a/app/views/admin_track/list.html.erb b/app/views/admin_track/list.html.erb
new file mode 100644
index 000000000..5e967a926
--- /dev/null
+++ b/app/views/admin_track/list.html.erb
@@ -0,0 +1,20 @@
+<% @title = _('Listing tracks') %>
+
+<h1><%=@title%></h1>
+
+<%= 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 the query – so use url_names_for_a_particular_request_or_authority_or_person)
+<% end %>
+
+<%= render :partial => 'some_tracks', :locals => { :track_things => @admin_tracks } %>
+
+<%= will_paginate(@admin_tracks, :class => "paginator" ) %>
+
+<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>
+<% end %>
+</ol>
+
diff --git a/app/views/admin_track/list.rhtml b/app/views/admin_track/list.rhtml
deleted file mode 100644
index 58c87ddba..000000000
--- a/app/views/admin_track/list.rhtml
+++ /dev/null
@@ -1,39 +0,0 @@
-<% @title = 'Listing tracks' %>
-
-<h1><%=@title%></h1>
-
-<% form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search the query - so use url_names_for_a_particular_request_or_authority_or_person)
- </p>
-<% end %>
-
-<table>
- <tr>
- <th>Id</th>
- <th>Tracked by</th>
- <% for column in TrackThing.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- <th>Items sent by email (in last month)</th>
- </tr>
-
-<% for track_thing in @admin_tracks %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h track_thing.id %></td>
- <td><%= user_both_links(track_thing.tracking_user) %></td>
- <% for column in TrackThing.content_columns.map { |c| c.name } %>
- <% if column == 'track_medium' and track_thing.track_medium == 'feed'%>
- <td><%= link_to track_thing.track_medium, atom_feed_url(:track_id => track_thing.id) %></td>
- <% else %>
- <td><%=h track_thing.send(column) %></td>
- <% end %>
- <% end %>
- <td><%= track_thing.track_things_sent_emails.size %></td>
- </tr>
-<% end %>
-</table>
-
-<%= will_paginate(@admin_tracks) %>
-
diff --git a/app/views/admin_user/_form.html.erb b/app/views/admin_user/_form.html.erb
new file mode 100644
index 000000000..f1edc0927
--- /dev/null
+++ b/app/views/admin_user/_form.html.erb
@@ -0,0 +1,75 @@
+<%= error_messages_for 'admin_user' %>
+
+<!--[form:admin_user]-->
+
+<div class="control-group">
+ <label for="admin_user_name" class="control-label">Name</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'name', :class => "span3" %>
+ <div class="help-block">
+ will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="admin_user_email" class="control-label">Email</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'email', :class => "span3" %>
+ <div class="help-block">
+ <strong>you must</strong> first validate this
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="admin_level" class="control-label">Admin level</label>
+ <div class="controls">
+ <%= text_field 'admin_user', 'admin_level', :class => "span3" %>
+ <div class="help-block">
+ <strong>none</strong> or <strong>super</strong>; this is for admin features and links which are in the site proper
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="ban_text" class="control-label">Ban text</label>
+ <div class="controls">
+ <%= text_area 'admin_user', 'ban_text', :class => "span6", :rows => 3 %>
+ <div class="help-block">
+ 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
+ <%= link_to 'banned users', admin_user_list_banned_path %> for examples</small>
+ </div>
+ </div>
+</div>
+
+<div class="control-group">
+ <label for="about_me" class="control-label">About me</label>
+ <div class="controls">
+ <%= text_area 'admin_user', 'about_me', :class => "span6", :rows => 3 %>
+ <div class="help-block">
+ user's own text on their profile, format like comments
+ </div>
+ </div>
+</div>
+<div class="control-group">
+ <label for="admin_user_no_limit" class="control-label">No rate limit</label>
+ <div class="controls">
+ <%= check_box 'admin_user', 'no_limit' %>
+ <div class="help-block">
+ disable the limit on daily requests
+ </div>
+ </div>
+</div>
+<div class="control-group">
+ <label for="admin_user_can_make_batch_requests" class="control-label">Can make batch requests</label>
+ <div class="controls">
+ <%= check_box 'admin_user', 'can_make_batch_requests' %>
+ <div class="help-block">
+ allows the user to send a request to multiple authorities at once
+ </div>
+ </div>
+</div>
diff --git a/app/views/admin_user/_form.rhtml b/app/views/admin_user/_form.rhtml
deleted file mode 100644
index be69d9a80..000000000
--- a/app/views/admin_user/_form.rhtml
+++ /dev/null
@@ -1,27 +0,0 @@
-<%= error_messages_for 'admin_user' %>
-
-<!--[form:admin_user]-->
-
-<p><label for="admin_user_name">Name</label> (will change URL name and break URLs; unlike authorities, there is no history; you will need to rebuild the search index afterwards)<br/>
-<%= text_field 'admin_user', 'name', :size => 60 %></p>
-
-<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_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="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
- <%= link_to 'banned users', '../banned' %> for examples</small>)<br/>
-
-<%= text_area 'admin_user', 'ban_text', :cols => 60, :rows => 3 %></p>
-
-<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/admin_user/_user_table.html.erb b/app/views/admin_user/_user_table.html.erb
new file mode 100644
index 000000000..57066bf3f
--- /dev/null
+++ b/app/views/admin_user/_user_table.html.erb
@@ -0,0 +1,47 @@
+<div class="accordion" id="users">
+ <% for user in users %>
+ <div class="accordion-group">
+ <div class="accordion-heading accordion-toggle">
+ <span class="item-title">
+ <a href="#user_<%=user.id%>" data-toggle="collapse" data-parent="requests"><%= chevron_right %></a>
+ <% 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.email)})", "mailto:#{h(user.email)}")%>
+ </span>
+ <span class="item-metadata">
+ updated <%=I18n.l(user.updated_at, :format => "%e %B %Y %H:%M:%S")%>
+ </span>
+ </div>
+ <div id="user_<%=user.id%>" class="accordion-body collapse">
+ <table class="table table-striped table-condensed">
+ <tbody>
+ <% if banned_column %>
+ <tr>
+ <td><b>Ban text</b></td>
+ <td><%= h user.ban_text %></td>
+ </tr>
+ <% end %>
+ <% user.for_admin_column do |name, value, type|%>
+ <tr>
+ <td><b><%=h name%></b></td>
+ <td>
+ <% if type == 'datetime' %>
+ <%= I18n.l(value, :format => "%e %B %Y %H:%M:%S") %>
+ (<%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(value)) %>)
+ <% else %>
+ <%= h value %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ <% end %>
+</div>
+
+<%= will_paginate(users, :class => "paginator") %>
+
diff --git a/app/views/admin_user/_user_table.rhtml b/app/views/admin_user/_user_table.rhtml
deleted file mode 100644
index d35c78594..000000000
--- a/app/views/admin_user/_user_table.rhtml
+++ /dev/null
@@ -1,22 +0,0 @@
-<table>
- <tr>
- <th>Id</th>
- <% for column in ['Name', 'Email', 'Created at', 'Updated at', 'Email confirmed', 'Admin'] + (banned_column ? ['Ban text'] : []) %>
- <th><%= column %></th>
- <% end %>
- </tr>
-
-<% for user in users %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= user.id.to_s %></td>
- <td><%= user_both_links(user) %></td>
- <td><a href="mailto:<%=h user.email %>"><%=h user.email%></a></td>
- <% for column in ['created_at', 'updated_at', 'email_confirmed', 'admin_level'] + (banned_column ? ['ban_text'] : []) %>
- <td><%=h user.send(column) %></td>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-<%= will_paginate(users) %>
-
diff --git a/app/views/admin_user/edit.html.erb b/app/views/admin_user/edit.html.erb
new file mode 100644
index 000000000..e641a13d6
--- /dev/null
+++ b/app/views/admin_user/edit.html.erb
@@ -0,0 +1,11 @@
+<h1><%=@title%></h1>
+
+<%= form_tag admin_user_update_path(@admin_user), :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" %>
diff --git a/app/views/admin_user/edit.rhtml b/app/views/admin_user/edit.rhtml
deleted file mode 100644
index 06ddc57d3..000000000
--- a/app/views/admin_user/edit.rhtml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-<h1><%=@title%></h1>
-
-<% form_tag '../update/' + @admin_user.id.to_s do %>
- <%= render :partial => 'form' %>
- <p><%= submit_tag 'Save', :accesskey => 's' %></p>
-<% end %>
-
-<p>
-<%= link_to 'Show', '../show/' + @admin_user.id.to_s %> |
-<%= link_to 'List all', '../list' %>
-</p>
-
-<% if false #@admin_user.info_requests.size == 0 %>
- <% form_tag('../destroy/' + @admin_user.id.to_s) do %>
- <p>
- <%= hidden_field_tag(:admin_user_id, { :value => @admin_user.id } ) %>
- <%= submit_tag "Destroy " + @admin_user.name %> (this is permanent!)
- </p>
- <% end %>
-<% end %>
-
diff --git a/app/views/admin_user/list.html.erb b/app/views/admin_user/list.html.erb
new file mode 100644
index 000000000..b1238f87a
--- /dev/null
+++ b/app/views/admin_user/list.html.erb
@@ -0,0 +1,13 @@
+<% @title = _('Listing users') %>
+
+<h1><%=@title%></h1>
+
+<%= 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" %>
+<% end %>
+
+<%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %>
+
+
diff --git a/app/views/admin_user/list.rhtml b/app/views/admin_user/list.rhtml
deleted file mode 100644
index 9de381ecc..000000000
--- a/app/views/admin_user/list.rhtml
+++ /dev/null
@@ -1,15 +0,0 @@
-<% @title = 'Listing users' %>
-
-<h1><%=@title%></h1>
-
-<% form_tag("", :method => "get") do %>
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
- <%= submit_tag "Search" %> (substring search, names and emails)
- <%= link_to 'Banned users', 'banned' %>
- </p>
-<% end %>
-
-<%= render :partial => 'user_table', :locals => { :users => @admin_users, :banned_column => false } %>
-
-
diff --git a/app/views/admin_user/list_banned.rhtml b/app/views/admin_user/list_banned.html.erb
index be2d45399..e535415e6 100644
--- a/app/views/admin_user/list_banned.rhtml
+++ b/app/views/admin_user/list_banned.html.erb
@@ -2,7 +2,7 @@
<h1><%=@title%></h1>
-<p><%= link_to 'List all', 'list' %></p>
+<p><%= link_to 'List all', admin_user_list_path %></p>
<%= render :partial => 'user_table', :locals => { :users => @banned_users, :banned_column => true } %>
diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb
new file mode 100644
index 000000000..6d12aeff5
--- /dev/null
+++ b/app/views/admin_user/show.html.erb
@@ -0,0 +1,102 @@
+<% @title = _("User – {{name}}", :name => h(@admin_user.name)) %>
+
+<h1><%=@title%></h1>
+
+<% 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 %>
+ <img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>">
+ <br>
+ <%= submit_tag "Clear photo", :class => "btn btn-info" %>
+ <% end %>
+ </div>
+<% end %>
+
+<table class="table table-striped table-condensed">
+ <tbody>
+ <tr>
+ <td>
+ <b><%=_("Id")%></b>
+ </td>
+ <td>
+ <%=@admin_user.id%>
+ </td>
+ </tr>
+ <% @admin_user.for_admin_column(:complete => true) do |name, value, type, column_name| %>
+ <tr>
+ <td>
+ <b><%=_(name)%></b>
+ </td>
+ <td>
+ <% if column_name == 'email' %>
+ <%=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) %>
+ <% 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 %>
+ <input type="submit" name="action" value="Clear bounce" class="btn btn-info">
+ <% end %>
+ <% end %>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+</table>
+
+
+<%= link_to 'Edit', admin_user_edit_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" %>
+
+<hr>
+
+<h2>Track things</h2>
+<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @admin_user.track_things, :include_destroy => true } %>
+
+<hr>
+
+<h2>Post redirects</h2>
+
+<table class="table table-condensed table-striped">
+ <tr>
+ <th>Id</th>
+ <% for column in PostRedirect.content_columns %>
+ <th><%= column.human_name %></th>
+ <% end %>
+ </tr>
+
+<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h post_redirect.id %></td>
+ <% for column in PostRedirect.content_columns.map { |c| c.name } %>
+ <% if column == 'email_token' %>
+ <td><%=link_to post_redirect.send(column), confirm_path(:email_token => post_redirect.send(column)) %></td>
+ <% else %>
+ <td><%=h post_redirect.send(column) %></td>
+ <% end %>
+ <% end %>
+ </tr>
+<% end %>
+</table>
+
+<hr>
+
+<h2>Requests</h2>
+<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @admin_user.info_requests } %>
+
+<hr>
+
+<h2>Annotations</h2>
+
+<%= render :partial => 'admin_request/some_annotations' , :locals => { :comments => @admin_user.comments } %>
+
+<hr>
+
+<h2>Censor rules</h2>
+<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @admin_user.censor_rules, :user => @admin_user } %>
+
diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml
deleted file mode 100644
index 4af79e45a..000000000
--- a/app/views/admin_user/show.rhtml
+++ /dev/null
@@ -1,74 +0,0 @@
-<% @title = "User - " + h(@admin_user.name) %>
-
-<h1><%=@title%></h1>
-
-<% if @admin_user.profile_photo %>
- <div class="user_photo_on_admin">
- <% form_tag '../clear_profile_photo/' + @admin_user.id.to_s, :multipart => true do %>
- <img src="<%= main_url(get_profile_photo_url(:url_name => @admin_user.url_name, :only_path => true)) %>">
- <br>
- <%= submit_tag "Clear photo" %>
- <% end %>
- </div>
-<% end %>
-
-
-<div>
-<strong>Id:</strong> <%= @admin_user.id%> <br>
-<% for column in User.content_columns %>
- <strong><%= column.human_name %>:</strong>
- <% if column.name == 'email' %>
- <a href="mailto:<%=h @admin_user.email %>"><%=h @admin_user.email%></a>
- <% elsif column.name == 'email_bounce_message' %>
- <% if !@admin_user.email_bounce_message.empty? %>
- <a href="../show_bounce_message/<%= @admin_user.id.to_s %>">See bounce message</a>
- <% end %>
- <% else %>
- <%=h @admin_user.send(column.name) %>
- <% end %>
- <% if column.name == 'email_bounced_at' && !@admin_user.email_bounced_at.nil? %>
- <form action="../clear_bounce/<%= @admin_user.id.to_s %>" style="display: inline;"><input type="submit" name="action" value="Clear bounce"></form>
- <% end %>
- <br>
-<% end %>
-</div>
-
-<p>
- <%= link_to 'Public page', main_url(user_url(@admin_user)) %>
- | <%= link_to 'Edit', '../edit/' + @admin_user.id.to_s %>
- | <%= link_to 'Log in as this user', '../login_as/' + @admin_user.id.to_s %> (also confirms their email)
-</p>
-
-<h2>Track things</h2>
-<%= render :partial => 'admin_track/some_tracks', :locals => { :track_things => @admin_user.track_things } %>
-
-<h2>Post redirects</h2>
-
-<table>
- <tr>
- <th>Id</th>
- <% for column in PostRedirect.content_columns %>
- <th><%= column.human_name %></th>
- <% end %>
- </tr>
-
-<% for post_redirect in @admin_user.post_redirects.find(:all, :order => 'created_at desc') %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%=h post_redirect.id %></td>
- <% for column in PostRedirect.content_columns.map { |c| c.name } %>
- <% if column == 'email_token' %>
- <td><%=link_to post_redirect.send(column), main_url(confirm_url(:email_token => post_redirect.send(column), :only_path => true)) %></td>
- <% else %>
- <td><%=h post_redirect.send(column) %></td>
- <% end %>
- <% end %>
- </tr>
-<% end %>
-</table>
-
-<h2>Requests</h2>
-<%= render :partial => 'admin_request/some_requests', :locals => { :info_requests => @admin_user.info_requests } %>
-
-<h2>Censor rules</h2>
-<%= render :partial => 'admin_censor_rule/show', :locals => { :censor_rules => @admin_user.censor_rules, :user => @admin_user } %>
-
diff --git a/app/views/admin_user/show_bounce_message.rhtml b/app/views/admin_user/show_bounce_message.html.erb
index ad643a13e..ad643a13e 100644
--- a/app/views/admin_user/show_bounce_message.rhtml
+++ b/app/views/admin_user/show_bounce_message.html.erb
diff --git a/app/views/api/request_events.atom.builder b/app/views/api/request_events.atom.builder
index 44759ae7e..648a81e5c 100644
--- a/app/views/api/request_events.atom.builder
+++ b/app/views/api/request_events.atom.builder
@@ -8,7 +8,7 @@ atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/At
entry.updated(event.created_at.utc.iso8601)
entry.tag!("alaveteli:event_type", event.event_type)
- entry.tag!("alaveteli:request_url", main_url(request_url(request)))
+ entry.tag!("alaveteli:request_url", request_url(request))
entry.title(request.title)
entry.content(event.outgoing_message.body, :type => 'text')
@@ -16,7 +16,7 @@ atom_feed("xmlns:alaveteli" => "http://www.alaveteli.org/API/v2/RequestEvents/At
entry.author do |author|
author.name(request.user_name)
if !request.user.nil?
- author.uri(main_url(user_url(request.user)))
+ author.uri(user_url(request.user))
end
author.email(request.incoming_email)
end
diff --git a/app/views/comment/_comment_form.rhtml b/app/views/comment/_comment_form.html.erb
index 120929643..6ca3f4c9f 100644
--- a/app/views/comment/_comment_form.rhtml
+++ b/app/views/comment/_comment_form.html.erb
@@ -1,9 +1,9 @@
-<% form_for(:comment, @comment, :url => { :controller => "comment", :action => "new", :type => "request" }, :html => { :id => 'comment_form' } ) do |f| %>
+<%= form_for(@comment, :as => :comment, :url => { :controller => "comment", :action => "new", :type => "request" }, :html => { :id => 'comment_form' } ) do |f| %>
<p>
<%= f.text_area :body, :rows => 10, :cols => 55 %>
</p>
- <% if !TrackThing.find_by_existing_track(@user, track_thing) && (!@user || @info_request.user != @user) %>
+ <% if !TrackThing.find_existing(@user, track_thing) && (!@user || @info_request.user != @user) %>
<p>
<%= check_box_tag 'subscribe_to_request', "1", params[:subscribe_to_request] ? true : false %> <label for="subscribe_to_request"><%= _('Email me future updates to this request') %></label>
</p>
@@ -13,7 +13,7 @@
<%= hidden_field_tag 'submitted_comment', 1 %>
<%= hidden_field_tag 'preview', 1 %>
<%= submit_tag _('Preview your annotation') %>
- <%= raw(_(' (<strong>no ranty</strong> politics, read our <a href="%s">moderation policy</a>)') % [help_requesting_path+'#moderation']) %>
+ <%= _(' (<strong>no ranty</strong> politics, read our <a href="{{url}}">moderation policy</a>)', :url => (help_requesting_path+'#moderation').html_safe) %>
</p>
<% end %>
diff --git a/app/views/comment/_single_comment.rhtml b/app/views/comment/_single_comment.html.erb
index b645721cf..a6d234b34 100644
--- a/app/views/comment/_single_comment.rhtml
+++ b/app/views/comment/_single_comment.html.erb
@@ -1,5 +1,5 @@
<div class="comment_in_request" id="comment-<%=comment.id.to_s%>">
- <% if comment.user && comment.user.profile_photo %>
+ <% if comment.user && comment.user.profile_photo && !@render_to_file %>
<div class="user_photo_on_comment">
<img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt="">
</div>
@@ -11,17 +11,17 @@
</h2>
<div class="comment_in_request_text">
<p>
- <img class="comment_quote" src="/images/quote-marks.png" alt="">
+ <%= image_tag "quote-marks.png", :class => "comment_quote" %>
<%= comment.get_body_for_html_display %>
</p>
</div>
<p class="event_actions">
<% if !comment.id.nil? %>
- <%= link_to "Link to this", comment_url(comment), :class => "link_to_this" %>
<% if !@user.nil? && @user.admin_page_links? %>
- | <%= link_to "Admin", admin_url("request/edit_comment/" + comment.id.to_s) %>
+ <%= link_to "Admin", admin_request_edit_comment_path(comment) %> |
<% end %>
- <!-- | <%= link_to _('Report abuse'), comment_url(comment) %> -->
+ <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %>
+ <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> -->
<% end %>
</p>
</div>
diff --git a/app/views/comment/_single_comment.text.erb b/app/views/comment/_single_comment.text.erb
new file mode 100644
index 000000000..925e8b688
--- /dev/null
+++ b/app/views/comment/_single_comment.text.erb
@@ -0,0 +1,2 @@
+<%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date(comment.created_at || Time.now) %>)
+<%= comment.body.strip %>
diff --git a/app/views/comment/new.rhtml b/app/views/comment/new.html.erb
index aa5b6051c..578732cdb 100644
--- a/app/views/comment/new.rhtml
+++ b/app/views/comment/new.html.erb
@@ -67,10 +67,10 @@
</ul>
<p>
- <big><%= _('Annotations will be posted publicly here, and are
- <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></big>
+ <span class="big"><%= _('Annotations will be posted publicly here, and are
+ <strong>not</strong> sent to {{public_body_name}}.',:public_body_name=>h(@info_request.public_body.name)) %></span>
<% if @info_request.is_external? %>
- <big><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></big>
+ <span class="big"><%= _('Note that the requester will not be notified about your annotation, because the request was published by {{public_body_name}} on their behalf.', :public_body_name => @info_request.public_body.name) %></span>
<% end %>
</p>
diff --git a/app/views/comment/preview.rhtml b/app/views/comment/preview.html.erb
index 702bd9a9b..cd966e6a5 100644
--- a/app/views/comment/preview.rhtml
+++ b/app/views/comment/preview.html.erb
@@ -1,6 +1,6 @@
<% @title = _("Preview new annotation on '{{info_request_title}}'",:info_request_title=>h(@info_request.title)) %>
-<% form_for(:comment, @comment, :html => { :id => 'preview_form' }, :url => { :controller => "comment", :action => "new", :type => "request" } ) do |f| %>
+<%= form_for(@comment, :html => { :id => 'preview_form' }, :url => { :controller => "comment", :action => "new", :type => "request" } ) do |f| %>
<h1><%= _('Now preview your annotation') %></h1>
diff --git a/app/views/contact_mailer/add_public_body.text.erb b/app/views/contact_mailer/add_public_body.text.erb
new file mode 100644
index 000000000..5baa1fa1a
--- /dev/null
+++ b/app/views/contact_mailer/add_public_body.text.erb
@@ -0,0 +1,19 @@
+<%= _("{{user_name}} would like a new authority added to {{site_name}}", :user_name => @change_request.get_user_name, :site_name => site_name) %>
+
+<%= _("Authority:") %>
+<%= @change_request.get_public_body_name %>
+
+<%= _("Email:") %>
+<%= @change_request.public_body_email %>
+
+<%= _("Source:") %>
+<%= @change_request.source_url %>
+
+<%= _("Notes:") %>
+<%= @change_request.notes %>
+
+<%= _('Add the authority:') %>
+<%= admin_body_new_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 ) %>
diff --git a/app/views/contact_mailer/from_admin_message.rhtml b/app/views/contact_mailer/from_admin_message.rhtml
deleted file mode 100644
index bdb48d580..000000000
--- a/app/views/contact_mailer/from_admin_message.rhtml
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= @message.strip %>
-
diff --git a/app/views/contact_mailer/from_admin_message.text.erb b/app/views/contact_mailer/from_admin_message.text.erb
new file mode 100644
index 000000000..3af759c5d
--- /dev/null
+++ b/app/views/contact_mailer/from_admin_message.text.erb
@@ -0,0 +1 @@
+<%= raw @message %>
diff --git a/app/views/contact_mailer/to_admin_message.rhtml b/app/views/contact_mailer/to_admin_message.rhtml
deleted file mode 100644
index 9c0a74c02..000000000
--- a/app/views/contact_mailer/to_admin_message.rhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<%= @message.strip %>
-
----------------------------------------------------------------------
-<%= _('Message sent using {{site_name}} contact form, ', :site_name=>site_name)%>
-<%=(@logged_in_user ? ("logged in as user " + main_url(user_url(@logged_in_user))) : "not logged in")%><% if !@last_request.nil? %>
-
-<%= _('Last request viewed: ')%><%= main_url(request_url(@last_request)) %>
-<% end %> <% if !@last_body.nil? %>
-
-<%= _('Last authority viewed: ')%><%= main_url(public_body_url(@last_body)) %>
-<% end %>---------------------------------------------------------------------
diff --git a/app/views/contact_mailer/to_admin_message.text.erb b/app/views/contact_mailer/to_admin_message.text.erb
new file mode 100644
index 000000000..dc9b1090b
--- /dev/null
+++ b/app/views/contact_mailer/to_admin_message.text.erb
@@ -0,0 +1,11 @@
+<%= raw @message.strip %>
+
+---------------------------------------------------------------------
+<%= _('Message sent using {{site_name}} contact form, ', :site_name=>site_name)%>
+<%=(@logged_in_user ? ("logged in as user " + user_url(@logged_in_user)) : "not logged in")%><% if !@last_request.nil? %>
+
+<%= _('Last request viewed: ')%><%= request_url(@last_request) %>
+<% end %> <% if !@last_body.nil? %>
+
+<%= _('Last authority viewed: ')%><%= public_body_url(@last_body) %>
+<% end %>---------------------------------------------------------------------
diff --git a/app/views/contact_mailer/update_public_body_email.text.erb b/app/views/contact_mailer/update_public_body_email.text.erb
new file mode 100644
index 000000000..7d5a3dae0
--- /dev/null
+++ b/app/views/contact_mailer/update_public_body_email.text.erb
@@ -0,0 +1,16 @@
+<%= _("{{user_name}} would like the email address for {{public_body_name}} to be updated", :user_name => @change_request.get_user_name, :public_body_name => @change_request.get_public_body_name) %>
+
+<%= _("Email:") %>
+<%= @change_request.public_body_email %>
+
+<%= _("Source:") %>
+<%= @change_request.source_url %>
+
+<%= _("Notes:") %>
+<%= @change_request.notes %>
+
+<%= _('Update the address:') %>
+<%= admin_body_edit_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 ) %>
diff --git a/app/views/contact_mailer/user_message.rhtml b/app/views/contact_mailer/user_message.text.erb
index b1d6e81ae..afa1494db 100644
--- a/app/views/contact_mailer/user_message.rhtml
+++ b/app/views/contact_mailer/user_message.text.erb
@@ -5,7 +5,7 @@
learn your email address. Only reply if that is okay.', :user_name => @from_user.name) %>
---------------------------------------------------------------------
-<%= @message.strip %>
+<%= raw @message.strip %>
---------------------------------------------------------------------
<%= _('View Freedom of Information requests made by {{user_name}}:', :user_name=>@from_user.name)%>
diff --git a/app/views/general/_advanced_search_tips.rhtml b/app/views/general/_advanced_search_tips.html.erb
index 914abc1af..5e19c41e0 100644
--- a/app/views/general/_advanced_search_tips.rhtml
+++ b/app/views/general/_advanced_search_tips.html.erb
@@ -23,27 +23,30 @@
<p><%= _("All the options below can use <strong>status</strong> or <strong>latest_status</strong> before the colon. For example, <strong>status:not_held</strong> will match requests which have <em>ever</em> been marked as not held; <strong>latest_status:not_held</strong> will match only requests that are <em>currently</em> marked as not held.") %></p>
<table class="status_table">
- <tr><td><strong><%=search_link('status:waiting_response', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
- <tr><td><strong><%=search_link('status:not_held', nil, nil, true)%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
- <tr><td><strong><%=search_link('status:rejected', nil, nil, true)%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
- <tr><td><strong><%=search_link('status:partially_successful', nil, nil, true)%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:successful', nil, nil, true)%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
- <tr><td><strong><%=search_link('status:waiting_clarification', nil, nil, true)%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
- <tr><td><strong><%=search_link('status:gone_postal', nil, nil, true)%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
- <tr><td><strong><%=search_link('status:internal_review', nil, nil, true)%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
- <tr><td><strong><%=search_link('status:error_message', nil, nil, true)%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
- <tr><td><strong><%=search_link('status:requires_admin', nil, nil, true)%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
- <tr><td><strong><%=search_link('status:user_withdrawn', nil, nil, true)%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_response')%></strong></td><td><%= _('Waiting for the public authority to reply') %></td></tr>
+ <tr><td><strong><%=search_link('status:not_held')%></strong></td><td><%= _('The public authority does not have the information requested') %></td></tr>
+ <tr><td><strong><%=search_link('status:rejected')%></strong></td><td><%= _('The request was refused by the public authority') %></td></tr>
+ <tr><td><strong><%=search_link('status:partially_successful')%></strong></td><td><%= _('Some of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:successful')%></strong></td><td><%= _('All of the information requested has been received') %></td></tr>
+ <tr><td><strong><%=search_link('status:waiting_clarification')%></strong></td><td><%= _('The public authority would like part of the request explained') %></td></tr>
+ <tr><td><strong><%=search_link('status:gone_postal')%></strong></td><td><%= _('The public authority would like to / has responded by post') %></td></tr>
+ <tr><td><strong><%=search_link('status:internal_review')%></strong></td><td><%= _('Waiting for the public authority to complete an internal review of their handling of the request') %></td></tr>
+ <tr><td><strong><%=search_link('status:error_message')%></strong></td><td><%= _('Received an error message, such as delivery failure.') %></td></tr>
+ <tr><td><strong><%=search_link('status:requires_admin')%></strong></td><td><%= _('A strange reponse, required attention by the {{site_name}} team', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('status:user_withdrawn')%></strong></td><td><%= _('The requester has abandoned this request for some reason') %></td></tr>
</table>
<h2 id="varieties"><%= _('Table of varieties') %></h2>
<p><%= _("All the options below can use <strong>variety</strong> or <strong>latest_variety</strong> before the colon. For example, <strong>variety:sent</strong> will match requests which have <em>ever</em> been sent; <strong>latest_variety:sent</strong> will match only requests that are <em>currently</em> marked as sent.") %></p>
<table class="status_table">
- <tr><td><strong><%=search_link('variety:sent', nil, nil, true)%></strong></td><td><%= _('Original request sent') %></td></tr>
- <tr><td><strong><%=search_link('variety:followup_sent', nil, nil, true)%></strong></td><td><%= _('Follow up message sent by requester') %></td></tr>
- <tr><td><strong><%=search_link('variety:response', nil, nil, true)%></strong></td><td><%= _('Response from a public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:comment', nil, nil, true)%></strong></td><td><%= _('Annotation added to request') %></td></tr>
- <tr><td><strong><%=search_link('variety:authority', nil, nil, true)%></strong></td><td><%= _('A public authority') %></td></tr>
- <tr><td><strong><%=search_link('variety:user', nil, nil, true)%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
+ <tr><td><strong><%=search_link('variety:sent')%></strong></td><td><%= _('Original request sent') %></td></tr>
+ <tr><td><strong><%=search_link('variety:followup_sent')%></strong></td><td><%= # TRANSLATORS: "Follow up message" in this context means a
+ # further message sent by the requester to the authority after
+ # the initial request
+ _('Follow up message sent by requester') %></td></tr>
+ <tr><td><strong><%=search_link('variety:response')%></strong></td><td><%= _('Response from a public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:comment')%></strong></td><td><%= _('Annotation added to request') %></td></tr>
+ <tr><td><strong><%=search_link('variety:authority')%></strong></td><td><%= _('A public authority') %></td></tr>
+ <tr><td><strong><%=search_link('variety:user')%></strong></td><td><%= _('A {{site_name}} user', :site_name=>site_name) %></td></tr>
</table>
</div>
diff --git a/app/views/general/_before_body_end.rhtml b/app/views/general/_before_body_end.html.erb
index 25fdf4684..25fdf4684 100644
--- a/app/views/general/_before_body_end.rhtml
+++ b/app/views/general/_before_body_end.html.erb
diff --git a/app/views/general/_before_head_end.rhtml b/app/views/general/_before_head_end.html.erb
index 8886745ab..8886745ab 100644
--- a/app/views/general/_before_head_end.rhtml
+++ b/app/views/general/_before_head_end.html.erb
diff --git a/app/views/general/_credits.rhtml b/app/views/general/_credits.html.erb
index b1a9ce05e..b1a9ce05e 100644
--- a/app/views/general/_credits.rhtml
+++ b/app/views/general/_credits.html.erb
diff --git a/app/views/general/_custom_state_descriptions.rhtml b/app/views/general/_custom_state_descriptions.html.erb
index 913a6d50a..913a6d50a 100644
--- a/app/views/general/_custom_state_descriptions.rhtml
+++ b/app/views/general/_custom_state_descriptions.html.erb
diff --git a/app/views/general/_custom_state_transitions_complete.rhtml b/app/views/general/_custom_state_transitions_complete.html.erb
index e69de29bb..e69de29bb 100644
--- a/app/views/general/_custom_state_transitions_complete.rhtml
+++ b/app/views/general/_custom_state_transitions_complete.html.erb
diff --git a/app/views/general/_custom_state_transitions_pending.rhtml b/app/views/general/_custom_state_transitions_pending.html.erb
index e69de29bb..e69de29bb 100644
--- a/app/views/general/_custom_state_transitions_pending.rhtml
+++ b/app/views/general/_custom_state_transitions_pending.html.erb
diff --git a/app/views/general/_footer.html.erb b/app/views/general/_footer.html.erb
new file mode 100644
index 000000000..2e10a0f94
--- /dev/null
+++ b/app/views/general/_footer.html.erb
@@ -0,0 +1,8 @@
+<div id="footer">
+ <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_path %>
+<% unless AlaveteliConfiguration::twitter_username.blank? %>
+| <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>"><%= _("Follow us on twitter") %></a>
+<% end %>
+<%= render :partial => 'general/credits' %>
+</div>
+<div class="after-footer">&nbsp;</div>
diff --git a/app/views/general/_footer.rhtml b/app/views/general/_footer.rhtml
deleted file mode 100644
index ab5ab2c47..000000000
--- a/app/views/general/_footer.rhtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<div id="footer">
- <%= link_to _("Contact {{site_name}}", :site_name => site_name), help_contact_url %>
-| <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= Configuration::twitter_username %>"><%= _("Follow us on twitter") %></a>
-<%= render :partial => 'general/credits' %>
-</div>
-<div class="after-footer">&nbsp;</div>
diff --git a/app/views/general/_frontpage_bodies_list.rhtml b/app/views/general/_frontpage_bodies_list.html.erb
index 503b38953..44321f14a 100644
--- a/app/views/general/_frontpage_bodies_list.rhtml
+++ b/app/views/general/_frontpage_bodies_list.html.erb
@@ -1,17 +1,18 @@
-<% if @popular_bodies.size > 0 %>
+<%- popular_bodies = PublicBody.popular_bodies(@locale) %>
+<% 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.visible.count) %>
<ul>
- <% for popular_body in @popular_bodies %>
+ <% 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 %>
+ <%= n_('{{count}} request', '{{count}} requests', popular_body.info_requests_count, :count => popular_body.info_requests_count) %>
</li>
<% end%>
</ul>
<p><strong>
- <%= link_to _('Browse all authorities...'), list_public_bodies_default %>
+ <%= link_to _('Browse all authorities...'), list_public_bodies_default_path %>
</strong></p>
</div>
<% end %>
diff --git a/app/views/general/_frontpage_intro_sentence.rhtml b/app/views/general/_frontpage_intro_sentence.html.erb
index 70b47ad06..74b849fc9 100644
--- a/app/views/general/_frontpage_intro_sentence.rhtml
+++ b/app/views/general/_frontpage_intro_sentence.html.erb
@@ -1,4 +1,4 @@
<h2>
Your <strong>Right to Know</strong>
</h2>
-<p>Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_url %>">Find out more about freedom of information.</a></p>
+<p>Every citizen has the right to access information held by public authorities. <strong>By law, they have to respond</strong>. <a href="<%= help_about_path %>">Find out more about freedom of information.</a></p>
diff --git a/app/views/general/_frontpage_new_request.rhtml b/app/views/general/_frontpage_new_request.html.erb
index 499b60eb5..499b60eb5 100644
--- a/app/views/general/_frontpage_new_request.rhtml
+++ b/app/views/general/_frontpage_new_request.html.erb
diff --git a/app/views/general/_frontpage_requests_list.rhtml b/app/views/general/_frontpage_requests_list.html.erb
index 3b0efb65e..d7d9184c4 100644
--- a/app/views/general/_frontpage_requests_list.rhtml
+++ b/app/views/general/_frontpage_requests_list.html.erb
@@ -1,3 +1,4 @@
+<%- @request_events, @request_events_all_successful = InfoRequest.recent_requests %>
<div id="examples_1">
<h3>
<% if @request_events_all_successful %>
@@ -19,17 +20,17 @@
:public_body_link => public_body_link(event.info_request.public_body)) %>
<% end %>
- <%=link_to h(event.info_request.title), request_url(event.info_request)%>
+ <%=link_to h(event.info_request.title), request_path(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.search_text_main(true), "", 200) %></p>
+ <p class="excerpt" onclick="document.location.href='<%=request_path(event.info_request)%>'"><%= excerpt(event.search_text_main(true), "", :radius => 200) %></p>
</li>
<% end %>
</ul>
<p><strong>
<% if @request_events_all_successful %>
- <%=link_to _('More successful requests...'), request_list_successful_url %>
+ <%=link_to _('More successful requests...'), request_list_successful_path %>
<% else %>
- <%=link_to _('More requests...'), request_list_all_url %>
+ <%=link_to _('More requests...'), request_list_all_path %>
<% end %>
</strong></p>
</div>
diff --git a/app/views/general/_frontpage_search_box.rhtml b/app/views/general/_frontpage_search_box.html.erb
index d2718b3a3..890602416 100644
--- a/app/views/general/_frontpage_search_box.rhtml
+++ b/app/views/general/_frontpage_search_box.html.erb
@@ -6,7 +6,7 @@
</h2>
<form id="search_form" method="post" action="<%= search_redirect_path %>">
<div>
- <input id="query" type="text" size="30" name="query">
+ <input id="query" type="text" size="30" name="query" title="type your search term here" >
<input type="submit" value="<%= _('Search') %>">
</div>
</form>
diff --git a/app/views/general/_header.html.erb b/app/views/general/_header.html.erb
new file mode 100644
index 000000000..55bf719e2
--- /dev/null
+++ b/app/views/general/_header.html.erb
@@ -0,0 +1,37 @@
+<div id="banner">
+ <div id="banner_inner">
+ <div class="lang"><%= render :partial => 'general/locale_switcher' %></div>
+
+ <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>
+ <div id="logged_in_bar">
+ <% if @user %>
+ <%= _('Hello, {{username}}!', :username => h(@user.name))%>
+
+ <% if @user %>
+ <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %>
+ <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %>
+ <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %>
+ <% end %>
+
+
+ <%= link_to _("Sign out"), signout_path(:r => request.fullpath) %>
+ <% else %>
+ <%= link_to _("Sign in or sign up"), signin_path(:r => request.fullpath) %>
+ <% end %>
+ </div>
+ <% end %>
+
+ <div id="navigation_search">
+ <form id="navigation_search_form" method="post" action="<%= search_redirect_path %>">
+ <p>
+ <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query", :title => "type your search term here" } %>
+ <input id="navigation_search_button" type="submit" value="search">
+ </p>
+ </form>
+ </div>
+
+ <%= render :partial => 'general/orglink' %>
+
+ <%= render :partial => 'general/topnav' %>
+ </div>
+</div>
diff --git a/app/views/general/_locale_switcher.rhtml b/app/views/general/_locale_switcher.html.erb
index 2521b5eb5..a318f61f3 100644
--- a/app/views/general/_locale_switcher.rhtml
+++ b/app/views/general/_locale_switcher.html.erb
@@ -2,10 +2,10 @@
<div id="user_locale_switcher">
<div class="btn-group">
<% for possible_locale in FastGettext.default_available_locales %>
- <% if possible_locale == I18n.locale.to_s %>
+ <% if possible_locale == FastGettext.locale %>
<a href="#" class="btn disabled"><%= locale_name(possible_locale) %></a>
<% else %>
- <a href="<%= locale_switcher(possible_locale, params) %>" class="btn"><%= locale_name(possible_locale) %></a>
+ <a href="<%= url_for params.merge(:locale => possible_locale) %>" class="btn"><%= locale_name(possible_locale) %></a>
<% end %>
<% end %>
</div>
diff --git a/app/views/general/_localised_datepicker.rhtml b/app/views/general/_localised_datepicker.html.erb
index ec6593ea0..ee3206957 100644
--- a/app/views/general/_localised_datepicker.rhtml
+++ b/app/views/general/_localised_datepicker.html.erb
@@ -1,16 +1,16 @@
<script type="text/javascript">
$(function() {
$(".use-datepicker").datepicker(
- {closeText: '<%= _("Done") %>',
- prevText: '<%= _("Prev") %>',
- nextText: '<%= _("Next") %>',
- currentText: '<%= _("Today") %>',
+ {closeText: '<%= j _("Done") %>',
+ prevText: '<%= j _("Prev") %>',
+ nextText: '<%= j _("Next") %>',
+ currentText: '<%= j _("Today") %>',
monthNames: <%= raw I18n.translate('date.month_names')[1..-1].to_json %>,
monthNamesShort: <%= raw I18n.translate('date.abbr_month_names')[1..-1].to_json %>,
dayNames: <%= raw I18n.translate('date.day_names').to_json %>,
dayNamesShort: <%= raw I18n.translate('date.abbr_day_names').to_json %>,
dayNamesMin: <%= raw I18n.translate('date.abbr_day_names').collect{|x| x[0..0]}.to_json %>,
- weekHeader: '<%= _("Wk") %>',
+ weekHeader: '<%= j _("Wk") %>',
dateFormat: '<%= I18n.translate('date.formats.default').sub("%Y", "yy").sub("%m", "mm").sub("%d", "dd").gsub("-", "/") %>'}
);
});
diff --git a/app/views/general/_orglink.html.erb b/app/views/general/_orglink.html.erb
new file mode 100644
index 000000000..66002c021
--- /dev/null
+++ b/app/views/general/_orglink.html.erb
@@ -0,0 +1,2 @@
+<%# Put the link to your organisation here, or leave blank %>
+<%= link_to image_tag('logo.png'), frontpage_path, :id=>'logo' %>
diff --git a/app/views/general/_orglink.rhtml b/app/views/general/_orglink.rhtml
deleted file mode 100644
index fbe688d85..000000000
--- a/app/views/general/_orglink.rhtml
+++ /dev/null
@@ -1,2 +0,0 @@
-<%# Put the link to your organisation here, or leave blank %>
-<%= link_to image_tag('logo.png'), frontpage_url, :id=>'logo' %>
diff --git a/app/views/admin_general/_admin_navbar.rhtml b/app/views/general/_popup_banner.html.erb
index 8b1378917..8b1378917 100644
--- a/app/views/admin_general/_admin_navbar.rhtml
+++ b/app/views/general/_popup_banner.html.erb
diff --git a/app/views/general/_popup_banner.rhtml b/app/views/general/_popup_banner.rhtml
deleted file mode 100644
index 8b1378917..000000000
--- a/app/views/general/_popup_banner.rhtml
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/app/views/general/_stylesheet_includes.html.erb b/app/views/general/_stylesheet_includes.html.erb
new file mode 100644
index 000000000..7a1648efd
--- /dev/null
+++ b/app/views/general/_stylesheet_includes.html.erb
@@ -0,0 +1,22 @@
+<%- if @render_to_file %>
+ <style>
+ <%= Rails.application.assets["main.css"].to_s %>
+ <%= Rails.application.assets["print.css"].to_s %>
+ </style>
+<%- else %>
+ <%= stylesheet_link_tag 'application', :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 %>
+ <!--[if LT IE 7]>
+ <%= stylesheet_link_tag 'ie6.css' %>
+ <![endif]-->
+ <!--[if LT IE 8]>
+ <%= stylesheet_link_tag 'ie7.css' %>
+ <![endif]-->
+ <% if AlaveteliConfiguration::force_registration_on_new_request %>
+ <%= stylesheet_link_tag 'jquery.fancybox-1.3.4.css', :rel => "stylesheet" %>
+ <% end %>
+<% end %>
diff --git a/app/views/general/_stylesheet_includes.rhtml b/app/views/general/_stylesheet_includes.rhtml
deleted file mode 100644
index 7a03680f8..000000000
--- a/app/views/general/_stylesheet_includes.rhtml
+++ /dev/null
@@ -1,21 +0,0 @@
- <%= 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 %>
- <%= 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]-->
- <!--[if LT IE 7]>
- <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style>
- <![endif]-->
- <!--[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" %>
- <% if Configuration::force_registration_on_new_request %>
- <%= stylesheet_link_tag 'jquery.fancybox-1.3.4', :rel => "stylesheet" %>
- <% end %>
diff --git a/app/views/general/_topnav.rhtml b/app/views/general/_topnav.html.erb
index 8ef928bba..d37bd97d1 100644
--- a/app/views/general/_topnav.rhtml
+++ b/app/views/general/_topnav.html.erb
@@ -1,10 +1,12 @@
<div id="topnav">
<ul id="navigation">
- <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>
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] != 'blog' and params[:action] != 'search' %>"><%= link_to _("Home"), frontpage_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'request' and ['new', 'select_authority'].include?(params[:action]) %>"><%= link_to _("Make a request"), select_authority_path, :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_path %></li>
+ <li class="<%= 'selected' if params[:controller] == 'public_body' %>"><%= link_to _("View authorities"), list_public_bodies_default_path %></li>
+<% unless AlaveteliConfiguration::blog_feed.empty? %>
+ <li class="<%= 'selected' if params[:controller] == 'general' and params[:action] == 'blog' %>"><%= link_to _("Read blog"), blog_path %></li>
+<% end %>
+ <li class="<%= 'selected' if params[:controller] == 'help' %>"><%= link_to _("Help"), help_about_path %></li>
</ul>
</div>
diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.html.erb
index 07d6d2f14..b81989ca8 100644
--- a/app/views/general/blog.rhtml
+++ b/app/views/general/blog.html.erb
@@ -4,12 +4,12 @@
<div id="right_column">
<div class="act_link">
<h2><%= _("Stay up to date") %></h2>
- <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/>
- <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
+ <%= image_tag "twitter-16.png", :alt => "twitter icon", :class => "twitter-icon" %> <a href="https://twitter.com/<%= @twitter_user %>"><%= _("Follow us on twitter") %></a><br/><br/>
+ <%= image_tag "feed-16.png", :alt => "RSS icon" %> <a href="<%= @feed_url %>"><%= _("Subscribe to blog") %></a>
</div>
- <% if Configuration::twitter_widget_id %>
+ <% if AlaveteliConfiguration::twitter_widget_id %>
<div id="twitter">
- <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= Configuration::twitter_username %>" data-widget-id="<%= Configuration::twitter_widget_id %>">Tweets by @<%= Configuration::twitter_username %></a>
+ <a class="twitter-timeline" data-dnt=true href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>" data-widget-id="<%= AlaveteliConfiguration::twitter_widget_id %>">Tweets by @<%= AlaveteliConfiguration::twitter_username %></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
<% end %>
@@ -20,15 +20,15 @@
<h1><%=@title %></h1>
<div id="blog">
- <% for item in @blog_items: %>
+ <% @blog_items.each do |item| %>
<div class="blog_post">
- <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link']%>"><%=h item['title'] %></a></h2>
- <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=>item['creator']) %></p>
+ <h2 id="<%= Time.parse(item['pubDate'][0]).to_i %>"><a href="<%=item['link'][0]%>"><%=h item['title'][0] %></a></h2>
+ <p class="subtitle"><%= _("Posted on {{date}} by {{author}}", :date=>simple_date(Time.parse(item['pubDate'][0])), :author=> item['creator'] ? item['creator'][0] : item['author'][0]) %></p>
<div>
<% if item['encoded'] %>
- <%= raw item['encoded'] %>
+ <%= raw item['encoded'][0] %>
<% elsif item['description'] %>
- <%= raw item['description'] %>
+ <%= raw item['description'][0] %>
<% end %>
</div>
<p><em>
diff --git a/app/views/general/custom_css.rhtml b/app/views/general/custom_css.rhtml
deleted file mode 100644
index 0def82ed0..000000000
--- a/app/views/general/custom_css.rhtml
+++ /dev/null
@@ -1 +0,0 @@
-// this should be overridden in a local "theme" plugin
diff --git a/app/views/general/exception_caught.rhtml b/app/views/general/exception_caught.html.erb
index 5f0dfe13d..8d78e2e92 100644
--- a/app/views/general/exception_caught.rhtml
+++ b/app/views/general/exception_caught.html.erb
@@ -7,8 +7,8 @@
<ul>
<li><%= _("Check for mistakes if you typed or copied the address.")%></li>
<li><%= _("Search the site to find what you were looking for.")%>
- <% form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form"}) do %>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= form_tag({:controller => "general", :action => "search_redirect"}, {:id => "search_form" }) do %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :title => "type your search term here" } %>
<%= submit_tag _("Search") %>
<% end %>
</li>
diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.html.erb
index 6eceb3b28..8bb32bdf2 100644
--- a/app/views/general/frontpage.rhtml
+++ b/app/views/general/frontpage.html.erb
@@ -1,4 +1,4 @@
-<%# TODO: Cache for 5 minutes %>
+<% cache_if_caching_fragments("frontpage-#{@locale}", :expires_in => 5.minutes) do %>
<div id="frontpage_splash">
<div id="left_column">
<%= render :partial => "frontpage_new_request" %>
@@ -17,3 +17,4 @@
<%= render :partial => "frontpage_bodies_list" %>
<%= render :partial => "frontpage_requests_list" %>
</div>
+<% end %>
diff --git a/app/views/general/search.rhtml b/app/views/general/search.html.erb
index 6df12d980..18f258444 100644
--- a/app/views/general/search.rhtml
+++ b/app/views/general/search.html.erb
@@ -16,13 +16,13 @@
<% if @query.nil? %>
<h1><%= _("Search") %></h1>
<% else %>
- <h1><%= _("Search results") %></h1>
+ <h1><%= _("Search results") %></h1>
<% end%>
<% if @advanced %>
<div id="advanced-search">
<p><%= _('To use the advanced search, combine phrases and labels as described in the search tips below.') %></p>
- <% form_tag(advanced_search_url, :method => "get") do %>
+ <%= form_tag(advanced_search_url, :method => "get") do %>
<p>
<%= text_field_tag :query, @query, { :size => 60 } %>
<%= hidden_field_tag 'sortby', @inputted_sortby %>
@@ -35,15 +35,23 @@
<% end %>
</div>
<% else %>
- <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %>
+
+
+ <%= form_tag(search_redirect_path, {:method => "get", :id => "search_form"}) do %>
+ <p>
+ <%= text_field_tag 'query', params[:query], { :size => 40, :title => "type your search term here" } %>
+
+ <%= submit_tag _("Search") %>
+ <%= link_to(_("Advanced search"), advanced_search_path) %>
+ </p>
+ <% end %>
+ <%= form_tag(request.url, {:method => "get", :id => "filter_form"}) do %>
<p>
- <%= text_field_tag 'query', params[:query], { :size => 40 } %>
<%= hidden_field_tag 'sortby', @inputted_sortby %>
<% if @bodies %>
<%= hidden_field_tag 'bodies', 1 %>
<% end %>
- <%= submit_tag _("Search") %>
- <%= link_to(_("Advanced search"), advanced_search_url) %>
+
</p>
<div id="common-subfilters">
@@ -56,25 +64,13 @@
["all", _("everything")]]%>
<% for variety, label in labels %>
<% if @variety_postfix != variety %>
- <%= link_to label, search_url([params[:query], variety, @sort_postfix]) %>
+ <%= link_to label, search_path([params[:query], variety, @sort_postfix]) %>
<% else %>
<%= label %>
<% end %>
<%= "|" unless variety == labels.last[0]%>
<% end %>
</div>
-
- <% if false %>
- <%-# Commented out for now as tags are of limited use when users can't see them. This will change in the future! -%>
- <% if @variety_postfix != "users" %>
- <div>
- <%= label_tag(:query, _("Tags (separated by a space):")) %><%= text_field_tag(:tags, params[:tags], { :size => 20 }) %>
- <% for tag in InfoRequest.get_tags %>
- <%= tag.name_and_value %>
- <% end %>
- </div>
- <% end %>
- <% end %>
</div>
<% if @variety_postfix == "requests" %>
@@ -94,7 +90,7 @@
<div>
<h3 class="title"><%= _("Search in") %></h3>
- <% [["sent", _("messages from users")],
+ <% [["sent", _("messages from users")],
["response", _("messages from authorities")],
["comment", _("comments")]].each_with_index do |item, index|
variety, title = item %>
@@ -110,21 +106,21 @@
<label class="form_label" for="query">&nbsp;<%= _("and") %></label>
<%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %>
</div>
- </div>
+ </div>
<% end %>
-
+
<div>
<%= submit_tag _("Filter") if @variety_postfix == "requests"%>
</div>
<% end # Search form%>
-
+
<% end # if @advanced %>
- <% if !@query.nil? %>
+ <% if !@query.nil? && @total_hits > 0 %>
<p id="search_controls">
- <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url([params[:query], @variety_postfix, 'relevant'], params) %>
+ <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_path([params[:query], @variety_postfix, 'relevant'], params) %>
|
- <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url([params[:query], @variety_postfix, 'newest'], params) %>
+ <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_path([params[:query], @variety_postfix, 'newest'], params) %>
<% if @sortby == 'described' %>
| <%= _('Recently described results first') %>
<% end %>
@@ -139,9 +135,11 @@
<% end %>
<div style="clear:both;"></div>
-
<% if @total_hits == 0 %>
<h2><%=@title %></h2>
+ <% if @spelling_correction %>
+ <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction)) %></p>
+ <% end %>
<% end %>
<% if not @query.nil? %>
@@ -160,11 +158,8 @@
</div>
<%= will_paginate WillPaginate::Collection.new(@page, @bodies_per_page, @xapian_bodies.matches_estimated) %>
- <% elsif @bodies && !@query.nil? && @xapian_bodies.results.size == 0 && @page == 1 %>
- <% if @spelling_correction %>
- <p id="did_you_mean"><%= _('Did you mean: {{correction}}', :correction => search_link(@spelling_correction, @postfix)) %></p>
- <% end %>
- <p><%= raw(_('<a href="%s">Browse all</a> or <a href="%s">ask us to add one</a>.') % [list_public_bodies_default, help_requesting_path + '#missing_body']) %></p>
+ <% elsif @variety_postfix == 'bodies' %>
+ <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p>
<% end %>
</div>
diff --git a/app/views/help/_sidebar.rhtml b/app/views/help/_sidebar.html.erb
index 2b7ed5647..2b7ed5647 100644
--- a/app/views/help/_sidebar.rhtml
+++ b/app/views/help/_sidebar.html.erb
diff --git a/app/views/help/_why_they_should_reply_by_email.rhtml b/app/views/help/_why_they_should_reply_by_email.html.erb
index faaa2b2e2..faaa2b2e2 100644
--- a/app/views/help/_why_they_should_reply_by_email.rhtml
+++ b/app/views/help/_why_they_should_reply_by_email.html.erb
diff --git a/app/views/help/about.rhtml b/app/views/help/about.html.erb
index 477f0e750..477f0e750 100644
--- a/app/views/help/about.rhtml
+++ b/app/views/help/about.html.erb
diff --git a/app/views/help/alaveteli.rhtml b/app/views/help/alaveteli.html.erb
index 6210f9f24..6210f9f24 100644
--- a/app/views/help/alaveteli.rhtml
+++ b/app/views/help/alaveteli.html.erb
diff --git a/app/views/help/api.rhtml b/app/views/help/api.html.erb
index da6253f87..c6488f93e 100644
--- a/app/views/help/api.rhtml
+++ b/app/views/help/api.html.erb
@@ -19,7 +19,7 @@
<dt>Linking to new requests</dt>
<dd>
<p>To encourage your users to make links to a particular public authority, use URLs of the form
- <%= link_to new_request_to_body_url(:url_name => "liverpool_city_council") , new_request_to_body_url(:url_name => "liverpool_city_council") %>.
+ <%= link_to new_request_to_body_path(:url_name => "liverpool_city_council") , new_request_to_body_path(:url_name => "liverpool_city_council") %>.
These are the parameters you can add to those URLs, either in the URL or from a form.
<ul>
@@ -30,15 +30,15 @@
</ul>
</dd>
- <dt>RSS (actually, Atom) feeds</h2>
+ <dt>RSS (actually, Atom) feeds</dt>
<dd>
<p>There are Atom feeds on most pages which list FOI requests, which you can
use to get updates and links in XML format. Find the URL of the Atom feed in
one of these ways:
<ul>
- <li>Look for the <img src="/images/feed-16.png" alt=""> RSS feed links.</li>
- <li>Examine the <tt>&lt;link rel="alternate" type="application/atom+xml"&gt;</tt> tag in the head of the HTML. </li>
- <li>Add <tt>/feed</tt> to the start of another URL.
+ <li>Look for the <%= image_tag "feed-16.png", :alt => "RSS icon" %> RSS feed links.</li>
+ <li>Examine the <code>&lt;link rel="alternate" type="application/atom+xml"&gt;</code> tag in the head of the HTML. </li>
+ <li>Add <code>/feed</code> to the start of another URL.
</ul>
<p>In particular, even complicated search queries have Atom feeds.
@@ -53,8 +53,8 @@
objects in a structured form. Find them by:
</p>
<ul>
- <li>Adding <tt>.json</tt> to the end of the URL. </li>
- <li>Look for the <tt>&lt;link rel="alternate" type="application/json"&gt;</tt> tag in the head of the HTML. </li>
+ <li>Adding <code>.json</code> to the end of the URL. </li>
+ <li>Look for the <code>&lt;link rel="alternate" type="application/json"&gt;</code> tag in the head of the HTML. </li>
</ul>
<p>Requests, users and authorities all have JSON versions containing basic
@@ -67,11 +67,19 @@
<dd>
<p>
A spreadsheet file listing every body in WhatDoTheyKnow is available:
- <%= link_to "all-authorities.csv", all_public_bodies_csv_url() %>
+ <%= link_to "all-authorities.csv", all_public_bodies_csv_path %>
</p>
</dd>
- </dl>
+
+
+ <dt> 5. Write API </dt>
+ <dd>
+ <p>
+ The write API is designed to be used by authorities to create their own requests in the system. The API is currently used by mySociety's <a href="https://github.com/mysociety/foi-register">FOI Register software</a> to support using Alaveteli as a disclosure log for all FOI activity at a particular public body. More technical information about the write API is available on the <a href="https://github.com/mysociety/alaveteli/wiki/API#write-api">Alaveteli wiki</a>.
+ </p>
+ </dd>
+</dl>
<p>Please <a href="<%= help_contact_path %>">contact us</a> if you need an API feature that isn't there yet. It's
very much a work in progress, and we do add things when people ask us to.</p>
diff --git a/app/views/help/contact.rhtml b/app/views/help/contact.html.erb
index fab5017b8..ad89db9ec 100644
--- a/app/views/help/contact.rhtml
+++ b/app/views/help/contact.html.erb
@@ -40,13 +40,13 @@
<% end %>
</div>
-<% form_for :contact do |f| %>
+<%= form_for :contact do |f| %>
<% if not @user %>
<p>
<label class="form_label" for="contact_name">Your name:</label>
<%= f.text_field :name, :size => 20 %>
- (or <%= link_to "sign in", signin_url(:r => request.request_uri) %>)
+ (or <%= link_to "sign in", signin_path(:r => request.fullpath) %>)
</p>
<p>
diff --git a/app/views/help/credits.rhtml b/app/views/help/credits.html.erb
index 02f1e40e8..02f1e40e8 100644
--- a/app/views/help/credits.rhtml
+++ b/app/views/help/credits.html.erb
diff --git a/app/views/help/officers.rhtml b/app/views/help/officers.html.erb
index b13e225fe..a227b01c5 100644
--- a/app/views/help/officers.rhtml
+++ b/app/views/help/officers.html.erb
@@ -52,7 +52,7 @@
<dt id="email_only">An email isn't a sufficient address for an FOI request! <a href="#email_only">#</a> </dt>
<dd>Yes it is. This
- <a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives guidance on the matter, specifically
+ <a href="https://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives guidance on the matter, specifically
in the context of requests made via WhatDoTheyKnow.
</dd>
@@ -66,7 +66,7 @@
via WhatDoTheyKnow. Moreover, since all requests are public it is much easier
for you to see if one of our users is making vexatious requests. </p>
<p>If that isn't enough for you, the
- <a href="http://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives some guidance on the matter.</p>
+ <a href="https://www.whatdotheyknow.com/request/1142/response/2894/attach/5/20080806100741260.pdf">letter from the ICO to Rother District Council</a> gives some guidance on the matter.</p>
</dd>
<dt id="spam_problems">I can see a request on WhatDoTheyKnow, but we never got it by email!<a href="#spam_problems">#</a> </dt>
@@ -135,7 +135,7 @@
<li>If the day the request email was delivered was a non-working day, we count
the next working day as "day one". Delivery is delivery, even if it happened on
- the weekend. Some authorities <a href="http://www.whatdotheyknow.com/request/policy_regarding_body_scans#incoming-1100">disagree with this</a>, our lawyer disagrees with them. </li>
+ the weekend. Some authorities <a href="https://www.whatdotheyknow.com/request/policy_regarding_body_scans#incoming-1100">disagree with this</a>, our lawyer disagrees with them. </li>
<li>Requesters are encouraged to mark when they have <strong>clarified</strong>
their request so the clock resets, but sometimes they get this wrong. If you
@@ -222,7 +222,7 @@
form in an annotation.
</dd>
- <dt id="copyright"><a name="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
+ <dt id="copyright"><a id="commercial"></a>What is your policy on copyright of documents?<a href="#copyright">#</a> </dt>
<dd>Our Freedom of Information law is "applicant blind", so anyone in the
world can request the same document and get a copy of it.
@@ -235,9 +235,6 @@
</dl>
-
- </dl>
-
<p><strong>If you haven't already</strong>, read <a href="<%= help_about_path %>">the introduction</a> --&gt;
<br><strong>Otherwise</strong>, the <a href="<%= help_credits_path %>">credits</a> or the <a href="<%= help_api_path %>">programmers API</a> --&gt;
diff --git a/app/views/help/privacy.rhtml b/app/views/help/privacy.html.erb
index 8e5293892..f0e82ab13 100644
--- a/app/views/help/privacy.rhtml
+++ b/app/views/help/privacy.html.erb
@@ -84,6 +84,11 @@ ask a friend to. We don't have the resources to do this for everyone.
</dd>
+<dt id="anonymous">Why are there anonymous requests on the site? <a href="#anonymous">#</a> </dt>
+<dd>
+Some public authorities are using mySociety's <a href="https://github.com/mysociety/foi-register">FOI Register</a> software in order to use WhatDoTheyKnow as a disclosure log for all their FOI activity. When people make requests to the authority their names will usually be withheld from publication just as they would in an authority disclosure log on an authority website.
+</dd>
+
<dt id="full_address">They've asked for my postal address! <a href="#full_address">#</a> </dt>
<dd>
@@ -111,7 +116,7 @@ address should be treated as the return address."
<dd>
<p>If an authority only has a paper copy of the information that you want,
they may ask you for a postal address. To start with, try persuading them
-to scan in the documents for you. You can even <a href="http://www.whatdotheyknow.com/request/car_parking_charges_policy_and_a#outgoing-532">offer to gift them a scanner</a>, which in that particular case
+to scan in the documents for you. You can even <a href="https://www.whatdotheyknow.com/request/car_parking_charges_policy_and_a#outgoing-532">offer to gift them a scanner</a>, which in that particular case
embarrassed the authority into finding one they had already.</p>
<p>If that doesn't work, and you want to provide your postal address privately
diff --git a/app/views/help/requesting.rhtml b/app/views/help/requesting.html.erb
index e7cfdd199..51358c6d9 100644
--- a/app/views/help/requesting.rhtml
+++ b/app/views/help/requesting.html.erb
@@ -30,7 +30,7 @@
<dt id="missing_body">You're missing the public authority that I want to request from! <a href="#missing_body">#</a> </dt>
<dd>
- <p>Please <a href="<%= help_contact_path %>">contact us</a> with the name of the public authority and,
+ <p>Please <a href="<%= new_change_request_path %>">contact us</a> with the name of the public authority and,
if you can find it, their contact email address for Freedom of Information requests.
</p>
<p>If you'd like to help add a whole category of public authority to the site, we'd love
@@ -235,7 +235,7 @@
<dt id="eir">Why can I only request information about the environment from some authorities? <a href="#eir">#</a> </dt>
<dd>
- <p>Some public authorities, such as <a href="http://www.whatdotheyknow.com/body/south_east_water">South East Water</a>,
+ <p>Some public authorities, such as <a href="https://www.whatdotheyknow.com/body/south_east_water">South East Water</a>,
don't come under the Freedom of Information Act, but do come under another law called
the Environmental Information Regulations (EIR).
</p>
diff --git a/app/views/help/unhappy.rhtml b/app/views/help/unhappy.html.erb
index 2b00341c2..79e3f8273 100644
--- a/app/views/help/unhappy.rhtml
+++ b/app/views/help/unhappy.html.erb
@@ -29,7 +29,7 @@ to your request '<%=request_link(@info_request) %>'?
<p>
<% if !@info_request.nil? %>
- <%= link_to "Request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup", :class => 'link_button_green' %> and then write a message asking the authority to review your request.
+ <%= link_to "Request an internal review", show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup", :class => 'link_button_green' %> and then write a message asking the authority to review your request.
<% else %>
At the bottom of the relevant request page on <%= site_name %> choose
"request an internal review". Then write a message asking for an internal
@@ -62,7 +62,7 @@ to the Scottish Information Commissioner</a>.
Information Commissioner, either
<% if !@info_request.nil? %>
include a link to your request
- <strong><%=h main_url(request_url(@info_request)) %></strong>
+ <strong><%=h request_url(@info_request) %></strong>
<% else %>
include a link to your request on <%= site_name %>
<% end %>
diff --git a/app/views/holiday/due_date.rhtml b/app/views/holiday/due_date.html.erb
index 6f8c2e51a..6f8c2e51a 100644
--- a/app/views/holiday/due_date.rhtml
+++ b/app/views/holiday/due_date.html.erb
diff --git a/app/views/info_request_batch/_info_request_batch.html.erb b/app/views/info_request_batch/_info_request_batch.html.erb
new file mode 100644
index 000000000..86ef90654
--- /dev/null
+++ b/app/views/info_request_batch/_info_request_batch.html.erb
@@ -0,0 +1,15 @@
+<div class="request_listing">
+ <div class="request_left">
+ <span class="head">
+ <%= link_to highlight_words(info_request_batch.title, @highlight_words), info_request_batch_path(info_request_batch) %>
+ </span>
+ <div class="requester">
+ <%= _('Batch created by {{info_request_user}} on {{date}}.', :info_request_user => user_link_absolute(info_request_batch.user),:date=>simple_date(info_request_batch.created_at)) %>
+ </div>
+ </div>
+ <div class="request_right">
+ <span class="desc">
+ <%= excerpt(info_request_batch.body, '', :radius => 150) %>
+ </span>
+ </div>
+</div>
diff --git a/app/views/info_request_batch/show.html.erb b/app/views/info_request_batch/show.html.erb
new file mode 100644
index 000000000..aaecdd45d
--- /dev/null
+++ b/app/views/info_request_batch/show.html.erb
@@ -0,0 +1,25 @@
+<% @title = _("{{title}} - a batch request", :title => @info_request_batch.title) %>
+<h1><%= @title %></h1>
+<% if @info_request_batch.sent_at %>
+ <%= n_('Sent to one authority by {{info_request_user}} on {{date}}.', 'Sent to {{authority_count}} authorities by {{info_request_user}} on {{date}}.', @info_request_batch.info_requests.size, :authority_count=> @info_request_batch.info_requests.size, :info_request_user => user_link(@info_request_batch.user), :date => simple_date(@info_request_batch.sent_at)) %>
+ <div class="results_section">
+ <div class="results_block">
+ <% @info_requests.each do |info_request| %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => info_request.last_event_forming_initial_request, :info_request => info_request } %>
+ <% end %>
+ </div>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.info_requests.visible.count) %>
+ </div>
+
+<% else %>
+ <%= _('Created by {{info_request_user}} on {{date}}.', :info_request_user => user_link(@info_request_batch.user), :date => simple_date(@info_request_batch.created_at)) %>
+ <%= _('Requests will be sent to the following bodies:') %>
+ <div class="results_section">
+ <div class="results_block">
+ <%= render :partial => 'public_body/body_listing', :locals => { :public_bodies => @public_bodies } %>
+ </div>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @info_request_batch.public_bodies.count) %>
+ </div>
+
+<% end %>
+
diff --git a/app/views/info_request_batch_mailer/batch_sent.text.erb b/app/views/info_request_batch_mailer/batch_sent.text.erb
new file mode 100644
index 000000000..25fb7d06a
--- /dev/null
+++ b/app/views/info_request_batch_mailer/batch_sent.text.erb
@@ -0,0 +1,15 @@
+<%= _('Your batch request "{{title}}" has been sent', :title => @info_request_batch.title) %>
+
+
+<%= _('Follow this link to see the requests:')%>
+
+<%= @url %>
+
+<% if !@unrequestable.empty? %>
+<%= _('Unfortunately, we do not have a working address for {{public_body_names}}.', :public_body_names => @unrequestable.map{|body| body.name}.join(",")) %>
+<%= _('You may be able to find one on their website, or by phoning them up and asking. If you manage to find one, then please send it to us:') %>
+
+<%= help_contact_url %>
+
+<% end %>
+-- <%= _('the {{site_name}} team', :site_name => site_name) %>
diff --git a/app/views/layouts/_favicon.html.erb b/app/views/layouts/_favicon.html.erb
new file mode 100644
index 000000000..0ee7d48e3
--- /dev/null
+++ b/app/views/layouts/_favicon.html.erb
@@ -0,0 +1 @@
+<%= favicon_link_tag 'favicon.ico' %>
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb
new file mode 100644
index 000000000..c1f9335b1
--- /dev/null
+++ b/app/views/layouts/admin.html.erb
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html lang="en-gb">
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
+ <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>
+
+ <%= javascript_include_tag "admin" %>
+ <%= stylesheet_link_tag "admin", :title => "Main", :rel => "stylesheet" %>
+
+ </head>
+ <body class="admin">
+ <div id="main" class="container">
+ <%= render :partial => 'admin_general/admin_navbar' %>
+ <% if flash[:error] %>
+ <div class="row">
+ <div class="span12">
+ <div class="alert alert-error">
+ <%= flash[:error] %>
+ </div>
+ </div>
+ </div>
+ <% end %>
+
+ <% if flash[:notice] %>
+ <div class="row">
+ <div class="span12">
+ <div class="alert alert-info">
+ <%= flash[:notice] %>
+ </div>
+ </div>
+ </div>
+ <% end %>
+
+ <%= yield %>
+ </div>
+ </body>
+</html>
diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml
deleted file mode 100644
index d85eecbf2..000000000
--- a/app/views/layouts/admin.rhtml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="en-gb">
- <head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" >
- <title><%= site_name %> admin<%= @title ? ":" : "" %> <%=@title%></title>
-
- <%= javascript_include_tag 'jquery.js', 'jquery-ui.min' %>
-
- <%= stylesheet_link_tag 'admin-theme/jquery-ui-1.8.15.custom.css', :rel => 'stylesheet'%>
- <%= stylesheet_link_tag 'admin', :title => "Main", :rel => "stylesheet" %>
- </head>
- <body class="admin">
-
- <p>
- <strong><%= link_to 'Alaveteli', main_url('/') %> admin:</strong>
- <%= link_to 'Summary', admin_url("") %>
- | <%= link_to 'Timeline', admin_url("timeline") %>
- | <%= link_to 'Stats', admin_url("stats") %>
- | <%= link_to 'Debug', admin_url("debug") %>
- <strong>View:</strong>
- <%= link_to 'Authorities', admin_url("body/list") %>
- | <%= link_to 'Requests', admin_url("request/list") %>
- | <%= link_to 'Users', admin_url("user/list") %>
- | <%= link_to 'Tracks', admin_url("track/list") %>
- </p>
- <%= render :partial => 'general/locale_switcher' %>
-
- <% if flash[:error] %>
- <p id="error"><%= flash[:error] %></p>
- <% end %>
-
- <% if flash[:notice] %>
- <p id="notice"><%= flash[:notice] %></p>
- <% end %>
-
- <%= yield %>
-
- </body>
-</html>
diff --git a/app/views/layouts/contact_mailer.rhtml b/app/views/layouts/contact_mailer.html.erb
index 3cdc75009..3cdc75009 100644
--- a/app/views/layouts/contact_mailer.rhtml
+++ b/app/views/layouts/contact_mailer.html.erb
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.html.erb
index 6ac7064a7..52b718be8 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.html.erb
@@ -1,6 +1,7 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
+ <meta charset="utf-8">
<title>
<% if @title %>
<%=@title%> - <%= site_name %>
@@ -9,18 +10,17 @@
<% end %>
</title>
- <link rel="shortcut icon" href="/favicon.ico">
+ <%= render :partial => 'layouts/favicon' %>
<%= render :partial => 'general/stylesheet_includes' %>
<% if is_admin? %>
- <%= stylesheet_link_tag "/adminbootstraptheme/stylesheets/admin", :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag "admin", :title => "Main", :rel => "stylesheet" %>
<% end %>
- <%= javascript_include_tag 'jquery.js', 'jquery-ui.min','jquery.cookie.js', 'general.js' %>
+ <%= javascript_include_tag "application" %>
<% if @profile_photo_javascript %>
- <script type="text/javascript" src="/javascripts/jquery.Jcrop.js"></script>
- <script type="text/javascript" src="/javascripts/profile_photo.js"></script>
- <link rel="stylesheet" href="/stylesheets/jquery.Jcrop.css" type="text/css" >
+ <%= javascript_include_tag "profile-photos" %>
+ <%= stylesheet_link_tag "jquery.Jcrop.css" %>
<% end %>
<% if @feed_autodetect %>
@@ -32,7 +32,7 @@
<% end %>
<% end %>
<% if @has_json %>
- <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h main_url(request.request_uri, '.json') %>">
+ <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h url_for(request.params.merge(:format => 'json')) %>">
<% end %>
<% if @no_crawl %>
@@ -42,8 +42,8 @@
<%= render :partial => 'general/before_head_end' %>
</head>
<body class="<%= 'front' if params[:action] == 'frontpage' %>">
- <% if Configuration::force_registration_on_new_request && !@user %>
- <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack' %>
+ <% if AlaveteliConfiguration::force_registration_on_new_request && !@user %>
+ <%= javascript_include_tag 'jquery.fancybox-1.3.4.pack.js' %>
<script type="text/javascript">
$(document).ready(function() {
$("#make-request-link").fancybox({
@@ -51,7 +51,7 @@
'width': 920,
'height': 400,
'type': 'iframe',
- 'href': '/<%= I18n.locale %>/profile/sign_in?modal=1',
+ 'href': '/<%= FastGettext.locale %>/profile/sign_in?modal=1',
'onClosed': function() {
// modal_signin_successful variable set by modal dialog box
if (typeof modal_signin_successful != 'undefined' ) {
@@ -67,52 +67,22 @@
<%= render :partial => 'admin_general/admin_navbar' %>
<% end %>
-<% if !@popup_banner.blank? %>
-<div id="everypage" class="jshide">
- <p class="popup-close"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p>
- <%= @popup_banner %>
- <p class="popup-close"><a href="#top" onclick="$.cookie('seen_foi2', 1, { expires: 7, path: '/' }); $('#everypage').hide('slow'); return false;"><%= _('Close') %></a></p>
-</div>
-<% end %>
-
<div class="entirebody">
- <div id="banner">
- <div id="banner_inner">
- <div class="lang"><%= render :partial => 'general/locale_switcher' %></div>
-
- <% if not (controller.action_name == 'signin' or controller.action_name == 'signup') %>
- <div id="logged_in_bar">
- <% if @user %>
- <%= _('Hello, {{username}}!', :username => h(@user.name))%>
-
- <% if @user %>
- <%=link_to _("My requests"), show_user_requests_path(:url_name => @user.url_name) %>
- <%=link_to _("My profile"), show_user_profile_path(:url_name => @user.url_name) %>
- <%=link_to _("My wall"), show_user_wall_path(:url_name => @user.url_name) %>
- <% end %>
-
-
- <%= link_to _("Sign out"), signout_url(:r => request.request_uri) %>
- <% else %>
- <%= link_to _("Sign in or sign up"), signin_url(:r => request.request_uri) %>
- <% end %>
- </div>
- <% end %>
-
- <div id="navigation_search">
- <form id="navigation_search_form" method="post" action="<%= search_redirect_path %>">
- <p>
- <%= text_field_tag 'query', params[:query], { :size => 40, :id => "navigation_search_query" } %>
- <input id="navigation_search_button" type="submit" value="search">
- </p>
- </form>
- </div>
-
- <%= render :partial => 'general/orglink' %>
-
- <%= render :partial => 'general/topnav' %>
- </div>
+ <% popup_banner = render(:partial => "general/popup_banner").strip %>
+ <% if popup_banner.present? and ! @render_to_file %>
+ <div id="everypage" class="popup">
+ <span class="popup-content">
+ <%= raw popup_banner %>
+ </span>
+ <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span>
+ </div>
+ <% end %>
+ <div id="other-country-notice" class="popup">
+ <span class="popup-content">
+ </span>
+ <span class="popup-close"><a href="#top" ><%= _('Close') %></a></span>
</div>
+ <%= render :partial => 'general/header' %>
<div id="wrapper">
<div id="content">
<% if flash[:notice] %>
@@ -132,20 +102,19 @@
<%= render :partial => 'general/footer' %>
</div>
-<div id="other-country-notice"></div>
<div id="link_box"><span class="close-button">X</span>
<%= _("Paste this link into emails, tweets, and anywhere else:") %>
<br />
<input type="text">
</div>
<%
- unless Configuration::ga_code.empty? || (@user && @user.super?) %>
+ unless AlaveteliConfiguration::ga_code.empty? || (@user && @user.super?) %>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
- var pageTracker = _gat._getTracker("<%= Configuration::ga_code %>");
+ var pageTracker = _gat._getTracker("<%= AlaveteliConfiguration::ga_code %>");
pageTracker._trackPageview();
</script>
diff --git a/app/views/layouts/no_chrome.rhtml b/app/views/layouts/no_chrome.html.erb
index 74c79b701..e613b8ca2 100644
--- a/app/views/layouts/no_chrome.rhtml
+++ b/app/views/layouts/no_chrome.html.erb
@@ -1,6 +1,7 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
+ <meta charset="utf-8">
<title>
<% if @title %>
<%=@title%> - <%= site_name %>
@@ -9,21 +10,16 @@
<% end %>
</title>
- <script type="text/javascript" src="/javascripts/jquery.js"></script>
+ <%= javascript_include_tag "application" %>
- <%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %>
- <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %>
- <%= stylesheet_link_tag 'theme', :rel => "stylesheet" %>
- <!--[if LT IE 7]>
- <style type="text/css">@import url("/stylesheets/ie6.css");</style>
+ <%= stylesheet_link_tag 'application', :title => "Main", :rel => "stylesheet" %>
+ <%= stylesheet_link_tag 'fonts', :rel => "stylesheet" %>
+ <!--[if LT IE 7]>
+ <%= stylesheet_link_tag 'ie6', :rel => "stylesheet" %>
<![endif]-->
- <!--[if LT IE 7]>
- <style type="text/css">@import url("/stylesheets/ie6-custom.css");</style>
- <![endif]-->
- <%= stylesheet_link_tag 'custom', :title => "Main", :rel => "stylesheet" %>
</head>
<body>
- <div class="entirebody">
+ <div class="entirebody">
<div id="content">
<% if flash[:notice] %>
<div id="notice"><%= flash[:notice] %></div>
@@ -38,4 +34,4 @@
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/app/views/layouts/outgoing_mailer.rhtml b/app/views/layouts/outgoing_mailer.html.erb
index 8bf8ef216..8bf8ef216 100644
--- a/app/views/layouts/outgoing_mailer.rhtml
+++ b/app/views/layouts/outgoing_mailer.html.erb
diff --git a/app/views/layouts/request_mailer.rhtml b/app/views/layouts/request_mailer.html.erb
index 3cdc75009..3cdc75009 100644
--- a/app/views/layouts/request_mailer.rhtml
+++ b/app/views/layouts/request_mailer.html.erb
diff --git a/app/views/layouts/user_mailer.rhtml b/app/views/layouts/user_mailer.html.erb
index 3cdc75009..3cdc75009 100644
--- a/app/views/layouts/user_mailer.rhtml
+++ b/app/views/layouts/user_mailer.html.erb
diff --git a/app/views/outgoing_mailer/_followup_footer.rhtml b/app/views/outgoing_mailer/_followup_footer.text.erb
index d7bc7c5aa..d7bc7c5aa 100644
--- a/app/views/outgoing_mailer/_followup_footer.rhtml
+++ b/app/views/outgoing_mailer/_followup_footer.text.erb
diff --git a/app/views/outgoing_mailer/followup.rhtml b/app/views/outgoing_mailer/followup.text.erb
index 7050a295b..049ebc881 100644
--- a/app/views/outgoing_mailer/followup.rhtml
+++ b/app/views/outgoing_mailer/followup.text.erb
@@ -1,6 +1,6 @@
-<%= @outgoing_message.body.strip %>
+<%= raw @outgoing_message.body.strip %>
-<%= @outgoing_message.quoted_part_to_append_to_email.strip %>
+<%= raw @outgoing_message.quoted_part_to_append_to_email.strip %>
-------------------------------------------------------------------
<%= _('Please use this email address for all replies to this request:')%>
diff --git a/app/views/outgoing_mailer/initial_request.rhtml b/app/views/outgoing_mailer/initial_request.text.erb
index d537a20bc..b0f1dc9e8 100644
--- a/app/views/outgoing_mailer/initial_request.rhtml
+++ b/app/views/outgoing_mailer/initial_request.text.erb
@@ -1,4 +1,4 @@
-<%= @outgoing_message.body.strip %>
+<%= raw @outgoing_message.body.strip %>
-------------------------------------------------------------------
@@ -6,7 +6,7 @@
<%= @info_request.incoming_email %>
<%= _('Is {{email_address}} the wrong address for {{type_of_request}} requests to {{public_body_name}}? If so, please contact us using this form:', :email_address => @info_request.public_body.request_email, :type_of_request => @info_request.law_used_full, :public_body_name => @info_request.public_body.name)%>
-<%= help_contact_url %>
+<%= new_change_request_url(:body => @info_request.public_body.url_name) %>
<%= render :partial => 'followup_footer' %>
diff --git a/app/views/public_body/_alphabet.html.erb b/app/views/public_body/_alphabet.html.erb
new file mode 100644
index 000000000..63b24e0fb
--- /dev/null
+++ b/app/views/public_body/_alphabet.html.erb
@@ -0,0 +1,3 @@
+<%- "A".upto("Z") do |l| -%>
+ <%= link_to_unless (@tag == l), l, list_public_bodies_path(:tag => l.downcase) %>
+<% end %>
diff --git a/app/views/public_body/_alphabet.rhtml b/app/views/public_body/_alphabet.rhtml
deleted file mode 100644
index 92674b8aa..000000000
--- a/app/views/public_body/_alphabet.rhtml
+++ /dev/null
@@ -1,3 +0,0 @@
-<% "A".upto("Z") do |l| -%>
- <%= link_to_unless (@tag == l), l, list_public_bodies_url(:tag => l.downcase) %>
-<% end %>
diff --git a/app/views/public_body/_body_listing.rhtml b/app/views/public_body/_body_listing.html.erb
index 864ab8c9b..864ab8c9b 100644
--- a/app/views/public_body/_body_listing.rhtml
+++ b/app/views/public_body/_body_listing.html.erb
diff --git a/app/views/public_body/_body_listing_single.rhtml b/app/views/public_body/_body_listing_single.html.erb
index b01d2ebb2..91a07d09c 100644
--- a/app/views/public_body/_body_listing_single.rhtml
+++ b/app/views/public_body/_body_listing_single.html.erb
@@ -4,7 +4,7 @@
<div class="body_listing">
<span class="head">
- <%= link_to highlight_words(public_body.name, @highlight_words), public_body_url(public_body) %>
+ <%= link_to highlight_words(public_body.name, @highlight_words), public_body_path(public_body) %>
</span>
<span class="desc">
<% if !public_body.short_name.empty? || !public_body.notes_without_html.empty? %>
@@ -18,9 +18,16 @@
<% end %>
</span>
<span class="bottomline">
- <%= n_('%d request made.', '%d requests made.', public_body.info_requests.size) % public_body.info_requests.size %>
- <% if !@include_request_link_in_authority_listing.nil? %>
- <%= link_to _("Make your own request"), public_body_url(public_body) %>.
+ <%= n_('{{count}} request made.', '{{count}} requests made.', public_body.info_requests.size,
+ :count => public_body.info_requests.size) %>
+ <% if !public_body.is_requestable? && public_body.not_requestable_reason != 'bad_contact' %>
+ <% if public_body.not_requestable_reason == 'defunct' %>
+ <%= _('Defunct.') %>
+ <% end %>
+ <% else %>
+ <% if !@include_request_link_in_authority_listing.nil? %>
+ <%= link_to _("Make your own request"), public_body_path(public_body) %>.
+ <% end %>
<% end %>
<br>
<span class="date_added">
diff --git a/app/views/public_body/_list_sidebar_extra.html.erb b/app/views/public_body/_list_sidebar_extra.html.erb
new file mode 100644
index 000000000..290593d6a
--- /dev/null
+++ b/app/views/public_body/_list_sidebar_extra.html.erb
@@ -0,0 +1,6 @@
+<p>
+ <%= link_to _('Are we missing a public authority?'), help_requesting_path + '#missing_body' %>
+</p>
+<p>
+ <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_path %>
+</p>
diff --git a/app/views/public_body/_list_sidebar_extra.rhtml b/app/views/public_body/_list_sidebar_extra.rhtml
deleted file mode 100644
index 54f20a736..000000000
--- a/app/views/public_body/_list_sidebar_extra.rhtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<p>
- <%= raw(_('<a href="%s">Are we missing a public authority?</a>') % [help_requesting_path + '#missing_body']) %>
-</p>
-<p>
- <%= link_to _('List of all authorities (CSV)'), all_public_bodies_csv_url() %>
-</p>
diff --git a/app/views/public_body/_search_ahead.rhtml b/app/views/public_body/_search_ahead.html.erb
index 7ade89b8e..2de638034 100644
--- a/app/views/public_body/_search_ahead.rhtml
+++ b/app/views/public_body/_search_ahead.html.erb
@@ -1,4 +1,4 @@
-<div>
+
<% if !@xapian_requests.nil? %>
<% if @xapian_requests.results.size > 0 %>
<h3><%= _('Top search results:') %></h3>
@@ -10,12 +10,9 @@
<% end %>
<div id="authority_search_ahead_results">
<% for result in @xapian_requests.results %>
- <%= render :partial => 'body_listing_single', :locals => { :public_body => result[:model] } %>
+ <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
<% end %>
</div>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated), :params => {:controller=>"request", :action => "select_authority"} %>
+ <p><%= raw(_('<a href="{{browse_url}}">Browse all</a> or <a href="{{add_url}}">ask us to add one</a>.', :browse_url => list_public_bodies_default_path.html_safe, :add_url => (help_requesting_path + '#missing_body').html_safe)) %></p>
<% end %>
-</div>
-
-
-
diff --git a/app/views/public_body/list.rhtml b/app/views/public_body/list.html.erb
index 94fbb759c..ce24daaf9 100644
--- a/app/views/public_body/list.rhtml
+++ b/app/views/public_body/list.html.erb
@@ -10,7 +10,7 @@
<% for row in PublicBodyCategories::get().with_headings() %>
<% if row.instance_of?(Array) %>
<li>
- <%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_url(:tag => row[0]) %>
+ <%= link_to_unless (@tag == row[0]), row[1], list_public_bodies_path(:tag => row[0]) %>
</li>
<% else %>
<% if not first_row %>
@@ -23,7 +23,7 @@
<% end %>
<% end %>
<% if not first_row %>
- </ul>
+ </ul>
<% end %>
<%= render :partial => "list_sidebar_extra" %>
</div>
@@ -32,16 +32,22 @@
<div id="left_column_flip">
<h1><%= _('Public authorities') %></h1>
-<% form_tag(list_public_bodies_default_url, :method => "get", :id=>"search_form") do %>
+<%= form_tag(list_public_bodies_default_url, :method => "get", :id=>"search_form") do %>
<div>
- <%= text_field_tag(:public_body_query, params[:public_body_query]) %>
+ <%= text_field_tag(:public_body_query, params[:public_body_query], { :title => "type your search term here" } ) %>
<%= submit_tag(_("Search")) %>
</div>
<% end %>
-<h2 class="publicbody_results"><%= n_('Found %d public authority %s', 'Found %d public authorities %s', @public_bodies.total_entries) % [@public_bodies.total_entries, @description] %></h2>
+<h2 class="publicbody_results">
+ <%= n_('Found {{count}} public authority {{description}}',
+ 'Found {{count}} public authorities {{description}}',
+ @public_bodies.total_entries,
+ :count => @public_bodies.total_entries,
+ :description => @description) %>
+</h2>
<%= render :partial => 'body_listing', :locals => { :public_bodies => @public_bodies } %>
<%= will_paginate(@public_bodies) %><br/>
- <%= raw _('<a href="%s">Can\'t find the one you want?</a>') % [help_requesting_path + '#missing_body'] %>
+ <%= link_to _("Can't find the one you want?"), help_requesting_path + '#missing_body' %>
</div>
diff --git a/app/views/public_body/show.rhtml b/app/views/public_body/show.html.erb
index 6431b4742..c36396149 100644
--- a/app/views/public_body/show.rhtml
+++ b/app/views/public_body/show.html.erb
@@ -4,7 +4,12 @@
<h2><%= _('Follow this authority')%></h2>
<% follower_count = TrackThing.count(:all, :conditions => ["public_body_id = ?", @public_body.id]) %>
- <p><%= raw(n_("<span id='follow_count'>%d</span> person is following this authority", "<span id='follow_count'>%d</span> people are following this authority", follower_count) % follower_count) %></p>
+ <p>
+ <%= n_("{{count}} person is following this authority",
+ "{{count}} people are following this authority",
+ follower_count,
+ :count => content_tag(:span, follower_count, :id => "follow_count")) %>
+ </p>
<%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'sidebar' } %>
<h2><%= _('More about this authority')%></h2>
@@ -26,46 +31,45 @@
<% end %>
<% end %>
<% end %>
- <%= link_to _('View FOI email address'), view_public_body_email_url(@public_body.url_name) %><br>
- </div>
+ <%= link_to _('View FOI email address'), view_public_body_email_path(@public_body.url_name) %><br>
+ <%= link_to _("Ask us to update FOI email"), new_change_request_path(:body => @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>
<p class="subtitle">
- <%=@public_body.type_of_authority(true)%><% if not @public_body.short_name.empty? %>,
+ <%=@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) %>)
+ (<%= link_to _("admin"), admin_body_show_path(@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.eir_only? %>
- <p><%= _('You can only request information about the environment from this authority.')%></p>
+ <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
+ <% if @public_body.has_notes? %>
+ <p><%= @public_body.notes_as_html.html_safe %></p>
+ <% end %>
+ <% if @public_body.eir_only? %>
+ <p><%= _('You can only request information about the environment from this authority.')%></p>
+ <% end %>
+ <% else %>
+ <% if @public_body.not_requestable_reason == 'not_apply' %>
+ <p><%= _('Freedom of Information law does not apply to this authority, so you cannot make
+ a request to it.')%></p>
+ <% elsif @public_body.not_requestable_reason == 'defunct' %>
+ <p><%= _('This authority no longer exists, so you cannot make a request to it.')%></p>
+ <% else %>
+ <p><%= _('For an unknown reason, it is not possible to make a request to this authority.')%></p>
+ <% end %>
<% 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')%>
- <% else %>
- <%= _('Make a new <strong>Freedom of Information</strong> request to {{public_body}}', :public_body => h(@public_body.name))%>
- <% end %>
- &nbsp;<%= _('<a class="link_button_green" href="{{url}}">{{text}}</a>', :url=>new_request_to_body_url(:url_name => @public_body.url_name), :text=>_("Start"))%>
+ <%= link_to _("Make a request to this authority"), new_request_to_body_path(:url_name => @public_body.url_name), :class => "link_button_green" %>
<% 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.')%>
+ <%= @public_body.notes_as_html.html_safe %>
<% end %>
<% if @public_body.override_request_email %>
@@ -78,12 +82,14 @@
<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>
+ <% if @public_body.is_requestable? or @public_body.not_requestable_reason != 'defunct' %>
+ <% if @public_body.eir_only? %>
+ <h2><%= _('Environmental Information Regulations requests made using this site') %></h2>
+ <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 %>
<% end %>
<% else %>
<h2 class="foi_results">
@@ -91,15 +97,19 @@
<%= 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] %>
+ <%= n_('Search within the {{count}} Freedom of Information requests to {{public_body_name}}', 'Search within the {{count}} Freedom of Information requests made to {{public_body_name}}', @public_body.info_requests.size, :count => @public_body.info_requests.size, :public_body_name => @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] %>
+ <%= n_('{{count}} Freedom of Information request to {{public_body_name}}',
+ '{{count}} Freedom of Information requests to {{public_body_name}}',
+ @public_body.info_requests.size,
+ :count => @public_body.info_requests.size,
+ :public_body_name => @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 %>
@@ -120,7 +130,7 @@
<p> <%= _('Only requests made using {{site_name}} are shown.', :site_name => site_name) %></p>
<% end %>
- <% else %>
+ <% else %>
<% if @public_body.eir_only? %>
<h2><%= _('Environmental Information Regulations requests made') %></h2>
<% else %>
diff --git a/app/views/public_body/statistics.html.erb b/app/views/public_body/statistics.html.erb
new file mode 100644
index 000000000..d935a9e47
--- /dev/null
+++ b/app/views/public_body/statistics.html.erb
@@ -0,0 +1,75 @@
+<% @title = _("Public Body Statistics") %>
+<div id="main_content">
+ <h1>Public Body Statistics</h1>
+
+ <p><%= _("This page of public body statistics is currently \
+experimental, so there are some caveats that should be borne \
+in mind:") %></p>
+
+ <ul>
+
+ <li><%= _("The percentages are calculated with respect to \
+the total number of requests, which includes invalid \
+requests; this is a known problem that will be fixed in a \
+later release.") %></li>
+
+ <li><%= _("The classification of requests (e.g. to say \
+whether they were successful or not) is done manually by users \
+and administrators of the site, which means that they are \
+subject to error.") %></li>
+
+ <li><%= _("Requests are considered successful if they were \
+classified as either 'Successful' or 'Partially Successful'.") %></li>
+
+ <li><%= _("Requests are considered overdue if they are in \
+the 'Overdue' or 'Very Overdue' states.") %></li>
+
+ <li><%= _("The error bars shown are 95% confidence intervals \
+for the hypothesized underlying proportion (i.e. that which \
+you would obtain by making an infinite number of requests \
+through this site to that authority). In other words, the \
+population being sampled is all the current and future \
+requests to the authority through this site, rather than, \
+say, all requests that have been made to the public body by \
+any means.") %></li>
+
+ </ul>
+
+ <p><%= _("These graphs were partly inspired by \
+<a href=\"http://mark.goodge.co.uk/2011/08/number-crunching-whatdotheyknow/\">some \
+statistics that Mark Goodge produced for WhatDoTheyKnow</a>, so thanks \
+are due to him.") %></p>
+
+ <% @graph_list.each do |graph_data| %>
+ <h3 class="public-body-ranking-title"><%= graph_data['title']%></h3>
+ <div class="public-body-ranking" id="<%= graph_data['id'] %>">
+ <% if graph_data['x_values'] %>
+ <table border=0>
+ <thead>
+ <tr>
+ <th>Public Body</th>
+ <th><%= graph_data['y_axis'] %></th>
+ </tr>
+ </thead>
+ <tbody>
+ <% graph_data['public_bodies'].each_with_index do |pb, i| %>
+ <tr>
+ <td><%= link_to pb['name'], pb['url'] %></td>
+ <td class="statistic"><%= graph_data['y_values'][i].round %></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ <% else %>
+ <%= _("There was no data calculated for this graph yet.") %>
+ <% end %>
+ </div>
+ <% end %>
+
+<script type="text/javascript">
+ var graphs_data = <%= @graph_list.to_json.html_safe %>;
+</script>
+<!--[if lte IE 8]><%= javascript_include_tag "excanvas.min.js" %><![endif]-->
+<%= javascript_include_tag "stats" %>
+
+</div>
diff --git a/app/views/public_body/view_email.rhtml b/app/views/public_body/view_email.html.erb
index 79d7f7f4c..5f4bc95f4 100644
--- a/app/views/public_body/view_email.rhtml
+++ b/app/views/public_body/view_email.html.erb
@@ -1,4 +1,4 @@
-<% @title = "FOI email address for '" + h(@public_body.name) + "'" %>
+<% @title = _("FOI email address for {{public_body}}", :public_body => h(@public_body.name)) %>
<h1><%= _('FOI email address for {{public_body}}',:public_body=> public_body_link(@public_body))%></h1>
@@ -25,19 +25,19 @@
<p>
<% if @public_body.is_requestable? || @public_body.not_requestable_reason != 'bad_contact' %>
- <%= raw _('If the address is wrong, or you know a better address, please <a href="%s">contact us</a>.')% [help_contact_path]%>
+ <%= raw(_('If the address is wrong, or you know a better address, please <a href="{{url}}">contact us</a>.', :url => help_contact_path.html_safe)) %>
<% else %>
- <%= raw _(' If you know the address to use, then please <a href="%s">send it to us</a>.
- You may be able to find the address on their website, or by phoning them up and asking.')% [help_contact_path] %>
+ <%= raw(_(' If you know the address to use, then please <a href="{{url}}">send it to us</a>.
+ You may be able to find the address on their website, or by phoning them up and asking.', :url =>help_contact_path.html_safe)) %>
<% end %>
</p>
<div id="stepwise_make_request_view_email">
<strong>
<% if @public_body.eir_only? %>
- <%= link_to "Make a new EIR request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= link_to _("Make a new EIR request"), new_request_to_body_path(:url_name => @public_body.url_name)%>
<% else %>
- <%= link_to "Make a new FOI request", new_request_to_body_url(:url_name => @public_body.url_name)%>
+ <%= link_to _("Make a new FOI request"), new_request_to_body_path(:url_name => @public_body.url_name)%>
<% end %>
to <%= h(@public_body.name) %>
</strong>
diff --git a/app/views/public_body/view_email_captcha.rhtml b/app/views/public_body/view_email_captcha.html.erb
index 6f301e055..4f6db5b67 100644
--- a/app/views/public_body/view_email_captcha.rhtml
+++ b/app/views/public_body/view_email_captcha.html.erb
@@ -4,7 +4,7 @@
<p><%= _('To view the email address that we use to send FOI requests to {{public_body_name}}, please enter these words.', :public_body_name => h(@public_body.name))%></p>
-<% form_for :contact do |f| %>
+<%= form_for :contact do |f| %>
<%= recaptcha_tags %>
<%= hidden_field_tag(:submitted_view_email, { :value => 1 } ) %>
diff --git a/app/views/public_body_change_requests/new.html.erb b/app/views/public_body_change_requests/new.html.erb
new file mode 100644
index 000000000..7079cd868
--- /dev/null
+++ b/app/views/public_body_change_requests/new.html.erb
@@ -0,0 +1,61 @@
+<h1><%= @title %></h1>
+<%= foi_error_messages_for :change_request %>
+ <%= form_for(@change_request, :url => change_request_path) do |f| %>
+<% if not @user %>
+ <p>
+ <label class="form_label" for="user_name">
+ <%= _("Your name:") %>
+ </label>
+ <%= f.text_field :user_name %>
+ <%= _('(or <a href="{{url}}">sign in</a>)', :url => signin_path(:r => request.fullpath)) %>
+ </p>
+
+ <p>
+ <label class="form_label" for="user_email">
+ <%= ("Your email:") %>
+ </label>
+ <%= f.text_field :user_email %>
+ </p>
+<% end %>
+<% if @change_request.public_body %>
+ <%= f.hidden_field :public_body_id %>
+<% else %>
+ <p>
+ <label class="form_label" for="public_body_name">
+ <%= _("Authority:") %>
+ </label>
+ <%= f.text_field :public_body_name %>
+ </p>
+<% end %>
+ <p>
+ <label class="form_label" for="public_body_email">
+ <%= _("Authority email:") %>
+ </label>
+ <%= f.text_field :public_body_email %>
+ <div class="form_item_note">
+ <%= _("The contact email address for FOI requests to the authority.") %>
+ </div>
+ </p>
+
+ <p>
+ <label class="form_label" for="source_url">
+ <%= _("Source URL:") %>
+ </label>
+ <%= f.text_field :source_url %>
+ <div class="form_item_note">
+ <%= _("The URL where you found the email address. This field is optional, but it would help us a lot if you can provide a link to a specific page on the authority's website that gives this address, as it will make it much easier for us to check.") %>
+ </div>
+ </p>
+
+ <p>
+ <label class="form_label" for="notes">
+ <%= _("Notes:") %>
+ </label>
+ <%= f.text_area :notes, :rows => 10, :cols => 60 %>
+ </p>
+
+ <div class="form_button">
+ <%= submit_tag _("Submit request") %>
+ </div>
+
+<% end %>
diff --git a/app/views/reports/new.html.erb b/app/views/reports/new.html.erb
new file mode 100644
index 000000000..1197b2255
--- /dev/null
+++ b/app/views/reports/new.html.erb
@@ -0,0 +1,26 @@
+<h1>Report request: <%= @info_request.title %></h1>
+
+<% if @info_request.attention_requested %>
+ <p><%= _("This request has already been reported for administrator attention") %></p>
+<% else %>
+ <p>
+ <%= _("Reporting a request notifies the site administrators. They will respond as soon as possible.") %>
+ </p>
+ <p><%= _("Why specifically do you consider this request unsuitable?") %></p>
+
+ <%= form_tag request_report_path(:request_id => @info_request.url_title) do %>
+ <p>
+ <label class="form_label" for="reason">Reason:</label>
+ <%= select_tag :reason, options_for_select(@info_request.report_reasons, @reason), :prompt => _("Choose a reason") %>
+ </p>
+ <p>
+ <label class="form_label" for="message"><%= _("Please tell us more:") %></label>
+ <%= text_area_tag :message, @message, :rows => 10, :cols => 60 %>
+ </p>
+
+ <div class="form_button">
+ <%= submit_tag _("Report request") %>
+ </div>
+
+ <% end %>
+<% end %>
diff --git a/app/views/request/_act.html.erb b/app/views/request/_act.html.erb
new file mode 100644
index 000000000..1199cb4a2
--- /dev/null
+++ b/app/views/request/_act.html.erb
@@ -0,0 +1,15 @@
+<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 %>
+ <% link_to tweet_link do %>
+ <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
+ <% end %>
+ <%= link_to _("Tweet this request"), tweet_link %>
+</div>
+<div class="act_link">
+ <%= link_to "http://wordpress.com/" do %>
+ <%= image_tag "wordpress.png", :class => "rss" %>
+ <% end %>
+ <%= link_to _("Start your own blog"), "http://wordpress.com/"%>
+</div>
diff --git a/app/views/request/_after_actions.rhtml b/app/views/request/_after_actions.html.erb
index 3d74cf42d..f780e3a37 100644
--- a/app/views/request/_after_actions.rhtml
+++ b/app/views/request/_after_actions.html.erb
@@ -7,7 +7,7 @@
<ul>
<% if @info_request.comments_allowed? %>
<li>
- <%= raw(_('<a href="%s">Add an annotation</a> (to help the requester or others)') % [new_comment_url(:url_title => @info_request.url_title)]) %>
+ <%= raw(_('<a href="{{url}}">Add an annotation</a> (to help the requester or others)', :url => new_comment_url(:url_title => @info_request.url_title).html_safe)) %>
</li>
<% end %>
<% if @old_unclassified %>
@@ -15,11 +15,9 @@
<%= link_to _('Update the status of this request'), '#describe_state_form_1' %>
</li>
<% end %>
- <% if @info_request.all_can_view? %>
<li>
- <%= link_to _("Download a zip file of all correspondence"), download_entire_request_url(:url_title => @info_request.url_title) %>
+ <%= link_to _("Download a zip file of all correspondence"), download_entire_request_path(:url_title => @info_request.url_title) %>
</li>
- <% end %>
</ul>
</div>
<% if ! @info_request.is_external? %>
@@ -29,18 +27,18 @@
<li>
<% if @last_response.nil? %>
- <%= link_to _("Send a followup"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
+ <%= link_to _("Send a followup"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "#followup" %>
<% else %>
- <%= link_to _("Write a reply"), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
+ <%= link_to _("Write a reply"), show_response_path(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %>
<% end %>
</li>
<% if !@old_unclassified %>
<li>
- <%= link_to _("Update the status of this request"), request_url(@info_request, :update_status => 1) %>
+ <%= link_to _("Update the status of this request"), request_path(@info_request, :update_status => 1) %>
</li>
<% end %>
<li>
- <%= link_to _("Request an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
+ <%= link_to _("Request an internal review"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>
</li>
</ul>
</div>
@@ -50,7 +48,7 @@
<strong><%= _('{{public_body_name}} only:',:public_body_name=>h(@info_request.public_body.name) ) %> </strong>
<ul>
<li>
- <%= link_to _("Respond to request"), upload_response_url(:url_title => @info_request.url_title) %>
+ <%= link_to _("Respond to request"), upload_response_path(:url_title => @info_request.url_title) %>
</li>
</ul>
</div>
diff --git a/app/views/request/_bubble.rhtml b/app/views/request/_bubble.html.erb
index 747e2aa1f..e038bb3dc 100644
--- a/app/views/request/_bubble.rhtml
+++ b/app/views/request/_bubble.html.erb
@@ -5,26 +5,26 @@
<% attachments.each do |a| %>
<p class="attachment">
<%
- attachment_url = get_attachment_url(:id => incoming_message.info_request_id,
+ attachment_path = get_attachment_path(:id => incoming_message.info_request_id,
:incoming_message_id => incoming_message.id, :part => a.url_part_number,
:file_name => a.display_filename)
- attachment_as_html_url = get_attachment_as_html_url(:id => incoming_message.info_request_id,
+ attachment_as_html_path = get_attachment_as_html_path(:id => incoming_message.info_request_id,
:incoming_message_id => incoming_message.id, :part => a.url_part_number,
:file_name => a.display_filename + '.html')
%>
<% img_filename = "icon_" + a.content_type.sub('/', '_') + "_large.png"
- full_filename = File.expand_path(File.join(File.dirname(__FILE__), "../../../public/images", img_filename))
+ full_filename = File.expand_path(Rails.root.join('app', 'assets', 'images', img_filename))
if File.exist?(full_filename) %>
- <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/<%=img_filename%>"></a>
+ <%= link_to image_tag(img_filename, :class => "attachment_image", :alt => "Attachment"), attachment_path %>
<% else %>
- <a href="<%=attachment_url%>"><img class="attachment_image" alt="Attachment" src="/images/icon_unknown.png"></a>
+ <%= link_to image_tag("icon_unknown.png", :class => "attachment_image", :alt => "Attachment"), attachment_path %>
<% end %>
<strong><%= h a.display_filename %></strong>
<br>
<%= a.display_size %>
- <%= link_to "Download", attachment_url %>
+ <%= link_to "Download", attachment_path %>
<% if a.has_body_as_html? && incoming_message.info_request.all_can_view? %>
- <%= link_to "View as HTML", attachment_as_html_url %>
+ <%= link_to "View as HTML", attachment_as_html_path %>
<% end %>
<!-- (<%= a.content_type %>) -->
<%= a.extra_note %>
diff --git a/app/views/request/_correspondence.html.erb b/app/views/request/_correspondence.html.erb
new file mode 100644
index 000000000..c39625c3c
--- /dev/null
+++ b/app/views/request/_correspondence.html.erb
@@ -0,0 +1,12 @@
+<div class="ff-print-fix"></div>
+<% case info_request_event.event_type %>
+<% when 'response' %>
+ <%= render :partial => 'request/incoming_correspondence', :locals => { :incoming_message => info_request_event.incoming_message } %>
+<% when 'sent', 'followup_sent' %>
+ <%= render :partial => 'request/outgoing_correspondence', :locals => { :outgoing_message => info_request_event.outgoing_message, :info_request_event => info_request_event }%>
+<% when 'resent', 'followup_resent' %>
+ <%= render :partial => 'request/resent_outgoing_correspondence', :locals => { :outgoing_message => info_request_event.outgoing_message, :info_request_event => info_request_event }%>
+<% when 'comment' %>
+ <%= render :partial => 'comment/single_comment', :locals => { :comment => info_request_event.comment } %>
+<% end %>
+
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
deleted file mode 100644
index 99c6c7d26..000000000
--- a/app/views/request/_correspondence.rhtml
+++ /dev/null
@@ -1,80 +0,0 @@
-<div class="ff-print-fix"></div>
-<%
-if !info_request_event.nil? && info_request_event.event_type == 'response'
- incoming_message = info_request_event.incoming_message
-end
-
-if not incoming_message.nil?
-%>
- <div class="incoming correspondence" id="incoming-<%=incoming_message.id.to_s%>">
- <h2>
- <% if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
- <%= _("From:") %> <%=h incoming_message.safe_mail_from %><br>
- <% end %>
- <% if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>
- <%=h @info_request.public_body.name %><br>
- <% end %>
- <br><%= simple_date(incoming_message.sent_at) %>
- </h2>
-
- <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display } %>
-
- <p class="event_actions">
- <% if !@user.nil? && @user.admin_page_links? %>
- <%= link_to "Admin", admin_url("request/show_raw_email/" + incoming_message.raw_email_id.to_s) %> |
- <% end %>
- <%= link_to _("Link to this"), incoming_message_url(incoming_message), :class => "link_to_this" %>
- </p>
- </div>
-<%
-elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
- outgoing_message = info_request_event.outgoing_message
- %>
- <div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
-
- <h2>
- <%= _("From:") %> <%=h @info_request.user_name %><br>
- <br><%= simple_date(info_request_event.created_at) %>
- </h2>
-
- <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil } %>
-
- <p class="event_actions">
- <% if outgoing_message.status == 'ready' && !@info_request.is_external? %>
- <strong>Warning:</strong> This message has <strong>not yet been sent</strong> for an unknown reason.
- <% end %>
-
- <!-- Can use this to get name of who followup was too, if say you
- play with proper from display, but not sure needed
- <% if outgoing_message.message_type == 'followup' && !outgoing_message.incoming_message_followup.nil? && !outgoing_message.incoming_message_followup.safe_mail_from.nil? %>
- Follow up sent to: <%=h outgoing_message.incoming_message_followup.safe_mail_from %>
- <% end %>
- -->
-
- <%= link_to _("Link to this"), outgoing_message_url(outgoing_message), :class => "link_to_this" %>
- </p>
- </div>
-<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
- <div class="outgoing correspondence" id="outgoing-<%=info_request_event.outgoing_message.id.to_s%>">
- <h2>
- <%= simple_date(info_request_event.created_at) %>
- </h2>
- <p class="event_plain">
- Sent
- <% if info_request_event.outgoing_message.message_type == 'initial_request' %>
- request
- <% elsif info_request_event.outgoing_message.message_type == 'followup' %>
- a follow up
- <% else %>
- <% raise "unknown message_type" %>
- <% end %>
-
- to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.
- </p>
- </div>
-<% elsif info_request_event.event_type == 'comment'
- comment = info_request_event.comment
-%>
- <%= render :partial => 'comment/single_comment', :locals => { :comment => comment } %>
-<% end %>
-
diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.html.erb
index 5b6004e81..7b6fa9683 100644
--- a/app/views/request/_describe_state.rhtml
+++ b/app/views/request/_describe_state.html.erb
@@ -1,9 +1,9 @@
<% if @is_owning_user %>
- <% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>
+ <%= form_for(@info_request, :as => :incoming_message, :url => describe_state_url(:id => @info_request.id), :html => {:id => "describe_form_#{id_suffix}"}) do |f| %>
<h2><%= _('What best describes the status of this request now?') %></h2>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('This request is still in progress:') %></h3>
<% if @info_request.described_state != 'internal_review' %>
<div>
@@ -40,7 +40,7 @@
<%= render :partial => 'general/custom_state_transitions_pending', :locals => {:id_suffix => id_suffix } %>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('This particular request is finished:') %></h3>
<% if @info_request.described_state == 'internal_review' %>
@@ -67,7 +67,7 @@
<%= render :partial => 'general/custom_state_transitions_complete', :locals => {:id_suffix => id_suffix } %>
- <hr> <!------------------------------------------------>
+ <hr>
<h3><%= _('Other:') %></h3>
<div>
@@ -80,7 +80,7 @@
<% if @update_status %>
<div>
<%= radio_button "incoming_message", "described_state", "requires_admin", :id => 'requires_admin' + id_suffix %>
- <label for="error_message<%=id_suffix%>">
+ <label for="requires_admin<%=id_suffix%>">
<%= _('This request <strong>requires administrator attention</strong>') %>
</label>
</div>
@@ -97,18 +97,17 @@
<p>
<%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
- <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
<%= submit_tag _("Submit status") %> (<%= _('and we\'ll suggest <strong>what to do next</strong>') %>)
</p>
<% end %>
<% elsif @old_unclassified %>
- <%= render :partial => 'other_describe_state', :locals => {:id_suffix => id_suffix } %>
+ <%= render :partial => 'request/other_describe_state', :locals => {:id_suffix => id_suffix } %>
<% else %>
<% if !@info_request.is_external? %>
<%= _('We don\'t know whether the most recent response to this request contains
information or not
&ndash;
- if you are {{user_link}} please <a href="{{url}}">sign in</a> and let everyone know.',:user_link=>user_link(@info_request.user), :url=>signin_url(:r => request.request_uri)) %>
+ if you are {{user_link}} please <a href="{{url}}">sign in</a> and let everyone know.',:user_link=>user_link(@info_request.user), :url=>signin_url(:r => request.fullpath)) %>
<% end %>
<% end %>
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.html.erb
index 045bcd9ba..2643b767f 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.html.erb
@@ -25,18 +25,18 @@
<ul>
<% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %>
<% if id.nil? && !incoming_message.nil? && incoming_message.valid_to_reply_to? %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% else %>
<% if !id.nil? %>
<% if @info_request.public_body.request_email == email %>
<% if !incoming_message.nil? %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% end %>
<% else %>
- <li><%= link_to name, show_response_url(:id => @info_request.id, :incoming_message_id => id)%></li>
+ <li><%= link_to name, show_response_path(:id => @info_request.id, :incoming_message_id => id)%></li>
<% end %>
<% else %>
- <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil)) %></li>
+ <li><%= link_to(_("the main FOI contact address for {{public_body}}", :public_body => name), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil)) %></li>
<% end %>
<% end %>
@@ -45,13 +45,18 @@
</div>
<% end %>
<% if @info_request.allow_new_responses_from == 'nobody' %>
- <p><%= _('Follow ups and new responses to this request have been stopped to prevent spam. Please <a href="{{url}}">contact us</a> if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user), :url=>help_contact_path) %></p>
+
+ <p><%=
+ # TRANSLATORS: "Follow ups" in this context means further
+ # messages sent by the requester to the authority after
+ # the initial request
+ _('Follow ups and new responses to this request have been stopped to prevent spam. Please <a href="{{url}}">contact us</a> if you are {{user_link}} and need to send a follow up.',:user_link=>user_link(@info_request.user), :url=>help_contact_path) %></p>
<% else %>
<% if @internal_review %>
<p>
- <%= raw(_('If you are dissatisfied by the response you got from
+ <%= _('If you are dissatisfied by the response you got from
the public authority, you have the right to
- complain (<a href="%s">details</a>).') % "http://foiwiki.com/foiwiki/index.php/Internal_reviews") %>
+ complain (<a href="{{url}}">details</a>).', :url => "http://foiwiki.com/foiwiki/index.php/Internal_reviews".html_safe) %>
</p>
<% end %>
@@ -61,25 +66,24 @@
<% status = @info_request.calculate_status %>
<% if status == 'waiting_response_overdue' %>
- <p><%= _('The response to your request has been <strong>delayed</strong>. You can say that,
+ <p><%= _('The response to your request has been <strong>delayed</strong>. You can say that,
by law, the authority should normally have responded
<strong>promptly</strong> and') %>
<% if @info_request.public_body.is_school? %>
<%= _('in term time') %>
<% end %>
<%= _('by <strong>{{date}}</strong>',:date=>simple_date(@info_request.date_response_required_by)) %>
- (<%= raw(_('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"]) %>).
-
+ (<%= link_to _('details'), "#{help_requesting_path}#quickly_response" %>).
</p>
<% elsif status == 'waiting_response_very_overdue' %>
<p>
- <%= _('The response to your request is <strong>long overdue</strong>. You can say that, by
+ <%= _('The response to your request is <strong>long overdue</strong>. You can say that, by
law, under all circumstances, the authority should have responded
- by now') %> (<%= raw(_('<a href="%s">details</a>') % ["#{help_requesting_path}#quickly_response"]) %>).
+ by now') %> (<%= link_to _('details'), "#{help_requesting_path}#quickly_response" %>).
</p>
<% end %>
- <% form_for(:outgoing_message, @outgoing_message, :html => { :id => 'followup_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)) do |o| %>
+ <%= form_for(@outgoing_message, :html => { :id => 'followup_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)) do |o| %>
<p>
<%= o.text_area :body, :rows => 15, :cols => 55 %>
</p>
@@ -103,7 +107,7 @@
<div>
<%= radio_button "outgoing_message", "what_doing", "internal_review", :id => "internal_review" %>
<label for="internal_review"><%= _('I am requesting an <strong>internal review</strong>') %>
- <%= raw(_('<a href="%s">what\'s that?</a>') % ["/help/unhappy"]) %>
+ <%= link_to _("what's that?"), "/help/unhappy" %>
</label>
</div>
<div>
diff --git a/app/views/request/_hidden_correspondence.html.erb b/app/views/request/_hidden_correspondence.html.erb
new file mode 100644
index 000000000..153164278
--- /dev/null
+++ b/app/views/request/_hidden_correspondence.html.erb
@@ -0,0 +1,13 @@
+<p id="hidden_message">
+ <%- if !message.prominence_reason.blank? %>
+ <%= _('This message has been hidden.') %>
+ <%= message.prominence_reason %>
+ <%= _('Please <a href="{{url}}">contact us</a> if you have any questions.', :url => help_contact_path.html_safe) %>
+ <%- else %>
+ <%= _("This message has been hidden. There are various reasons why we might have done this, sorry we can't be more specific here.") %>
+ <%= _('Please <a href="{{url}}">contact us</a> if you have any questions.', :url => help_contact_path.html_safe) %>
+ <%- end %>
+ <% if message.prominence == 'requester_only' %>
+ <%= _('If you are the requester, then you may <a href="{{url}}">sign in</a> to view the message.', :url => signin_url(:r => request.fullpath).html_safe) %>
+ <% end %>
+</p>
diff --git a/app/views/request/_hidden_correspondence.rhtml b/app/views/request/_hidden_correspondence.rhtml
deleted file mode 100644
index 0873b312f..000000000
--- a/app/views/request/_hidden_correspondence.rhtml
+++ /dev/null
@@ -1,33 +0,0 @@
-<% if info_request_event.prominence == 'requester_only' %>
- <%
- if !info_request_event.nil? && info_request_event.event_type == 'response'
- incoming_message = info_request_event.incoming_message
- end
- if not incoming_message.nil?
- %>
- <div class="correspondence" id="incoming-<%=incoming_message.id.to_s%>">
- <p>
- <%= raw(_('This response has been hidden. See annotations to find out why.
- If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)]) %>
- </p>
- </div>
- <% elsif [ 'sent', 'followup_sent', 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
- <div class="correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
- <p>
- <%= raw(_('This outgoing message has been hidden. See annotations to
- find out why. If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)]) %>
- </p>
- </div>
- <% elsif info_request_event.event_type == 'comment' %>
- <div class="comment_in_request" id="comment-<%=comment.id.to_s%>">
- <p><%= raw(_('This comment has been hidden. See annotations to
- find out why. If you are the requester, then you may <a href="%s">sign in</a> to view the response.') % [signin_url(:r => request.request_uri)]) %>
- </p>
- </div>
- <% end %>
-
-<% elsif info_request_event.prominence == 'hidden' %>
- <% # show nothing when hidden %>
-<% else %>
- <% raise _("unexpected prominence on request event") %>
-<% end %>
diff --git a/app/views/request/_hidden_correspondence.text.erb b/app/views/request/_hidden_correspondence.text.erb
new file mode 100644
index 000000000..010b6b66d
--- /dev/null
+++ b/app/views/request/_hidden_correspondence.text.erb
@@ -0,0 +1,5 @@
+<%- if !message.prominence_reason.blank? %>
+ <%= _('This message has been hidden.') %> <%= message.prominence_reason %>
+<%- else %>
+ <%= _("This message has been hidden. There are various reasons why we might have done this, sorry we can't be more specific here.") %>
+<%- end %>
diff --git a/app/views/request/_incoming_correspondence.html.erb b/app/views/request/_incoming_correspondence.html.erb
new file mode 100644
index 000000000..f39d650d8
--- /dev/null
+++ b/app/views/request/_incoming_correspondence.html.erb
@@ -0,0 +1,26 @@
+<div class="incoming correspondence <%= incoming_message.prominence %>" id="incoming-<%=incoming_message.id.to_s%>">
+ <%- if not incoming_message.user_can_view?(@user) %>
+ <%= render :partial => 'request/hidden_correspondence', :locals => { :message => incoming_message }%>
+ <%- else %>
+ <%= render :partial => 'request/restricted_correspondence', :locals => {:message => incoming_message } %>
+ <h2>
+ <% if incoming_message.specific_from_name? %>
+ <%= _("From:") %> <%= incoming_message.safe_mail_from %><br>
+ <% end %>
+ <% if incoming_message.from_public_body? %>
+ <%= @info_request.public_body.name %><br>
+ <% end %>
+ <br><%= simple_date(incoming_message.sent_at) %>
+ </h2>
+
+ <%= render :partial => 'bubble', :locals => { :incoming_message => incoming_message, :body => incoming_message.get_body_for_html_display(@collapse_quotes), :attachments => incoming_message.get_attachments_for_display } %>
+
+ <p class="event_actions">
+ <% if !@user.nil? && @user.admin_page_links? %>
+ <%= link_to "Admin", admin_incoming_edit_path(incoming_message.id) %> |
+ <% end %>
+ <%= link_to _("Link to this"), incoming_message_path(incoming_message), :class => "link_to_this" %>
+ </p>
+ <%- end %>
+</div>
+
diff --git a/app/views/request/_incoming_correspondence.text.erb b/app/views/request/_incoming_correspondence.text.erb
new file mode 100644
index 000000000..c5e648d28
--- /dev/null
+++ b/app/views/request/_incoming_correspondence.text.erb
@@ -0,0 +1,12 @@
+<%- if not incoming_message.user_can_view?(@user) %>
+ <%= render :partial => 'request/hidden_correspondence', :formats => 'text', :locals => { :message => incoming_message }%>
+<%- else %>
+<%= _('From:') %><% if incoming_message.specific_from_name? %> <%= incoming_message.safe_mail_from %><% end %><% if incoming_message.from_public_body? %>, <%= @info_request.public_body.name %><% end %>
+<%= _('To:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %>
+<%= _('Date:') %> <%= simple_date(incoming_message.sent_at) %>
+
+ <%= incoming_message.get_body_for_quoting %>
+ <% incoming_message.get_attachments_for_display.each do |a| %>
+<%= _('Attachment:') %> <%= a.display_filename %> (<%= a.display_size %>)
+ <% end %>
+<% end %>
diff --git a/app/views/request/_list_results.html.erb b/app/views/request/_list_results.html.erb
new file mode 100644
index 000000000..4da042816
--- /dev/null
+++ b/app/views/request/_list_results.html.erb
@@ -0,0 +1,12 @@
+ <% @results = InfoRequest.request_list(@filters, @page, @per_page, @max_results) %>
+ <% if @results[:results].empty? %>
+ <p> <%= _('No requests of this sort yet.')%></p>
+ <% else %>
+ <h2 class="foi_results"><%= _('{{count}} FOI requests found', :count => @results[:matches_estimated]) %></h2>
+ <div class="results_block">
+ <% @results[:results].each do |result| %>
+ <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
+ <% end %>
+ </div>
+ <% end %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @results[:show_no_more_than]) %>
diff --git a/app/views/request/_next_actions.rhtml b/app/views/request/_next_actions.html.erb
index f318df6e4..f318df6e4 100644
--- a/app/views/request/_next_actions.rhtml
+++ b/app/views/request/_next_actions.html.erb
diff --git a/app/views/request/_other_describe_state.rhtml b/app/views/request/_other_describe_state.html.erb
index e274fe8c9..e49f9ecb3 100644
--- a/app/views/request/_other_describe_state.rhtml
+++ b/app/views/request/_other_describe_state.html.erb
@@ -1,6 +1,6 @@
-<% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>
+<%= form_for(@info_request, :as => :incoming_message, :url => describe_state_url(:id => @info_request.id), :html => {:id => "describe_form_#{id_suffix}"}) do |f| %>
<h2><%= _('Hi! We need your help. The person who made the following request
hasn\'t told us whether or not it was successful. Would you mind taking
a moment to read it and help us keep the place tidy for everyone?
@@ -75,7 +75,6 @@
<p>
<%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %>
- <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %>
<%= submit_tag "Submit status" %>
</p>
<% end %>
diff --git a/app/views/request/_outgoing_correspondence.html.erb b/app/views/request/_outgoing_correspondence.html.erb
new file mode 100644
index 000000000..dced5c94c
--- /dev/null
+++ b/app/views/request/_outgoing_correspondence.html.erb
@@ -0,0 +1,18 @@
+<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+ <%- if not outgoing_message.user_can_view?(@user) %>
+ <%= render :partial => 'request/hidden_correspondence', :locals => { :message => outgoing_message }%>
+ <%- else %>
+ <%= render :partial => 'request/restricted_correspondence', :locals => {:message => outgoing_message } %>
+ <h2>
+ <%= _("From:") %> <%= @info_request.user_name %><br>
+ <br><%= simple_date(info_request_event.created_at) %>
+ </h2>
+ <%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_html_display(), :attachments => nil } %>
+ <p class="event_actions">
+ <% if outgoing_message.status == 'ready' && !@info_request.is_external? %>
+ <strong>Warning:</strong> This message has <strong>not yet been sent</strong> for an unknown reason.
+ <% end %>
+ <%= link_to _("Link to this"), outgoing_message_path(outgoing_message), :class => "link_to_this" %>
+ </p>
+ <%- end %>
+</div>
diff --git a/app/views/request/_outgoing_correspondence.text.erb b/app/views/request/_outgoing_correspondence.text.erb
new file mode 100644
index 000000000..5375ef81b
--- /dev/null
+++ b/app/views/request/_outgoing_correspondence.text.erb
@@ -0,0 +1,8 @@
+<%- if not outgoing_message.user_can_view?(@user) %>
+ <%= render :partial => 'request/hidden_correspondence', :formats => 'text', :locals => { :message => outgoing_message }%>
+<%- else %>
+ <%= _('From:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %>
+ <%= _('To:') %> <%= @info_request.public_body.name %>
+ <%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
+ <%= outgoing_message.get_body_for_text_display %>
+<%- end %>
diff --git a/app/views/request/_request_filter_form.rhtml b/app/views/request/_request_filter_form.html.erb
index 0c215a9b6..090db01df 100644
--- a/app/views/request/_request_filter_form.rhtml
+++ b/app/views/request/_request_filter_form.html.erb
@@ -1,7 +1,7 @@
<%= render :partial => 'general/localised_datepicker' %>
<div id="list-filter">
- <% form_tag(request.path, :method => "get", :id=>"filter_requests_form") do %>
+ <%= 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]) %>
diff --git a/app/views/request/_request_listing.rhtml b/app/views/request/_request_listing.html.erb
index 492f874f3..492f874f3 100644
--- a/app/views/request/_request_listing.rhtml
+++ b/app/views/request/_request_listing.html.erb
diff --git a/app/views/request/_request_listing_short_via_event.rhtml b/app/views/request/_request_listing_short_via_event.html.erb
index d93a91070..c2f6474a1 100644
--- a/app/views/request/_request_listing_short_via_event.rhtml
+++ b/app/views/request/_request_listing_short_via_event.html.erb
@@ -3,11 +3,11 @@
end %>
<div class="request_short_listing">
- <h3><%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %></h3>
+ <h3><%= link_to highlight_words(info_request.title, @highlight_words), request_path(info_request) %></h3>
<p>
-<%= _('To {{public_body_link_absolute}}',:public_body_link_absolute => public_body_link_absolute(info_request.public_body))%>
-<%= _('by {{user_link_absolute}}',:user_link_absolute => request_user_link_absolute(info_request))%>
+<%= _('To {{public_body_link_absolute}}',:public_body_link_absolute => public_body_link(info_request.public_body))%>
+<%= _('by {{user_link_absolute}}',:user_link_absolute => request_user_link(info_request))%>
<%= simple_date(info_request.created_at) %>
</p>
</div>
diff --git a/app/views/request/_request_listing_single.rhtml b/app/views/request/_request_listing_single.html.erb
index e8c1a393f..50f889d75 100644
--- a/app/views/request/_request_listing_single.rhtml
+++ b/app/views/request/_request_listing_single.html.erb
@@ -1,9 +1,9 @@
<div class="request_listing">
- <span class="head">
- <%= link_to h(info_request.title), (@play_urls ? request_path(:url_title => info_request.url_title) : request_url(info_request)) %>
- </span>
- <span class="desc">
- <%= excerpt(info_request.initial_request_text, "", 150) %>
+ <span class="head">
+ <%= link_to h(info_request.title), (@play_urls ? categorise_request_path(:url_title => info_request.url_title) : request_path(info_request)) %>
+ </span>
+ <span class="desc">
+ <%= excerpt(info_request.initial_request_text, "", :radius => 150) %>
</span>
<span class="bottomline icon_<%= info_request.calculate_status %>">
<strong>
diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.html.erb
index 2ba9613e5..cc8bae8a9 100644
--- a/app/views/request/_request_listing_via_event.rhtml
+++ b/app/views/request/_request_listing_via_event.html.erb
@@ -6,13 +6,13 @@ end %>
<div class="request_left">
<span class="head">
<% if event.is_incoming_message? %>
- <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")) %>
<% elsif event.is_outgoing_message? and event.event_type == 'followup_sent' %>
- <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_url(event.outgoing_message) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), outgoing_message_path(event.outgoing_message) %>
<% elsif event.is_comment? %>
- <%= link_to highlight_words(info_request.title, @highlight_words), comment_url(event.comment) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), comment_path(event.comment) %>
<% else %>
- <%= link_to highlight_words(info_request.title, @highlight_words), request_url(info_request) %>
+ <%= link_to highlight_words(info_request.title, @highlight_words), request_path(info_request) %>
<% end %>
</span>
<div class="requester">
diff --git a/app/views/request/_resent_outgoing_correspondence.html.erb b/app/views/request/_resent_outgoing_correspondence.html.erb
new file mode 100644
index 000000000..17b6b635b
--- /dev/null
+++ b/app/views/request/_resent_outgoing_correspondence.html.erb
@@ -0,0 +1,16 @@
+<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>">
+ <h2>
+ <%= simple_date(info_request_event.created_at) %>
+ </h2>
+ <p class="event_plain">
+ Sent
+ <% if outgoing_message.message_type == 'initial_request' %>
+ request
+ <% elsif outgoing_message.message_type == 'followup' %>
+ a follow up
+ <% else %>
+ <% raise "unknown message_type" %>
+ <% end %>
+ to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.
+ </p>
+</div>
diff --git a/app/views/request/_resent_outgoing_correspondence.text.erb b/app/views/request/_resent_outgoing_correspondence.text.erb
new file mode 100644
index 000000000..d645e9488
--- /dev/null
+++ b/app/views/request/_resent_outgoing_correspondence.text.erb
@@ -0,0 +1,2 @@
+<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
+Sent <% if outgoing_message.message_type == 'initial_request' %> request <% elsif outgoing_message.message_type == 'followup' %> a follow up <% else %> <% raise "unknown message_type" %><% end %> to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.
diff --git a/app/views/request/_restricted_correspondence.html.erb b/app/views/request/_restricted_correspondence.html.erb
new file mode 100644
index 000000000..745c4ff0e
--- /dev/null
+++ b/app/views/request/_restricted_correspondence.html.erb
@@ -0,0 +1,18 @@
+<% if message.prominence == 'hidden' %>
+ <p id="hidden_message">
+ <%- if !message.prominence_reason.blank? %>
+ <%= _('This message has prominence \'hidden\'. {{reason}} You can only see it because you are logged in as a super user.', :reason => message.prominence_reason) %>
+ <%- else %>
+ <%= _('This message has prominence \'hidden\'. You can only see it because you are logged in as a super user.') %>
+ <%- end %>
+ </p>
+<% end %>
+<% if message.prominence == 'requester_only' %>
+ <p id="hidden_message">
+ <%- if !message.prominence_reason.blank? %>
+ <%= _('This message is hidden, so that only you, the requester, can see it. {{reason}}', :reason => message.prominence_reason) %>
+ <%- else %>
+ <%= _('This message is hidden, so that only you, the requester, can see it. Please <a href="{{url}}">contact us</a> if you are not sure why.', :url => help_requesting_path.html_safe) %>
+ <%- end %>
+ </p>
+<% end %>
diff --git a/app/views/request/_search_ahead.rhtml b/app/views/request/_search_ahead.html.erb
index 1e65a5458..1e65a5458 100644
--- a/app/views/request/_search_ahead.rhtml
+++ b/app/views/request/_search_ahead.html.erb
diff --git a/app/views/request/_sidebar.html.erb b/app/views/request/_sidebar.html.erb
new file mode 100644
index 000000000..0f7965ffa
--- /dev/null
+++ b/app/views/request/_sidebar.html.erb
@@ -0,0 +1,58 @@
+<div id="right_column">
+ <div id="follow_box">
+ <h2><%= _('Follow this request') %></h2>
+
+ <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>
+ <p>
+ <%= n_("There is {{count}} person following this request",
+ "There are {{count}} people following this request",
+ follower_count,
+ :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' } %>
+ </div>
+ <% if @info_request.described_state != "attention_requested" %>
+ <h2><%= _('Offensive? Unsuitable?') %></h2>
+ <% if @info_request.attention_requested %>
+ <% if @info_request.prominence == 'hidden' %>
+ <%# The eccentric formatting of the following string is in order that it be identical
+ to the corresponding string in request/show.html.erb %>
+ <p><%= _('This request has prominence \'hidden\'. You can only see it because you are logged
+ in as a super user.') %></p>
+ <% elsif @info_request.prominence == 'requester_only' %>
+ <%# The eccentric formatting of the following string is in order that it be identical
+ to the corresponding string in request/show.html.erb %>
+ <p><%= _('This request is hidden, so that only you the requester can see it. Please
+ <a href="{{url}}">contact us</a> if you are not sure why.', :url => help_requesting_path.html_safe) %></p>
+ <% else %>
+ <p><%= _('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please <a href="{{url}}">contact us</a>.', :url => help_requesting_path.html_safe) %></p>
+ <% end %>
+ <% else %>
+ <p><%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (<a href="/help/about">read more</a>).') %></p>
+ <p><%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %></p>
+ <%= link_to _("Report this request"), new_request_report_path(:request_id => @info_request.url_title) %>
+ <% end %>
+ <% end %>
+ <%= render :partial => 'request/act' %>
+ <%= render :partial => 'request/next_actions' %>
+
+ <% cache_if_caching_fragments(@similar_cache_key, :expires_in => 1.day) do %>
+ <% xapian_similar, xapian_similar_more = @info_request.similar_requests %>
+ <% if !xapian_similar.nil? && xapian_similar.results.size > 0 %>
+ <h2><%= _('Similar requests')%></h2>
+ <% for result in xapian_similar.results %>
+ <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
+ <% end %>
+ <% if xapian_similar_more %>
+ <p><%= link_to _("More similar requests"), similar_request_path(@info_request.url_title) %></p>
+ <% end %>
+ <% end %>
+ <% end %>
+
+ <p><%= link_to _('Event history details'), request_details_path(@info_request) %></p>
+
+ <!-- this link with this wording is here for legal reasons, discuss with
+ board and our lawyer before changing or removing it -->
+ <p><small><%= link_to _('Are you the owner of any commercial copyright on this page?'), help_officers_path+"#copyright" %></small></p>
+
+</div>
diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml
deleted file mode 100644
index 5e0c6fd2d..000000000
--- a/app/views/request/_sidebar.rhtml
+++ /dev/null
@@ -1,68 +0,0 @@
-<div id="right_column">
- <div id="follow_box">
- <h2><%= _('Follow this request') %></h2>
-
- <% follower_count = TrackThing.count(:all, :conditions => ["info_request_id = ?", @info_request.id]) + 1 %>
- <p><%= n_("There is %d person following this request", "There are %d people following this request", follower_count) % follower_count %></p>
- <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %>
- </div>
- <% if @info_request.described_state != "attention_requested" %>
- <h2><%= _('Offensive? Unsuitable?') %></h2>
- <% if @info_request.attention_requested %>
- <% if @info_request.prominence == 'hidden' %>
- <%# The eccentric formatting of the following string is in order that it be identical
- to the corresponding string in request/show.rhtml %>
- <p><%= _('This request has prominence \'hidden\'. You can only see it because you are logged
- in as a super user.') %></p>
- <% elsif @info_request.prominence == 'requester_only' %>
- <%# The eccentric formatting of the following string is in order that it be identical
- to the corresponding string in request/show.rhtml %>
- <p><%= raw(_('This request is hidden, so that only you the requester can see it. Please
- <a href="%s">contact us</a> if you are not sure why.') % [help_requesting_path]) %></p>
- <% else %>
- <p><%= raw(_('This request has been marked for review by the site administrators, who have not hidden it at this time. If you believe it should be hidden, please <a href="%s">contact us</a>.') % [help_requesting_path]) %></p>
- <% end %>
- <% else %>
- <p><%= _('Requests for personal information and vexatious requests are not considered valid for FOI purposes (<a href="/help/about">read more</a>).') %></p>
- <p><%= _('If you believe this request is not suitable, you can report it for attention by the site administrators') %></p>
- <%= button_to _("Report this request"), report_path, :class => "link_button_green" %>
- <% end %>
- <% end %>
- <h2><%= _("Act on what you've learnt") %></h2>
-
- <div class="act_link">
- <% tweet_link = "https://twitter.com/share?url=#{h(request.url)}&via=#{h(Configuration::twitter_username)}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %>
- <% link_to tweet_link do %>
- <%= image_tag "twitter-16.png", :alt => "twitter icon" %>
- <% end %>
- <%= link_to _("Tweet this request"), tweet_link %>
- </div>
- <div class="act_link">
- <% link_to "http://wordpress.com/" do %>
- <%= image_tag "wordpress.png", :class => "rss" %>
- <% end %>
- <%= link_to _("Start your own blog"), "http://wordpress.com/"%>
- </div>
-
- <%= render :partial => 'request/next_actions' %>
-
- <% # TODO: Cache for 1 day %>
- <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %>
- <h2><%= _('Similar requests')%></h2>
- <% for result in @xapian_similar.results %>
- <%= render :partial => 'request/request_listing_short_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
- <% end %>
- <% if @xapian_similar_more %>
- <p><%= link_to _("More similar requests"), request_similar_url(@info_request) %></p>
- <% end %>
- <!-- Important terms: <%= @xapian_similar.important_terms.join(" ") %> -->
- <% end %>
-
- <p><%= link_to _('Event history details'), request_details_url(@info_request) %></p>
-
- <!-- this link with this wording is here for legal reasons, discuss with
- board and our lawyer before changing or removing it -->
- <p><small><%= raw(_('<a href="%s">Are you the owner of
- any commercial copyright on this page?</a>') % [help_officers_path+"#copyright"]) %></small></p>
-
-</div>
diff --git a/app/views/request/_sidebar_request_listing.rhtml b/app/views/request/_sidebar_request_listing.html.erb
index ec5a5813d..ec5a5813d 100644
--- a/app/views/request/_sidebar_request_listing.rhtml
+++ b/app/views/request/_sidebar_request_listing.html.erb
diff --git a/app/views/request/_summary_suggestion.rhtml b/app/views/request/_summary_suggestion.html.erb
index a5da09cda..a5da09cda 100644
--- a/app/views/request/_summary_suggestion.rhtml
+++ b/app/views/request/_summary_suggestion.html.erb
diff --git a/app/views/request/_view_html_prefix.rhtml b/app/views/request/_view_html_prefix.html.erb
index b29830ac7..63fac7c6d 100644
--- a/app/views/request/_view_html_prefix.rhtml
+++ b/app/views/request/_view_html_prefix.html.erb
@@ -1,12 +1,12 @@
<div class="view_html_prefix">
<div class="view_html_logo">
- <a href="/"><img src="/images/navimg/logo-trans-small.png" alt="<%= site_name %>"></a>
+ <a href="/"><img src="/assets/navimg/logo-trans-small.png" alt="<%= site_name %>"></a>
</div>
<div class="view_html_download_link">
- <%=link_to _("Download original attachment"), @attachment_url %>
+ <%=link_to _("Download original attachment"), @attachment_url %>
<br>(<%=h @attachment.name_of_content_type %>)
</div>
<%= _('This is an HTML version of an attachment to the Freedom of Information request')%>
- '<%=link_to h(@info_request.title), incoming_message_url(@incoming_message)%>'.
+ '<%=link_to h(@info_request.title), incoming_message_path(@incoming_message)%>'.
</div>
diff --git a/app/views/request/_view_html_stylesheet.html.erb b/app/views/request/_view_html_stylesheet.html.erb
new file mode 100644
index 000000000..125ce66ec
--- /dev/null
+++ b/app/views/request/_view_html_stylesheet.html.erb
@@ -0,0 +1 @@
+<link type="text/css" title="Main" rel="stylesheet" media="screen" href="/assets/application.css">
diff --git a/app/views/request/_view_html_stylesheet.rhtml b/app/views/request/_view_html_stylesheet.rhtml
deleted file mode 100644
index d6cb932a8..000000000
--- a/app/views/request/_view_html_stylesheet.rhtml
+++ /dev/null
@@ -1 +0,0 @@
-<%= stylesheet_link_tag 'main', :title => "Main", :rel => "stylesheet" %>
diff --git a/app/views/request/_wall_listing.rhtml b/app/views/request/_wall_listing.html.erb
index 26d34e1a1..b6b4b38b1 100644
--- a/app/views/request/_wall_listing.rhtml
+++ b/app/views/request/_wall_listing.html.erb
@@ -6,11 +6,11 @@ end %>
<div class="request_left">
<div class="requester">
<% if event.event_type == 'sent' %>
- <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>request_url(info_request),:request_title=>info_request.title) %>
+ <%= _('A new request, <em><a href="{{request_url}}">{{request_title}}</a></em>, was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>request_path(info_request),:request_title=>info_request.title) %>
<% elsif event.event_type == 'followup_sent' %>
- <%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>outgoing_message_url(event.outgoing_message),:request_title=>info_request.title) %>
+ <%= _('A <a href="{{request_url}}">follow up</a> to <em>{{request_title}}</em> was sent to {{public_body_name}} by {{info_request_user}} on {{date}}.',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>outgoing_message_path(event.outgoing_message),:request_title=>info_request.title) %>
<% elsif event.event_type == 'response' %>
- <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>incoming_message_url(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
+ <%= _('A <a href="{{request_url}}">response</a> to <em>{{request_title}}</em> was sent by {{public_body_name}} to {{info_request_user}} on {{date}}. The request status is: {{request_status}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:date=>simple_date(event.created_at),:request_url=>incoming_message_path(event.incoming_message_selective_columns("incoming_messages.id")),:request_title=>info_request.title,:request_status=>info_request.display_status) %>
<% elsif event.event_type == 'comment' %>
<%= _('An <a href="{{request_url}}">annotation</a> to <em>{{request_title}}</em> was made by {{event_comment_user}} on {{date}}',:public_body_name=>public_body_link_absolute(info_request.public_body),:info_request_user=>request_user_link_absolute(info_request),:event_comment_user=>user_link_absolute(event.comment.user),:date=>simple_date(event.created_at),:request_url=>comment_url(event.comment),:request_title=>info_request.title) %>
<% else %>
diff --git a/app/views/request/batch_not_allowed.html.erb b/app/views/request/batch_not_allowed.html.erb
new file mode 100644
index 000000000..156fa9ae1
--- /dev/null
+++ b/app/views/request/batch_not_allowed.html.erb
@@ -0,0 +1 @@
+<%= _('Users cannot usually make batch requests to multiple authorities at once because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. Please <a href="{{url}}">contact us</a> if you think you have good reason to send the same request to multiple authorities at once.', :url => help_contact_path.html_safe) %>
diff --git a/app/views/request/describe_state_message.html.erb b/app/views/request/describe_state_message.html.erb
new file mode 100644
index 000000000..73237759f
--- /dev/null
+++ b/app/views/request/describe_state_message.html.erb
@@ -0,0 +1,30 @@
+<h1><%= @title %></h1>
+
+
+<p>
+ <% if @described_state == "error_message" %>
+ <%= _("If the error was a delivery failure, and you can find an up to date FOI email address for the authority, please tell us using the form below.") %>
+ <% else %>
+ <%= _("Just one more thing") %>
+ <% end %>
+</p>
+
+<%= form_for :incoming_message, :url => describe_state_url(:id => @info_request.id) do |f| %>
+
+ <p>
+ <label class="form_label" for="incoming_message_message">Please tell us more:</label>
+ <%= f.text_area :message, :rows => 10, :cols => 60 %>
+ </p>
+
+ <div>
+ <%= hidden_field_tag "incoming_message[described_state]", @described_state %>
+ <%= hidden_field_tag :last_info_request_event_id, @last_info_request_event_id %>
+ </div>
+
+ <div class="form_button">
+ <%= submit_tag _("Submit status and send message") %>
+ </div>
+
+<% end %>
+
+
diff --git a/app/views/request/details.rhtml b/app/views/request/details.html.erb
index d4c63902f..3cb2f5afe 100644
--- a/app/views/request/details.rhtml
+++ b/app/views/request/details.html.erb
@@ -36,10 +36,10 @@ way authorities use it. Plus you\'ll need to be an elite statistician. Please
<% end %>
<td>
<% if info_request_event.outgoing_message %>
- <%= link_to "outgoing", outgoing_message_url(info_request_event.outgoing_message) %>
+ <%= link_to "outgoing", outgoing_message_path(info_request_event.outgoing_message) %>
<% end %>
<% if info_request_event.incoming_message %>
- <%= link_to "incoming", incoming_message_url(info_request_event.incoming_message) %>
+ <%= link_to "incoming", incoming_message_path(info_request_event.incoming_message) %>
<% end %>
</td>
</tr>
diff --git a/app/views/request/followup_bad.rhtml b/app/views/request/followup_bad.html.erb
index c892263e6..ea2400c5d 100644
--- a/app/views/request/followup_bad.rhtml
+++ b/app/views/request/followup_bad.html.erb
@@ -9,21 +9,21 @@
<% if @reason == 'not_apply' %>
<!-- we should never get here, but just in case give a sensible message -->
<p><%= _('Freedom of Information law no longer applies to') %> <%=h @info_request.public_body.name %>.
- <%= raw(_('From the request page, try replying to a particular message, rather than sending
+ <%= _('From the request page, try replying to a particular message, rather than sending
a general followup. If you need to make a general followup, and know
- an email which will go to the right place, please <a href="%s">send it to us</a>.') % [help_contact_path]) %>
+ an email which will go to the right place, please <a href="{{url}}">send it to us</a>.', :url => help_contact_path.html_safe) %>
</p>
<% elsif @reason == 'defunct' %>
<!-- we should never get here, but just in case give a sensible message -->
- <p><%=h @info_request.public_body.name %> <%= raw(_('no longer exists. If you are trying to make
+ <p><%=h @info_request.public_body.name %> <%= _('no longer exists. If you are trying to make
From the request page, try replying to a particular message, rather than sending
a general followup. If you need to make a general followup, and know
- an email which will go to the right place, please <a href="%s">send it to us</a>.') % [help_contact_path]) %>
+ an email which will go to the right place, please <a href="{{url}}">send it to us</a>.', :url => help_contact_path.html_safe) %>
</p>
<% elsif @reason == 'bad_contact' %>
- <p><%= _('We do not have a working {{law_used_full}} address for {{public_body_name}}.',:law_used_full=>h(@info_request.law_used_full),:public_body_name=>h(@info_request.public_body.name)) %> <%= raw(_('You may be able to find
+ <p><%= _('We do not have a working {{law_used_full}} address for {{public_body_name}}.',:law_used_full=>h(@info_request.law_used_full),:public_body_name=>h(@info_request.public_body.name)) %> <%= _('You may be able to find
one on their website, or by phoning them up and asking. If you manage
- to find one, then please <a href="%s">send it to us</a>.') % [help_contact_path]) %>
+ to find one, then please <a href="{{url}}">send it to us</a>.', :url => help_contact_path.html_safe) %>
</p>
<% elsif @reason == 'external' %>
<p><%= _("Followups cannot be sent for this request, as it was made externally, and published here by {{public_body_name}} on the requester's behalf.", :public_body_name => h(@info_request.public_body.name)) %>
diff --git a/app/views/request/followup_preview.rhtml b/app/views/request/followup_preview.html.erb
index 50c64138f..55afc0245 100644
--- a/app/views/request/followup_preview.rhtml
+++ b/app/views/request/followup_preview.html.erb
@@ -2,7 +2,7 @@
<div id="followup">
-<% form_for(:outgoing_message, @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| %>
+<%= 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>
@@ -15,7 +15,7 @@
<li><%= _('Your message will appear in <strong>search engines</strong>') %></li>
</ul>
- <% fields_for :outgoing_message do |o| %>
+ <%= fields_for :outgoing_message do |o| %>
<div class="correspondence" id="outgoing-0">
<p class="preview_subject">
diff --git a/app/views/request/hidden.html.erb b/app/views/request/hidden.html.erb
new file mode 100644
index 000000000..f2f76a817
--- /dev/null
+++ b/app/views/request/hidden.html.erb
@@ -0,0 +1,19 @@
+<% @title = _("Request has been removed") %>
+
+<h1><%=@title%></h1>
+
+<p>
+<%=@details%>
+</p>
+
+<p><%= _('The request you have tried to view has been removed. There are
+various reasons why we might have done this, sorry we can\'t be more specific here. Please <a
+ href="{{url}}">contact us</a> if you have any questions.', :url => help_contact_path.html_safe) %>
+</p>
+<% if @info_request.prominence == 'requester_only' %>
+ <p>
+ <%= _('If you are the requester, then you may <a href="{{url}}">sign in</a> to view the request.', :url => signin_url(:r => request.fullpath).html_safe) %>
+ </p>
+<% end %>
+
+
diff --git a/app/views/request/hidden.rhtml b/app/views/request/hidden.rhtml
deleted file mode 100644
index 2d038a663..000000000
--- a/app/views/request/hidden.rhtml
+++ /dev/null
@@ -1,19 +0,0 @@
-<% @title = _("Request has been removed") %>
-
-<h1><%=@title%></h1>
-
-<p>
-<%=@details%>
-</p>
-
-<p><%= raw(_('The request you have tried to view has been removed. There are
-various reasons why we might have done this, sorry we can\'t be more specific here. Please <a
- href="%s">contact us</a> if you have any questions.') % [help_contact_path]) %>
-</p>
-<% if @info_request.prominence == 'requester_only' %>
- <p>
- <%= raw(_('If you are the requester, then you may <a href="%s">sign in</a> to view the request.') % [signin_url(:r => request.request_uri)]) %>
- </p>
-<% end %>
-
-
diff --git a/app/views/request/hidden_correspondence.html.erb b/app/views/request/hidden_correspondence.html.erb
new file mode 100644
index 000000000..46bf3ee37
--- /dev/null
+++ b/app/views/request/hidden_correspondence.html.erb
@@ -0,0 +1,4 @@
+<% @title = _("Message has been removed") %>
+
+<h1><%=@title%></h1>
+<%= render :partial => 'request/hidden_correspondence', :locals => { :message => @incoming_message } %>
diff --git a/app/views/request/list.html.erb b/app/views/request/list.html.erb
new file mode 100644
index 000000000..a465f03ba
--- /dev/null
+++ b/app/views/request/list.html.erb
@@ -0,0 +1,24 @@
+
+<div id="header_left">
+ <h1><%=@title%></h1>
+ <%= 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' } %>
+ <% end %>
+</div>
+
+<div style="clear:both"></div>
+
+<div class="results_section">
+ <% if key = request_list_cache_key %>
+ <% cache_if_caching_fragments(key, :expires_in => 5.minutes) do %>
+ <%= render :partial => 'list_results' %>
+ <% end %>
+ <% else %>
+ <%= render :partial => 'list_results' %>
+ <% end %>
+</div>
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
deleted file mode 100644
index 062b77c3e..000000000
--- a/app/views/request/list.rhtml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<div id="header_left">
- <h1><%=@title%></h1>
- <%= 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' } %>
- <% end %>
-</div>
-
-<div style="clear:both"></div>
-
-<div class="results_section">
- <% # TODO: Cache for 5 minutes %>
- <% if @list_results.empty? %>
- <p> <%= _('No requests of this sort yet.')%></p>
- <% else %>
- <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' %>
- <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result, :info_request => result.info_request } %>
- <% else %>
- <p><strong><%= _('Unexpected search result type') %> <%=result.class.to_s%></strong></p>
- <% end %>
- <% end %>
- </div>
- <% end %>
-
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @show_no_more_than) %>
-</div>
diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb
new file mode 100644
index 000000000..7f1332464
--- /dev/null
+++ b/app/views/request/new.html.erb
@@ -0,0 +1,194 @@
+<% unless @batch %>
+ <script type="text/javascript">
+ $(document).ready(function(){
+ // 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 %>");
+ });
+ }));
+
+ });
+ </script>
+<% end %>
+<% if @batch %>
+ <% @title = _("Make an {{law_used_short}} request", :law_used_short=>h(@info_request.law_used_short)) %>
+<% else %>
+ <% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %>
+<% end %>
+ <h1><%= _('2. Ask for Information') %></h1>
+
+ <% if @existing_request %>
+ <div class="errorExplanation" id="errorExplanation"><ul>
+ <li>
+ <%= _('{{existing_request_user}} already
+ created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
+ or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_path(@existing_request)) %>
+ </li>
+ </ul></div>
+ <% end %>
+ <% if @existing_batch %>
+ <div class="errorExplanation" id="errorExplanation"><ul>
+ <li>
+ <%= _('You already created the same batch of requests on {{date}}. You can either view the <a href="{{existing_batch}}">existing batch</a>, or edit the details below to make a new but similar batch of requests.', :date=>simple_date(@existing_batch.created_at), :existing_batch=>info_request_batch_path(@existing_batch)) %>
+ </li>
+ </ul></div>
+ <% end %>
+
+ <%= foi_error_messages_for :info_request, :outgoing_message %>
+
+ <%= form_for(@info_request, :url => (@batch ? new_batch_path : new_request_path), :html => { :id => 'write_form' } ) do |f| %>
+
+ <div id="request_header">
+ <div id="request_header_body">
+ <label class="form_label"><%= _('To:') %></label>
+
+ <% if @batch %>
+ <span id="to_public_body">
+ <%= _("Your selected authorities") %>
+ <span class="batch_public_body_toggle" data-hidetext="<%= _("(hide)") %>" data-showtext="<%= _("(show)") %>"><a class="toggle-message"></a></span>
+ </span>
+
+ <div class="batch_public_body_list">
+ <ul>
+ <% @public_bodies.each do |public_body| %>
+ <li><%= public_body.name %></li>
+ <% end %>
+ </ul>
+ </div>
+
+ <% else %>
+ <span id="to_public_body">
+ <%=h(@info_request.public_body.name)%>
+ </span>
+ <% end %>
+
+ <% unless @batch %>
+ <div class="form_item_note">
+ <% if @info_request.public_body.info_requests.size > 0 %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_path(@info_request.public_body)) %>
+ <% else %>
+ <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
+ <% end %>
+ </div>
+
+ <% 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.html_safe %></p>
+ </div>
+ <% end %>
+
+ <% if @info_request.public_body.eir_only? %>
+ <h3><%= _('Please ask for environmental information only') %></h3>
+
+ <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
+ <%= _('However, you have the right to request environmental
+ information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
+ <%= _('This covers a very wide spectrum of information about the state of
+ the <strong>natural and built environment</strong>, such as:') %>
+
+ <ul>
+ <li><%= _('Air, water, soil, land, flora and fauna (including how these effect
+ human beings)') %></li>
+ <li><%= _('Information on emissions and discharges (e.g. noise, energy,
+ radiation, waste materials)') %></li>
+ <li><%= _('Human health and safety') %></li>
+ <li><%= _('Cultural sites and built structures (as they may be affected by the
+ environmental factors listed above)') %></li>
+ <li><%= _('Plans and administrative measures that affect these matters') %></li>
+ </ul>
+
+ <p><%= _('Please only request information that comes under those categories, <strong>do not waste your
+ time</strong> or the time of the public authority by requesting unrelated information.') %></p>
+ <% end %>
+ <% end %>
+ </div>
+
+ <div id="request_header_subject">
+ <p>
+ <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label>
+ <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>
+ </p>
+ <div class="form_item_note">
+ (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
+ <%= render :partial => "summary_suggestion" %>)
+ </div>
+ </div>
+
+ <div id="typeahead_response">
+ </div>
+ </div>
+
+ <div id="request_advice">
+ <ul>
+ <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
+ <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li>
+ <li><%= _('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="{{url}}">why?</a>).', :url => (help_requesting_path + '#focused').html_safe) %></li>
+ </ul>
+ </div>
+
+ <div id="request_form">
+ <%= fields_for :outgoing_message do |o| %>
+ <p>
+ <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
+ <%= o.text_area :body, :rows => 20, :cols => 60 %>
+ </p>
+ <% end %>
+
+ <% if !@user %>
+ <p class="form_note">
+
+ <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>,
+ will be <strong>displayed publicly</strong> on
+ this website forever (<a href="{{url}}">why?</a>).', :url => (help_privacy_path+"#public_request").html_safe)) %>
+ <%= raw(_('If you are thinking of using a pseudonym,
+ please <a href="{{url}}">read this first</a>.', :url => (help_privacy_path+"#real_name").html_safe)) %>
+ </p>
+ <% else %>
+ <p class="form_note">
+ <%= raw(_('Everything that you enter on this page
+ will be <strong>displayed publicly</strong> on
+ this website forever (<a href="{{url}}">why?</a>).', :url => (help_privacy_path+"#public_request").html_safe)) %>
+ </p>
+ <% end %>
+
+ <p class="form_note">
+ <%= raw(_("<strong> Can I request information about myself?</strong>\n" +
+ "\t\t\t<a href=\"{{url}}\">No! (Click here for details)</a>", :url => (help_requesting_path+"#data_protection").html_safe)) %>
+ </p>
+
+ <div class="form_button">
+ <% if @batch %>
+ <% params[:public_body_ids].each do |public_body_id| %>
+ <%= hidden_field_tag("public_body_ids[]", public_body_id)%>
+ <% end %>
+ <% else %>
+ <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
+ <% end %>
+ <%= hidden_field_tag(:submitted_new_request, 1 ) %>
+ <%= hidden_field_tag(:preview, 1 ) %>
+ <%= submit_tag _("Preview your public request") %>
+ </div>
+
+ <% if !@info_request.tag_string.empty? %>
+ <p class="form_note">
+ <!-- <label class="form_label" for="info_request_tag_string"><%= _("Tags (separated by a space):") %></label>
+ <%= f.text_field :tag_string, :size => 50 %> -->
+
+ <%= f.hidden_field(:tag_string) %>
+ <strong>Tags:</strong> <%=h @info_request.tag_string %>
+ </p>
+ <% end %>
+
+ </div>
+<% end %>
+<% if @batch %>
+ <%= javascript_include_tag 'new-request.js' %>
+<% end %>
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml
deleted file mode 100644
index f396ea9ec..000000000
--- a/app/views/request/new.rhtml
+++ /dev/null
@@ -1,154 +0,0 @@
-<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script>
-<script type="text/javascript">
- $(document).ready(function(){
- // 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 %>");
- });
- }));
-
- });
-</script>
-
-<% @title = _("Make an {{law_used_short}} request to '{{public_body_name}}'",:law_used_short=>h(@info_request.law_used_short),:public_body_name=>h(@info_request.public_body.name)) %>
-
- <h1><%= _('2. Ask for Information') %></h1>
-
- <% if @existing_request %>
- <div class="errorExplanation" id="errorExplanation"><ul>
- <li>
- <%= _('{{existing_request_user}} already
- created the same request on {{date}}. You can either view the <a href="{{existing_request}}">existing request</a>,
- or edit the details below to make a new but similar request.',:existing_request_user=>user_or_you_capital_link(@existing_request.user), :date=>simple_date(@existing_request.created_at), :existing_request=>request_url(@existing_request)) %>
- </li>
- </ul></div>
- <% end %>
-
- <%= foi_error_messages_for :info_request, :outgoing_message %>
-
- <% form_for(:info_request, @info_request, :html => { :id => 'write_form' } ) do |f| %>
-
- <div id="request_header">
- <div id="request_header_body">
- <label class="form_label" for="info_request_public_body_id"><%= _('To:') %></label>
- <span id="to_public_body"><%=h(@info_request.public_body.name)%></span>
- <div class="form_item_note">
- <% if @info_request.public_body.info_requests.size > 0 %>
- <%= _("Browse <a href='{{url}}'>other requests</a> to '{{public_body_name}}' for examples of how to word your request.", :public_body_name=>h(@info_request.public_body.name), :url=>public_body_url(@info_request.public_body)) %>
- <% else %>
- <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_url) %>
- <% end %>
- </div>
-
- <% 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 %>
-
- <% if @info_request.public_body.eir_only? %>
- <h3><%= _('Please ask for environmental information only') %></h3>
-
- <p><%= _('The Freedom of Information Act <strong>does not apply</strong> to') %> <%=h(@info_request.public_body.name)%>.
- <%= _('However, you have the right to request environmental
- information under a different law') %> (<a href="/help/requesting#eir">explanation</a>).
- <%= _('This covers a very wide spectrum of information about the state of
- the <strong>natural and built environment</strong>, such as:') %>
-
- <ul>
- <li><%= _('Air, water, soil, land, flora and fauna (including how these effect
- human beings)') %></li>
- <li><%= _('Information on emissions and discharges (e.g. noise, energy,
- radiation, waste materials)') %></li>
- <li><%= _('Human health and safety') %></li>
- <li><%= _('Cultural sites and built structures (as they may be affected by the
- environmental factors listed above)') %></li>
- <li><%= _('Plans and administrative measures that affect these matters') %></li>
- </ul>
-
- <p><%= _('Please only request information that comes under those categories, <strong>do not waste your
- time</strong> or the time of the public authority by requesting unrelated information.') %></p>
- <% end %>
- </div>
-
- <div id="request_header_subject">
- <p>
- <label class="form_label" for="typeahead_search"><%= _('Summary:') %></label>
- <%= f.text_field :title, :size => 50, :id =>"typeahead_search" %>
- </p>
- <div class="form_item_note">
- (<%= _("a one line summary of the information you are requesting, \n\t\t\te.g.") %>
- <%= render :partial => "summary_suggestion" %>)
- </div>
- </div>
-
- <div id="typeahead_response">
- </div>
- </div>
-
- <div id="request_advice">
- <ul>
- <li><%= _('Write your request in <strong>simple, precise language</strong>.') %></li>
- <li><%= _('Ask for <strong>specific</strong> documents or information, this site is not suitable for general enquiries.') %></li>
- <li><%= raw(_('Keep it <strong>focused</strong>, you\'ll be more likely to get what you want (<a href="%s">why?</a>).') % [help_requesting_path + '#focused']) %></li>
- </ul>
- </div>
-
- <div id="request_form">
- <% fields_for :outgoing_message do |o| %>
- <p>
- <label class="form_label" for="outgoing_message_body"><%= _('Your request:') %></label>
- <%= o.text_area :body, :rows => 20, :cols => 60 %>
- </p>
- <% end %>
-
- <% if !@user %>
- <p class="form_note">
- <%= raw(_('Everything that you enter on this page, including <strong>your name</strong>,
- will be <strong>displayed publicly</strong> on
- this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
- <%= raw(_('If you are thinking of using a pseudonym,
- please <a href="%s">read this first</a>.') % [help_privacy_path+"#real_name"]) %>
- </p>
- <% else %>
- <p class="form_note">
- <%= raw(_('Everything that you enter on this page
- will be <strong>displayed publicly</strong> on
- this website forever (<a href="%s">why?</a>).') % [help_privacy_path+"#public_request"]) %>
- </p>
- <% end %>
-
- <p class="form_note">
- <%= raw(_("<strong> Can I request information about myself?</strong>\n" +
- "\t\t\t<a href=\"%s\">No! (Click here for details)</a>") % [help_requesting_path+"#data_protection"]) %>
- </p>
-
- <div class="form_button">
- <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
- <%= hidden_field_tag(:submitted_new_request, 1 ) %>
- <%= hidden_field_tag(:preview, 1 ) %>
- <%= submit_tag _("Preview your public request") %>
- </div>
-
- <% if !@info_request.tag_string.empty? %>
- <p class="form_note">
- <!-- <label class="form_label" for="info_request_tag_string">Tags:</label>
- <%= f.text_field :tag_string, :size => 50 %> -->
-
- <%= f.hidden_field(:tag_string) %>
- <strong>Tags:</strong> <%=h @info_request.tag_string %>
- </p>
- <% end %>
-
- </div>
-<% end %>
-
-
diff --git a/app/views/request/new_bad_contact.rhtml b/app/views/request/new_bad_contact.html.erb
index 56f3f4168..56f3f4168 100644
--- a/app/views/request/new_bad_contact.rhtml
+++ b/app/views/request/new_bad_contact.html.erb
diff --git a/app/views/request/new_please_describe.rhtml b/app/views/request/new_please_describe.html.erb
index ff27405b8..8da4eb555 100644
--- a/app/views/request/new_please_describe.rhtml
+++ b/app/views/request/new_please_describe.html.erb
@@ -1,4 +1,4 @@
-<% @title = "First, did your other requests succeed?" %>
+<% @title = _("First, did your other requests succeed?") %>
<h1><%=@title%></h1>
@@ -13,7 +13,7 @@ if they are successful yet or not.') %>
</ul>
<p>
- <%= raw(_('When you\'re done, <strong>come back here</strong>, <a href="%s">reload this page</a> and file your new request.') % [request.request_uri]) %>
+ <%= _('When you\'re done, <strong>come back here</strong>, <a href="{{url}}">reload this page</a> and file your new request.', :url => request.fullpath.html_safe) %>
</p>
<p>
diff --git a/app/views/request/preview.html.erb b/app/views/request/preview.html.erb
new file mode 100644
index 000000000..0265d0328
--- /dev/null
+++ b/app/views/request/preview.html.erb
@@ -0,0 +1,62 @@
+<% if @batch %>
+ <% @title = _("Preview new {{law_used_short}} request", :law_used_short => h(@info_request.law_used_short)) %>
+<% else %>
+ <% @title = _("Preview new {{law_used_short}} request to '{{public_body_name}}", :law_used_short => h(@info_request.law_used_short), :public_body_name => h(@info_request.public_body.name)) %>
+<% end %>
+<%= form_for(@info_request, :url => (@batch ? new_batch_path : new_request_path), :html => { :id => 'preview_form' } ) do |f| %>
+
+ <h1><%= _('3. Now check your request') %></h1>
+ <ul>
+ <li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li>
+ <li><%= raw(_('Your name, request and any responses will appear in <strong>search engines</strong>
+ (<a href="{{url}}">details</a>).', :url => (help_privacy_path+"#public_request").html_safe)) %>
+ </li>
+ </ul>
+
+ <%= fields_for :outgoing_message do |o| %>
+
+ <div class="correspondence" id="outgoing-0">
+ <p class="preview_subject">
+ <strong><%= _('To:') %></strong>
+ <% if @batch %>
+ <%= _("Your selected authorities")%>
+ <% else %>
+ <%=h(@info_request.public_body.name)%>
+ <% end %>
+ <br><strong><%= _('Subject:') %></strong> <%=h @info_request.email_subject_request %>
+ </p>
+
+ <div class="correspondence_text">
+ <p><%= @outgoing_message.get_body_for_html_display %></p>
+ <%= o.hidden_field(:body) %>
+ </div>
+
+ <p class="event_actions">
+ </p>
+ </div>
+ <% end %>
+
+ <p><%= _('<strong>Privacy note:</strong> If you want to request private information about
+ yourself then <a href="{{url}}">click here</a>.', :url => (help_requesting_path+"#data_protection").html_safe) %>
+
+ <p>
+ <%= f.hidden_field(:title) %>
+ <% if @batch %>
+ <% params[:public_body_ids].each do |public_body_id| %>
+ <%= hidden_field_tag("public_body_ids[]", public_body_id)%>
+ <% end %>
+ <% else %>
+ <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
+ <% end %>
+ <%= f.hidden_field(:tag_string) %>
+ <%= hidden_field_tag(:submitted_new_request, 1) %>
+ <%= hidden_field_tag(:preview, 0 ) %>
+ <%= submit_tag _("Edit this request"), :name => 'reedit', :id => 'reedit_button' %>
+ <%= submit_tag _("Send request"), :name => 'submit', :id => 'submit_button' %>
+ </p>
+
+ <% if !@info_request.tag_string.empty? %>
+ <p><strong><%= _('Tags:') %></strong> <%=h @info_request.tag_string %></p>
+ <% end %>
+
+<% end %>
diff --git a/app/views/request/preview.rhtml b/app/views/request/preview.rhtml
deleted file mode 100644
index 8d1fd753e..000000000
--- a/app/views/request/preview.rhtml
+++ /dev/null
@@ -1,48 +0,0 @@
-<% @title = "Preview new " + h(@info_request.law_used_short) + " request to '" + h(@info_request.public_body.name) + "'" %>
-
-<% form_for(:info_request, @info_request, :html => { :id => 'preview_form' } ) do |f| %>
-
- <h1><%= _('3. Now check your request') %></h1>
- <ul>
- <li><%= _('Check you haven\'t included any <strong>personal information</strong>.') %></li>
- <li><%= raw(_('Your name, request and any responses will appear in <strong>search engines</strong>
- (<a href="%s">details</a>).') % [help_privacy_path+"#public_request"]) %>
- </li>
- </ul>
-
- <% fields_for :outgoing_message do |o| %>
-
- <div class="correspondence" id="outgoing-0">
- <p class="preview_subject">
- <strong><%= _('To:') %></strong> <%=h @info_request.public_body.name %>
- <br><strong><%= _('Subject:') %></strong> <%=h @info_request.email_subject_request %>
- </p>
-
- <div class="correspondence_text">
- <p><%= @outgoing_message.get_body_for_html_display %></p>
- <%= o.hidden_field(:body) %>
- </div>
-
- <p class="event_actions">
- </p>
- </div>
- <% end %>
-
- <p><%= raw(_('<strong>Privacy note:</strong> If you want to request private information about
- yourself then <a href="%s">click here</a>.') % [help_requesting_path+"#data_protection"]) %>
-
- <p>
- <%= f.hidden_field(:title) %>
- <%= f.hidden_field(:public_body_id, { :value => @info_request.public_body_id } ) %>
- <%= f.hidden_field(:tag_string) %>
- <%= hidden_field_tag(:submitted_new_request, 1) %>
- <%= hidden_field_tag(:preview, 0 ) %>
- <%= submit_tag _("Edit this request"), :name => 'reedit', :id => 'reedit_button' %>
- <%= submit_tag _("Send request"), :name => 'submit', :id => 'submit_button' %>
- </p>
-
- <% if !@info_request.tag_string.empty? %>
- <p><strong><%= _('Tags:') %></strong> <%=h @info_request.tag_string %></p>
- <% end %>
-
-<% end %> \ No newline at end of file
diff --git a/app/views/request/select_authorities.html.erb b/app/views/request/select_authorities.html.erb
new file mode 100644
index 000000000..e16bcc191
--- /dev/null
+++ b/app/views/request/select_authorities.html.erb
@@ -0,0 +1,77 @@
+<% @title = _("Select the authorities to write to") %>
+<h1><%= _('1. Select authorities') %></h1>
+
+<p>
+ <%= _("Search for the authorities you'd like information from:") %>
+</p>
+
+<div>
+ <%= form_tag(select_authorities_path, {:method => 'get', :id => 'body_search_form', :remote => true, "data-type" => 'json'}) do %>
+ <%= text_field_tag 'public_body_query', params[:public_body_query], { :size => 30, :title => "type your search term here" } %>
+ <% if !@public_bodies.blank? %>
+ <%- @public_bodies.each do |public_body| %>
+ <%= hidden_field_tag "public_body_ids[]", public_body.id, {:id => nil} %>
+ <%- end %>
+ <% end %>
+ <% end %>
+</div>
+
+<div id="body_selection">
+ <div id="body_lists">
+ <div id="body_candidates" class="body_list">
+ <%= form_tag(select_authorities_path, {:id => "body_select_form"}) do %>
+ <%= submit_tag _(' >> '), :id => 'body_select_all_button', :class => 'select_all_button' %>
+ <%= submit_tag _(' > '), :id => 'body_select_button' %>
+ <%= hidden_field_tag "public_body_query", params[:public_body_query], { :id => 'public_body_select_query' } %>
+ <% if !@public_bodies.blank? %>
+ <% @public_bodies.each do |public_body| %>
+ <%= hidden_field_tag "public_body_ids[]", public_body.id, {:id => nil} %>
+ <% end %>
+ <% end %>
+ <select multiple name="public_body_ids[]" id="select_body_candidates" class="body_select" size="15">
+ <% if @search_bodies %>
+ <% @search_bodies.results.each do |result| %>
+ <% unless (@public_bodies && @public_bodies.include?(result[:model])) %>
+ <option value="<%= result[:model].id %>"><%= result[:model].name %></option>
+ <% end %>
+ <% end %>
+ <% end %>
+ </select>
+ <% end %>
+ </div>
+
+ <div id="body_selections" class="body_list">
+ <%= form_tag(select_authorities_path, {:id => "body_deselect_form"}) do %>
+
+ <%= submit_tag _(' < '), :id => 'body_deselect_button' %>
+ <%= submit_tag _(' << '), :id => 'body_deselect_all_button', :class => 'select_all_button' %>
+ <%= hidden_field_tag "public_body_query", params[:public_body_query], { :id => 'public_body_deselect_query' } %>
+ <% if @public_bodies %>
+ <% @public_bodies.each do |public_body| %>
+ <%= hidden_field_tag "public_body_ids[]", public_body.id, {:id => nil} %>
+ <% end %>
+ <% end %>
+ <select multiple name="remove_public_body_ids[]" id="select_body_selections" class="body_select" size="15">
+ <% if @public_bodies %>
+ <% @public_bodies.each do |public_body| %>
+ <option value="<%= public_body.id %>"><%= public_body.name %></option>
+ <% end %>
+ <% end %>
+ </select>
+ <% end %>
+
+ <div id="body_submission">
+ <%= form_tag(new_batch_path, {:id => "body_submit_form"}) do %>
+ <% if @public_bodies %>
+ <% @public_bodies.each do |public_body| %>
+ <%= hidden_field_tag "public_body_ids[]", public_body.id , {:id => nil} %>
+ <% end %>
+ <% end %>
+ <%= submit_tag _('Make a request to these authorities'), :id => 'body_submit_button' %>
+ <% end %>
+ </div>
+
+ </div>
+ </div>
+</div>
+<%= javascript_include_tag 'jquery_ujs.js', 'select-authorities.js' %>
diff --git a/app/views/request/select_authority.rhtml b/app/views/request/select_authority.html.erb
index 652c24da9..83abdb184 100644
--- a/app/views/request/select_authority.rhtml
+++ b/app/views/request/select_authority.html.erb
@@ -1,23 +1,22 @@
-<script type="text/javascript" src="/javascripts/ba-throttle-debounce.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#authority_preview").hide();
-
+
// Avoid triggering too often (on each keystroke) by using the debounce jQuery plugin:
// http://benalman.com/projects/jquery-throttle-debounce-plugin/
- $("#query").keypress($.debounce( 300, function() {
+ $("#query").keypress($.debounce( 300, function() {
// Do a type ahead search and display results
$("#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
+ // 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 .head a").live('click', function() {
$("#authority_preview").load(this.href+" #public_body_show", function() {
$("#authority_preview").show();
- $(window).scrollTop($("#banner").height());
+ $(window).scrollTop($("#banner").height());
$("#authority_preview #header_right").hide();
});
return false;
@@ -30,41 +29,31 @@
<h1 style="clear: left"><%= _('1. Select an authority') %></h1>
<div id="authority_selection">
- <% form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>
+ <%= form_tag({:controller => "request", :action => "select_authority"}, {:id => "search_form", :method => "get"}) do %>
<div>
<p>
- <%= raw(_('First, type in the <strong>name of the UK public authority</strong> you\'d
+ <%= _('First, type in the <strong>name of the UK public authority</strong> you\'d
like information from. <strong>By law, they have to respond</strong>
- (<a href="%s#%s">why?</a>).') % [help_about_url, "whybother_them"]) %>
+ (<a href="{{url}}">why?</a>).', :url => (help_about_path + "#whybother_them").html_safe) %>
</p>
- <%= text_field_tag 'query', params[:query], { :size => 30 } %>
+ <%= text_field_tag 'query', params[:query], { :size => 30, :title => "type your search term here" } %>
<%= hidden_field_tag 'bodies', 1 %>
<%= submit_tag _('Search') %>
</div>
+ <% if AlaveteliConfiguration.allow_batch_requests && @user && @user.can_make_batch_requests? %>
+ <div id="batch_request_link">
+ <p>
+ <%= _('Or make a <a href="{{url}}">batch request</a> to <strong>multiple authorities</strong> at once.', :url => select_authorities_path) %>
+ </p>
+ </div>
+ <% end %>
<% end %>
- <div id="typeahead_response">
- <% if !@xapian_requests.nil? %>
- <% if @xapian_requests.results.size > 0 %>
- <h3><%= _('Top search results:') %></h3>
- <p>
- <%= _('Select one to see more information about the authority.')%>
- </p>
- <% else %>
- <h3><%= _('No results found.') %></h3>
- <% end %>
- <div id="authority_search_ahead_results">
- <% for result in @xapian_requests.results %>
- <%= render :partial => 'public_body/body_listing_single', :locals => { :public_body => result[:model] } %>
- <% end %>
- </div>
-
- <% end %>
-
-
+ <div id="typeahead_response">
+ <%= render :partial => 'public_body/search_ahead' %>
</div>
</div>
-
+
<div id="authority_preview">
</div>
-
+
diff --git a/app/views/request/show.rhtml b/app/views/request/show.html.erb
index 0cae3a9aa..153b0b861 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.html.erb
@@ -10,8 +10,8 @@
<% end %>
<% if @info_request.prominence == 'requester_only' %>
<p id="hidden_request">
- <%= raw(_('This request is hidden, so that only you the requester can see it. Please
- <a href="%s">contact us</a> if you are not sure why.') % [help_requesting_path]) %>
+ <%= _('This request is hidden, so that only you the requester can see it. Please
+ <a href="{{url}}">contact us</a> if you are not sure why.', :url => help_requesting_path.html_safe) %>
</p>
<% end %>
@@ -25,7 +25,7 @@
<div id="left_column">
<h1><%=h(@info_request.title)%></h1>
- <% if !@info_request.is_external? && @info_request.user.profile_photo %>
+ <% if !@info_request.is_external? && @info_request.user.profile_photo && !@render_to_file %>
<p class="user_photo_on_request">
<img src="<%= get_profile_photo_url(:url_name => @info_request.user.url_name) %>" alt="">
</p>
@@ -34,21 +34,23 @@
<p class="subtitle">
<% if !@user.nil? && @user.admin_page_links? %>
<%= _('{{user}} ({{user_admin_link}}) made this {{law_used_full}} request (<a href="{{request_admin_url}}">admin</a>) to {{public_body_link}} (<a href="{{public_body_admin_url}}">admin</a>)',
- :user => @info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user),
+ :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 => request_admin_url(@info_request),
+ :request_admin_url => admin_request_show_url(@info_request),
:public_body_link => public_body_link(@info_request.public_body),
- :public_body_admin_url => public_body_admin_url(@info_request.public_body)) %>
+ :public_body_admin_url => admin_body_show_url(@info_request.public_body)) %>
<% else %>
- <%= _('{{user}} made this {{law_used_full}} request',:user=>@info_request.is_external? ? (@info_request.user_name || _('An anonymous user')) : user_link(@info_request.user), :law_used_full=>h(@info_request.law_used_full)) %>
+ <%= _('{{user}} made this {{law_used_full}} request',
+ :user=>request_user_link(@info_request, _('An anonymous user')),
+ :law_used_full=>h(@info_request.law_used_full)) %>
<%= _('to {{public_body}}',:public_body=>public_body_link(@info_request.public_body)) %>
<% end %>
</p>
<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? %>
+ <% 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.') %>
<% else %>
@@ -80,14 +82,14 @@
<%= _('in term time') %>
<% end %>
<%= _('by') %> <strong><%= simple_date(@info_request.date_response_required_by) %></strong>
- (<%= raw(_('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response']) %>)
+ (<%= link_to _('details'), help_requesting_path + '#quickly_response' %>)
<% elsif @status == 'waiting_response_very_overdue' %>
<%= _('Response to this request is <strong>long overdue</strong>.') %>
<%= _('By law, under all circumstances, {{public_body_link}} should have responded by now',:public_body_link => public_body_link(@info_request.public_body)) %>
- (<%= raw(_('<a href="%s">details</a>') % [help_requesting_path + '#quickly_response']) %>).
+ (<%= link_to _('details'), help_requesting_path + '#quickly_response' %>).
<% if !@info_request.is_external? %>
<%= _('You can <strong>complain</strong> by') %>
- <%= link_to _("requesting an internal review"), show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
+ <%= link_to _("requesting an internal review"), show_response_no_followup_path(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %>.
<% end %>
<% elsif @status == 'not_held' %>
<%= public_body_link(@info_request.public_body) %> <%= _('<strong>did not have</strong> the information requested.') %>
@@ -101,12 +103,12 @@
<% if @is_owning_user && !@info_request.is_external? %>
<%=h @info_request.public_body.name %> <%= _('is <strong>waiting for your clarification</strong>.') %>
<%= _('Please') %>
- <%= link_to _("send a follow up message"), respond_to_last_url(@info_request) + '#followup' %>.
+ <%= link_to _("send a follow up message"), respond_to_last_path(@info_request) + '#followup' %>.
<% else %>
<%= _('The request is <strong>waiting for clarification</strong>.') %>
<% if !@info_request.is_external? %>
<%= _('If you are {{user_link}}, please',:user_link=>user_link_for_request(@info_request)) %>
- <%= link_to _("sign in"), signin_url(:r => request.request_uri) %> <%= _('to send a follow up message.') %>
+ <%= link_to _("sign in"), signin_path(:r => request.fullpath) %> <%= _('to send a follow up message.') %>
<% end %>
<% end %>
<% elsif @status == 'gone_postal' %>
@@ -146,4 +148,4 @@
<%= render :partial => 'after_actions' %>
</div>
-<%= render :partial => 'sidebar' %>
+<%- if @sidebar %><%= render :partial => 'sidebar' %><% end %>
diff --git a/app/views/request/show.text.erb b/app/views/request/show.text.erb
new file mode 100644
index 000000000..8079d10d5
--- /dev/null
+++ b/app/views/request/show.text.erb
@@ -0,0 +1,17 @@
+<%= _('This is a plain-text version of the Freedom of Information request "{{request_title}}". The latest, full version is available online at {{full_url}}', :request_title => @info_request.title, :full_url => "http://#{AlaveteliConfiguration::domain}#{show_request_path(:url_title=>@info_request.url_title)}") %>.
+
+<% @info_request_events.each do |info_request_event| %>
+ <% if info_request_event.visible %>
+ <% case info_request_event.event_type %>
+ <% when 'response' %>
+ <%= render :partial => 'request/incoming_correspondence', :formats => 'text', :locals => { :incoming_message => info_request_event.incoming_message } %>
+ <% when 'sent', 'followup_sent' %>
+ <%= render :partial => 'request/outgoing_correspondence', :formats => 'text', :locals => { :outgoing_message => info_request_event.outgoing_message, :info_request_event => info_request_event }%>
+ <% when 'resent', 'followup_resent' %>
+ <%= render :partial => 'request/resent_outgoing_correspondence', :formats => 'text', :locals => { outgoing_message => info_request_event.outgoing_message, :info_request_event => info_request_event }%>
+ <% when 'comment' %>
+ <%= render :partial => 'comment/single_comment', :formats => 'text', :locals => { :comment => info_request_event.comment } %>
+ <% end %>
+-------------------------------
+ <% end %>
+<% end %>
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.html.erb
index ac1f04227..ace86cf4c 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.html.erb
@@ -26,8 +26,8 @@
<%= _('The authority only has a <strong>paper copy</strong> of the information.') %>
</dt>
<dd>
- <%= raw(_('At the bottom of this page, write a reply to them trying to persuade them to scan it in
- (<a href="%s">more details</a>).') % [help_privacy_path + '#postal_answer']) %>
+ <%= _('At the bottom of this page, write a reply to them trying to persuade them to scan it in
+ (<a href="{{url}}">more details</a>).', :url => (help_privacy_path + '#postal_answer').html_safe) %>
</dd>
<dt>
@@ -36,7 +36,7 @@
<dd>
<%= _('To do that please send a private email to ') %><%=h(@postal_email_name)%>
&lt;<%=link_to h(@postal_email), "mailto:" + @postal_email%>&gt;
- <%= _('containing your postal address, and asking them to reply to this request.
+ <%= _('containing your postal address, and asking them to reply to this request.
Or you could phone them.') %>
<%= _('When you receive the paper response, please help
@@ -63,16 +63,16 @@
<% end %>
<% else %>
<% if @incoming_message.recently_arrived %>
- <h2><%= _('New response to {{law_used_short}} request',:law_used_short => h(@info_request.law_used_short))%> '<%= request_link @info_request %>'</h2>
+ <h2><%= _('New response to {{law_used_short}} request',:law_used_short => h(@info_request.law_used_short))%> '<%= request_link @info_request %>'</h2>
<% else %>
<h2>Response to <%=h(@info_request.law_used_short)%> request '<%= request_link @info_request %>'</h2>
<% end %>
<% end %>
<% if @incoming_message.nil? %>
- <%= render :partial => 'correspondence', :locals => { :info_request_event => @info_request.get_last_outgoing_event, :incoming_message => nil } %>
+ <%= render :partial => 'correspondence', :locals => { :info_request_event => @info_request.get_last_outgoing_event } %>
<% else %>
- <%= render :partial => 'correspondence', :locals => { :info_request_event => nil, :incoming_message => @incoming_message } %>
+ <%= render :partial => 'correspondence', :locals => { :info_request_event => @incoming_message.response_event } %>
<% end %>
<% end %>
diff --git a/app/views/request/similar.rhtml b/app/views/request/similar.html.erb
index 0d53f6919..5bdefc494 100644
--- a/app/views/request/similar.rhtml
+++ b/app/views/request/similar.html.erb
@@ -1,7 +1,16 @@
-<% @title = "Requests similar to '" + h(@info_request.title) + "'" + @page_desc %>
-<h1><%="Requests similar to '" + request_link(@info_request) + "'" + @page_desc %></h1>
+<%- if @page > 1 %>
+ <%- @title = _("Requests similar to '{{request_title}}' (page {{page}})", {:page => @page, :request_title => @info_request.title}) %>
+<%- else %>
+<%- @title = _("Requests similar to '{{request_title}}'", {:request_title => @info_request.title}) %>
+<%- end %>
-<!-- Important terms: <%= @xapian_object.important_terms.join(" ") %> -->
+<h1>
+ <%- if @page > 1 %>
+ <%= _("Requests similar to '{{request_title}}' (page {{page}})", {:page => @page, :request_title => request_link(@info_request)}) %>
+ <%- else %>
+ <%= _("Requests similar to '{{request_title}}'", {:request_title => request_link(@info_request)}) %>
+ <%- end %>
+</h1>
<% if @xapian_object.results.empty? %>
<p><%= _('No similar requests found.')%></p>
diff --git a/app/views/request/simple_correspondence.rhtml b/app/views/request/simple_correspondence.rhtml
deleted file mode 100644
index 0da9ef172..000000000
--- a/app/views/request/simple_correspondence.rhtml
+++ /dev/null
@@ -1,45 +0,0 @@
-<%= _('This is a plain-text version of the Freedom of Information request "{{request_title}}". The latest, full version is available online at {{full_url}}', :request_title => @info_request.title, :full_url => "http://#{Configuration::domain}#{show_request_path(:url_title=>@info_request.url_title)}") %>.
-
-<% for info_request_event in @info_request_events %>
-<%
- incoming_message = nil
- if info_request_event.visible
- if !info_request_event.nil? && info_request_event.event_type == 'response'
- incoming_message = info_request_event.incoming_message
- end
-
-
- if not incoming_message.nil?
- if !incoming_message.safe_mail_from.nil? && incoming_message.safe_mail_from.strip != @info_request.public_body.name.strip %>
-<%= _('From:') %> <%= incoming_message.safe_mail_from %><% end
- if incoming_message.safe_mail_from.nil? || (incoming_message.mail_from_domain == @info_request.public_body.request_email_domain) %>, <%= @info_request.public_body.name %><% end %>
-<%= _('To:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %>
-<%= _('Date:') %> <%= simple_date(incoming_message.sent_at) %>
-
-<%= incoming_message.get_body_for_quoting %>
-<% incoming_message.get_attachments_for_display.each do |a| %>
- <%= _('Attachment:') %> <%= a.display_filename %> (<%= a.display_size %>)
- <% end %>
-<%
-elsif [ 'sent', 'followup_sent' ].include?(info_request_event.event_type)
- outgoing_message = info_request_event.outgoing_message
- %>
-<%= _('From:') %> <% if @info_request.user_name %><%= @info_request.user_name %><% else %><%= "[#{_('An anonymous user')}]"%><% end %>
-<%= _('To:') %> <%= @info_request.public_body.name %>
-<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
-<%
- text = outgoing_message.body.strip
- outgoing_message.remove_privacy_sensitive_things!(text) %>
-
-<%= text %>
-<% elsif [ 'resent', 'followup_resent' ].include?(info_request_event.event_type) %>
-<%= _('Date:') %> <%= simple_date(info_request_event.created_at) %>
-Sent <% if info_request_event.outgoing_message.message_type == 'initial_request' %> request <% elsif info_request_event.outgoing_message.message_type == 'followup' %> a follow up <% else %> <% raise "unknown message_type" %><% end %> to <%= public_body_link(@info_request.public_body) %> again<% if not info_request_event.same_email_as_previous_send? %>, using a new contact address<% end %>.
-
-<% elsif info_request_event.event_type == 'comment'
- comment = info_request_event.comment
-%>
-<%= _("{{username}} left an annotation:", :username =>comment.user.name) %> (<%= simple_date(comment.created_at || Time.now) %>)
-<%= comment.body.strip %>
-<% end %>
--------------------------------<% end %><% end %>
diff --git a/app/views/request/upload_response.rhtml b/app/views/request/upload_response.html.erb
index 675951595..f5fd6f000 100644
--- a/app/views/request/upload_response.rhtml
+++ b/app/views/request/upload_response.html.erb
@@ -12,7 +12,7 @@
<h1><%= _('Respond to the FOI request')%> '<%=request_link(@info_request)%>'<% _(' made by ')%><%=user_link(@info_request.user) %></h1>
<p>
- <%= raw(_('Your response will <strong>appear on the Internet</strong>, <a href="%s">read why</a> and answers to other questions.') % [help_officers_path]) %>
+ <%= raw(_('Your response will <strong>appear on the Internet</strong>, <a href="{{url}}">read why</a> and answers to other questions.', :url => help_officers_path.html_safe)) %>
</p>
<h2><%= _('Respond by email')%></h2>
@@ -28,9 +28,9 @@
<h2><%= _('Respond using the web')%></h2>
<p><%= raw(_('Enter your response below. You may attach one file (use email, or
- <a href="%s">contact us</a> if you need more).')% [help_contact_path]) %></p>
+ <a href="{{url}}">contact us</a> if you need more).', :url => help_contact_path.html_safe)) %></p>
- <% form_tag '', :id => 'upload_response_form', :multipart => true do %>
+ <%= form_tag '', :id => 'upload_response_form', :multipart => true do %>
<p>
<label class="form_label" for="body"><% _('Response:')%></label>
<%= text_area_tag :body, "", :rows => 10, :cols => 55 %>
diff --git a/app/views/request_game/play.rhtml b/app/views/request_game/play.html.erb
index eedf19ca2..d5aa0d00e 100644
--- a/app/views/request_game/play.rhtml
+++ b/app/views/request_game/play.html.erb
@@ -11,7 +11,7 @@
<tr>
<td> <%= c += 1 %>. <td>
<td> <%= user_link(classifications.user) %> </td>
- <td> <%=pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;")%> </td>
+ <td> <%=pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;").html_safe %> </td>
</tr>
<% end %>
</table>
@@ -22,7 +22,7 @@
<tr>
<td> <%= c += 1 %>. <td>
<td> <%= user_link(classifications.user) %> </td>
- <td> <%= pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;")%> </td>
+ <td> <%= pluralize(classifications.cnt, 'request').gsub(" ", "&nbsp;").html_safe %> </td>
</tr>
<% end %>
</table>
@@ -36,8 +36,8 @@ information has been provided. Everyone'll be exceedingly grateful.")%></p>
<%= render :partial => 'request/request_listing_single', :locals => { :info_request => info_request } %>
<% end %>
<p id="game_buttons">
-<%= button_to _('I don\'t like these ones &mdash; give me some more!'), play_url %>
-<%= button_to _('I don\'t want to do any more tidying now!'), stop_url %>
+<%= button_to _('I don\'t like these ones &mdash; give me some more!'), categorise_play_url %>
+<%= button_to _('I don\'t want to do any more tidying now!'), categorise_stop_url %>
</p>
<p><%= _('Thanks for helping - your work will make it easier for everyone to find successful
responses, and maybe even let us make league tables...')%></p>
diff --git a/app/views/request_mailer/comment_on_alert.rhtml b/app/views/request_mailer/comment_on_alert.text.erb
index 691e6f9bb..691e6f9bb 100644
--- a/app/views/request_mailer/comment_on_alert.rhtml
+++ b/app/views/request_mailer/comment_on_alert.text.erb
diff --git a/app/views/request_mailer/comment_on_alert_plural.rhtml b/app/views/request_mailer/comment_on_alert_plural.text.erb
index a495b8e08..a495b8e08 100644
--- a/app/views/request_mailer/comment_on_alert_plural.rhtml
+++ b/app/views/request_mailer/comment_on_alert_plural.text.erb
diff --git a/app/views/request_mailer/external_response.rhtml b/app/views/request_mailer/external_response.rhtml
deleted file mode 100644
index e9858f03f..000000000
--- a/app/views/request_mailer/external_response.rhtml
+++ /dev/null
@@ -1 +0,0 @@
-<%=@body%>
diff --git a/app/views/request_mailer/external_response.text.erb b/app/views/request_mailer/external_response.text.erb
new file mode 100644
index 000000000..fab256adf
--- /dev/null
+++ b/app/views/request_mailer/external_response.text.erb
@@ -0,0 +1 @@
+<%= @message_body %>
diff --git a/app/views/request_mailer/fake_response.rhtml b/app/views/request_mailer/fake_response.rhtml
deleted file mode 100644
index e9858f03f..000000000
--- a/app/views/request_mailer/fake_response.rhtml
+++ /dev/null
@@ -1 +0,0 @@
-<%=@body%>
diff --git a/app/views/request_mailer/fake_response.text.erb b/app/views/request_mailer/fake_response.text.erb
new file mode 100644
index 000000000..fab256adf
--- /dev/null
+++ b/app/views/request_mailer/fake_response.text.erb
@@ -0,0 +1 @@
+<%= @message_body %>
diff --git a/app/views/request_mailer/new_response.rhtml b/app/views/request_mailer/new_response.text.erb
index 083f873b4..672212f20 100644
--- a/app/views/request_mailer/new_response.rhtml
+++ b/app/views/request_mailer/new_response.text.erb
@@ -1,6 +1,6 @@
<%= _('You have a new response to the {{law_used_full}} request ',:law_used_full=>@info_request.law_used_full)%>
-'<%= @info_request.title %>' <%=_('that you made to')%>
-<%= @info_request.public_body.name %>.
+'<%= raw @info_request.title %>' <%=_('that you made to')%>
+<%= raw @info_request.public_body.name %>.
<%= _('To view the response, click on the link below.')%>
diff --git a/app/views/request_mailer/new_response_reminder_alert.rhtml b/app/views/request_mailer/new_response_reminder_alert.text.erb
index 86fc71de7..c196dafe6 100644
--- a/app/views/request_mailer/new_response_reminder_alert.rhtml
+++ b/app/views/request_mailer/new_response_reminder_alert.text.erb
@@ -3,7 +3,7 @@
<%=@url%>
<%= _('Your request was called {{info_request}}. Letting everyone know whether you got the information will help us keep tabs on',:info_request=>@info_request.title)%>
-<%= @info_request.public_body.name %>.
+<%= raw @info_request.public_body.name %>.
-- <%= _('the {{site_name}} team', :site_name=>site_name) %>
diff --git a/app/views/request_mailer/not_clarified_alert.rhtml b/app/views/request_mailer/not_clarified_alert.text.erb
index 2408452b3..2408452b3 100644
--- a/app/views/request_mailer/not_clarified_alert.rhtml
+++ b/app/views/request_mailer/not_clarified_alert.text.erb
diff --git a/app/views/request_mailer/old_unclassified_updated.rhtml b/app/views/request_mailer/old_unclassified_updated.text.erb
index 5b8534832..5b8534832 100644
--- a/app/views/request_mailer/old_unclassified_updated.rhtml
+++ b/app/views/request_mailer/old_unclassified_updated.text.erb
diff --git a/app/views/request_mailer/overdue_alert.rhtml b/app/views/request_mailer/overdue_alert.text.erb
index b8a9ba525..249bf6bb8 100644
--- a/app/views/request_mailer/overdue_alert.rhtml
+++ b/app/views/request_mailer/overdue_alert.text.erb
@@ -1,4 +1,4 @@
-<%= @info_request.public_body.name %> <%= _('have delayed.')%>
+<%= raw @info_request.public_body.name %> <%= _('have delayed.')%>
<%= _('They have not replied to your {{law_used_short}} request {{title}} promptly, as normally required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%=_('during term time')%> <% end %>.
diff --git a/app/views/request_mailer/requires_admin.rhtml b/app/views/request_mailer/requires_admin.text.erb
index 06a798792..b2e58295e 100644
--- a/app/views/request_mailer/requires_admin.rhtml
+++ b/app/views/request_mailer/requires_admin.text.erb
@@ -1,9 +1,11 @@
+<%= raw @message %>
+
---------------------------------------------------------------------
-<%=@reported_by.name%> <%= _('has reported an')%> <%=@info_request.law_used_short%>
+<%= raw @reported_by.name %> <%= _('has reported an')%> <%= raw @info_request.law_used_short %>
<%= _('response as needing administrator attention. Take a look, and reply to this
email to let them know what you are going to do about it.')%>
-Request '<%=@info_request.title%>':
+Request '<%= raw @info_request.title %>':
<%= @url %>
<%= _('Administration URL:') %>
diff --git a/app/views/request_mailer/stopped_responses.rhtml b/app/views/request_mailer/stopped_responses.text.erb
index 9cd156860..9cd156860 100644
--- a/app/views/request_mailer/stopped_responses.rhtml
+++ b/app/views/request_mailer/stopped_responses.text.erb
diff --git a/app/views/request_mailer/very_overdue_alert.rhtml b/app/views/request_mailer/very_overdue_alert.text.erb
index 6abd198a0..80597473c 100644
--- a/app/views/request_mailer/very_overdue_alert.rhtml
+++ b/app/views/request_mailer/very_overdue_alert.text.erb
@@ -1,4 +1,4 @@
-<%= @info_request.public_body.name %> <%= _('are long overdue.')%>
+<%= raw @info_request.public_body.name %> <%= _('are long overdue.')%>
<%= _('They have not replied to your {{law_used_short}} request {{title}},
as required by law',:law_used_short=>@info_request.law_used_short,:title=>@info_request.title)%><% if @info_request.public_body.is_school? %> <%= _('even during holidays')%><% end %>.
diff --git a/app/views/track/_tracking_links.rhtml b/app/views/track/_tracking_links.html.erb
index 06e87ac74..5419ec605 100644
--- a/app/views/track/_tracking_links.rhtml
+++ b/app/views/track/_tracking_links.html.erb
@@ -1,6 +1,6 @@
<%
if @user
- existing_track = TrackThing.find_by_existing_track(@user, track_thing)
+ existing_track = TrackThing.find_existing(@user, track_thing)
end
%>
@@ -9,20 +9,20 @@
<% elsif existing_track %>
<p><%= track_thing.params[:verb_on_page_already] %></p>
<div class="feed_link feed_link_<%=location%>">
- <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.request_uri}, :class => "link_button_green" %>
+ <%= link_to _("Unsubscribe"), {:controller => 'track', :action => 'update', :track_id => existing_track.id, :track_medium => "delete", :r => request.fullpath}, :class => "link_button_green" %>
</div>
<% elsif track_thing %>
<div class="feed_link feed_link_<%=location%>">
<% if defined? follower_count && follower_count > 0 %>
- <%= link_to _("I like this request"), do_track_url(track_thing), :class => "link_button_green" %>
+ <%= link_to _("I like this request"), do_track_path(track_thing), :class => "link_button_green" %>
<% else %>
- <%= link_to _("Follow"), do_track_url(track_thing), :class => "link_button_green" %>
+ <%= link_to _("Follow"), do_track_path(track_thing), :class => "link_button_green" %>
<% end %>
</div>
<div class="feed_link feed_link_<%=location%>">
- <%= link_to '<img src="/images/feed-16.png" alt="">'.html_safe, do_track_url(track_thing, 'feed') %>
- <%= link_to (location == 'sidebar' ? _('RSS feed of updates') : _('RSS feed')), do_track_url(track_thing, 'feed') %>
+ <%= 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/track/atom_feed.atom.erb b/app/views/track/atom_feed.atom.erb
index 23c932308..be9c39e72 100644
--- a/app/views/track/atom_feed.atom.erb
+++ b/app/views/track/atom_feed.atom.erb
@@ -9,7 +9,7 @@
# Get the HTML content from the same partial template as website search does
content = ''
if result[:model].class.to_s == 'InfoRequestEvent'
- content += render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request }
+ content += render :partial => 'request/request_listing_via_event', :formats => ['html'], :locals => { :event => result[:model], :info_request => result[:model].info_request }
else
content = "<p><strong>Unknown search result type " + result[:model].class.to_s + "</strong></p>"
end
diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.text.erb
index dc8132b99..8dbc7fe06 100644
--- a/app/views/track_mailer/event_digest.rhtml
+++ b/app/views/track_mailer/event_digest.text.erb
@@ -17,17 +17,17 @@
# e.g. Julian Burgess sent a request to Royal Mail Group (15 May 2008)
if event.event_type == 'response'
- url = main_url(incoming_message_url(event.incoming_message))
+ url = incoming_message_url(event.incoming_message)
main_text += _("{{public_body}} sent a response to {{user_name}}", :public_body => event.info_request.public_body.name, :user_name => event.info_request.user_name)
elsif event.event_type == 'followup_sent'
- url = main_url(outgoing_message_url(event.outgoing_message))
+ url = outgoing_message_url(event.outgoing_message)
main_text += _("{{user_name}} sent a follow up message to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'sent'
# this is unlikely to happen in real life, but happens in the test code
- url = main_url(outgoing_message_url(event.outgoing_message))
+ url = outgoing_message_url(event.outgoing_message)
main_text += _("{{user_name}} sent a request to {{public_body}}", :user_name => event.info_request.user_name, :public_body => event.info_request.public_body.name)
elsif event.event_type == 'comment'
- url = main_url(comment_url(event.comment))
+ url = comment_url(event.comment)
main_text += _("{{user_name}} added an annotation", :user_name => event.comment.user.name)
else
raise "unknown type in event_digest " + event.event_type
diff --git a/app/views/user/_change_receive_email.rhtml b/app/views/user/_change_receive_email.html.erb
index 83e5d8601..12824f711 100644
--- a/app/views/user/_change_receive_email.rhtml
+++ b/app/views/user/_change_receive_email.html.erb
@@ -1,4 +1,4 @@
-<% form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %>
+<%= form_tag(:controller=>"user", :action=>"set_receive_email_alerts") do %>
<div>
<% if @user.receive_email_alerts %>
<%= _('You are currently receiving notification of new activity on your wall by email.', :wall_url => show_user_wall_path) %><br><br>
diff --git a/app/views/user/_show_user_info.rhtml b/app/views/user/_show_user_info.html.erb
index 3c229e9ce..9182f0733 100644
--- a/app/views/user/_show_user_info.rhtml
+++ b/app/views/user/_show_user_info.html.erb
@@ -1,10 +1,10 @@
<% if !@display_user.get_about_me_for_html_display.empty? || @is_you %>
<div class="user_about_me">
- <img class="comment_quote" src="/images/quote-marks.png" alt="">
+ <%= image_tag "quote-marks.png", :class => "comment_quote" %>
<%= @display_user.get_about_me_for_html_display %>
<% if @is_you %>
- (<%= link_to _("edit text about you"), set_profile_about_me_url() %>)
+ (<%= link_to _("edit text about you"), set_profile_about_me_path %>)
<% end %>
</div>
<% end %>
@@ -12,9 +12,9 @@
<% if @is_you %>
<p id="user_change_password_email">
<% if @display_user.profile_photo %>
- <%= link_to _('Change profile photo'), set_profile_photo_url() %> |
+ <%= link_to _('Change profile photo'), set_profile_photo_path %> |
<% end %>
- <%= link_to _('Change your password'), signchangepassword_url() %> |
- <%= link_to _('Change your email'), signchangeemail_url() %>
+ <%= link_to _('Change your password'), signchangepassword_path %> |
+ <%= link_to _('Change your email'), signchangeemail_path %>
</p>
<% end %>
diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.html.erb
index c4d917991..afc55d249 100644
--- a/app/views/user/_signin.rhtml
+++ b/app/views/user/_signin.html.erb
@@ -1,6 +1,6 @@
<div id="signin">
-<% form_tag({:action => "signin"}, {:id => "signin_form"}) do %>
+<%= form_tag({:action => "signin"}, {:id => "signin_form"}) do %>
<%= foi_error_messages_for :user_signin %>
<!--<% if not sign_in_as_existing_user %>
@@ -18,7 +18,7 @@
</p>
<p class="form_note">
- <%= link_to _('Forgotten your password?'), signchangepassword_url + "?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/_signup.rhtml b/app/views/user/_signup.html.erb
index 913423ffa..ec6541881 100644
--- a/app/views/user/_signup.rhtml
+++ b/app/views/user/_signup.html.erb
@@ -1,6 +1,6 @@
<div id="signup">
-<% form_tag({:action => "signup"}, {:id => "signup_form"}) do %>
+<%= form_tag({:action => "signup"}, {:id => "signup_form"}) do %>
<%= foi_error_messages_for :user_signup %>
<!--<h2><%= _('If you\'re new to {{site_name}}', :site_name=>site_name)%></h2>-->
@@ -10,30 +10,30 @@
<%= text_field 'user_signup', 'email', { :size => 20, :tabindex => 60 } %>
</p>
<div class="form_item_note">
- <%= raw(_('We will not reveal your email address to anybody unless you or
- the law tell us to (<a href="%s">details</a>). ') %[help_privacy_path]) %>
+ <%= _('We will not reveal your email address to anybody unless you or
+ the law tell us to (<a href="{{url}}">details</a>). ', :url => help_privacy_path) %>
</div>
<p>
<label class="form_label" for="user_signup_name"> <%= _('Your name:')%></label>
- <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70 } %>
+ <%= text_field 'user_signup', 'name', { :size => 20, :tabindex => 70, :autocomplete => "off" } %>
</p>
<div class="form_item_note">
- <%= raw(_('Your <strong>name will appear publicly</strong>
- (<a href="%s">why?</a>)
+ <%= _('Your <strong>name will appear publicly</strong>
+ (<a href="{{why_url}}">why?</a>)
on this website and in search engines. If you
- are thinking of using a pseudonym, please
- <a href="%s">read this first</a>.') % [help_privacy_path+"#public_request", help_privacy_path+"#real_name"]) %>
+ are thinking of using a pseudonym, please
+ <a href="{{help_url}}">read this first</a>.', :why_url => (help_privacy_path+"#public_request").html_safe, :help_url => (help_privacy_path+"#real_name").html_safe) %>
</div>
<p>
<label class="form_label" for="user_signup_password"> <%= _('Password:')%></label>
- <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80 } %>
+ <%= password_field 'user_signup', 'password', { :size => 15, :tabindex => 80, :autocomplete => "off" } %>
</p>
<p>
<label class="form_label" for="user_signup_password_confirmation"> <%= _('Password: (again)')%></label>
- <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90 } %>
+ <%= password_field 'user_signup', 'password_confirmation', { :size => 15, :tabindex => 90, :autocomplete => "off" } %>
</p>
<% if @request_from_foreign_country %>
diff --git a/app/views/user/_user_listing_single.rhtml b/app/views/user/_user_listing_single.html.erb
index 53df3a7e8..ed1b95718 100644
--- a/app/views/user/_user_listing_single.rhtml
+++ b/app/views/user/_user_listing_single.html.erb
@@ -5,14 +5,14 @@ end %>
<div class="user_listing">
<% if display_user.profile_photo %>
<div class="user_photo_on_search">
- <a href="<%=user_url(display_user)%>">
+ <a href="<%=user_path(display_user)%>">
<img src="<%= get_profile_photo_url(:url_name => display_user.url_name) %>" alt="">
</a>
</div>
<% end %>
<span class="head <% if display_user.profile_photo %>no_icon<% end %>">
- <%= link_to highlight_words(display_user.name, @highlight_words), user_url(display_user) %>
+ <%= link_to highlight_words(display_user.name, @highlight_words), user_path(display_user) %>
</span>
<span class="bottomline">
diff --git a/app/views/user/bad_token.rhtml b/app/views/user/bad_token.html.erb
index 538bc5606..538bc5606 100644
--- a/app/views/user/bad_token.rhtml
+++ b/app/views/user/bad_token.html.erb
diff --git a/app/views/user/banned.rhtml b/app/views/user/banned.html.erb
index 475c10977..475c10977 100644
--- a/app/views/user/banned.rhtml
+++ b/app/views/user/banned.html.erb
diff --git a/app/views/user/confirm.rhtml b/app/views/user/confirm.html.erb
index bc70a1f36..bc70a1f36 100644
--- a/app/views/user/confirm.rhtml
+++ b/app/views/user/confirm.html.erb
diff --git a/app/views/user/contact.rhtml b/app/views/user/contact.html.erb
index 333b72334..6d23dd1ed 100644
--- a/app/views/user/contact.rhtml
+++ b/app/views/user/contact.html.erb
@@ -6,7 +6,7 @@
<%= foi_error_messages_for :contact %>
-<% form_for :contact do |f| %>
+<%= form_for :contact do |f| %>
<div class="form_note">
<h1><%= _("Contact {{recipient}}", :recipient => h(@recipient_user.name)) %></h1>
diff --git a/app/views/user/no_cookies.rhtml b/app/views/user/no_cookies.html.erb
index c291367f2..0a4a39b1b 100644
--- a/app/views/user/no_cookies.rhtml
+++ b/app/views/user/no_cookies.html.erb
@@ -12,11 +12,11 @@ browser. Then press refresh to have another go.')%></p>
<p><%= _('If your browser is set to accept cookies and you are seeing this message,
then there is probably a fault with our server.')%>
-<%= raw(_('Please <a href="%s">get in touch</a> with us so we can fix it.') % [help_contact_path]) %>
+<%= _('Please <a href="{{url}}">get in touch</a> with us so we can fix it.', :url => help_contact_path.html_safe) %>
<%= _('Let us know what you were doing when this message
appeared and your browser and operating system type and version.')%></p>
-<p><%= raw(_('If you are still having trouble, please <a href="%s">contact us</a>.') % [help_contact_path]) %>
+<p><%= _('If you are still having trouble, please <a href="{{url}}">contact us</a>.', :url => help_contact_path.html_safe) %>
</p>
diff --git a/app/views/user/rate_limited.rhtml b/app/views/user/rate_limited.html.erb
index d52deebab..54a4e0461 100644
--- a/app/views/user/rate_limited.rhtml
+++ b/app/views/user/rate_limited.html.erb
@@ -2,7 +2,7 @@
<h1><%=@title%></h1>
-<p><%= _("You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}.", :max_requests_per_user_per_day => Configuration::max_requests_per_user_per_day, :can_make_another_request => distance_of_time_in_words(Time.now, @next_request_permitted_at))%></p>
+<p><%= _("You have hit the rate limit on new requests. Users are ordinarily limited to {{max_requests_per_user_per_day}} requests in any rolling 24-hour period. You will be able to make another request in {{can_make_another_request}}.", :max_requests_per_user_per_day => AlaveteliConfiguration::max_requests_per_user_per_day, :can_make_another_request => distance_of_time_in_words(Time.now, @next_request_permitted_at))%></p>
<p><%= _("There is a limit on the number of requests you can make in a day, because we don’t want public authorities to be bombarded with large numbers of inappropriate requests. If you feel you have a good reason to ask for the limit to be lifted in your case, please <a href='{{help_contact_path}}'>get in touch</a>.", :help_contact_path => help_contact_path) %></p>
diff --git a/app/views/user/river.rhtml b/app/views/user/river.html.erb
index 9618e0aa8..9618e0aa8 100644
--- a/app/views/user/river.rhtml
+++ b/app/views/user/river.html.erb
diff --git a/app/views/user/set_crop_profile_photo.rhtml b/app/views/user/set_crop_profile_photo.html.erb
index eed0304d2..0a22d36dc 100644
--- a/app/views/user/set_crop_profile_photo.rhtml
+++ b/app/views/user/set_crop_profile_photo.html.erb
@@ -9,7 +9,7 @@
<div id="set_crop_profile_photo">
-<% form_tag 'set_photo', :id => 'set_crop_profile_photo_form', :multipart => true do %>
+<%= form_tag 'set_photo', :id => 'set_crop_profile_photo_form', :multipart => true do %>
<table>
<tr>
@@ -37,7 +37,7 @@
<p>
<%= hidden_field_tag 'submitted_crop_profile_photo', 1 %>
- <%= submit_tag _("Done") + " &gt;&gt;" %>
+ <%= submit_tag _("Done &gt;&gt;") %>
</p>
<% end %>
diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.html.erb
index b3faba7fc..b4bdd80f3 100644
--- a/app/views/user/set_draft_profile_photo.rhtml
+++ b/app/views/user/set_draft_profile_photo.html.erb
@@ -8,7 +8,7 @@
<div id="set_draft_profile_photo">
-<% form_tag 'set_photo', :id => 'set_draft_profile_photo_form', :multipart => true do %>
+<%= form_tag 'set_photo', :id => 'set_draft_profile_photo_form', :multipart => true do %>
<p>
<label class="form_label" for="file_1"><%= _('Photo of you:')%></label>
<%= file_field_tag :file, :size => 35, :id => 'file_1' %>
@@ -45,14 +45,14 @@
<h2><%= _('OR remove the existing photo')%></h2>
- <% form_tag 'clear_photo', :id => 'clear_profile_photo_form', :multipart => true do %>
+ <%= form_tag 'clear_photo', :id => 'clear_profile_photo_form', :multipart => true do %>
<%= submit_tag _("Clear photo") %>
<% end %>
<% end %>
<p>
- <%= link_to _("Cancel, return to your profile page"), user_url(@user) %>
+ <%= link_to _("Cancel, return to your profile page"), user_path(@user) %>
</p>
</div>
diff --git a/app/views/user/set_profile_about_me.rhtml b/app/views/user/set_profile_about_me.html.erb
index 4fe1047da..fb7de7e97 100644
--- a/app/views/user/set_profile_about_me.rhtml
+++ b/app/views/user/set_profile_about_me.html.erb
@@ -4,7 +4,7 @@
<%= foi_error_messages_for :about_me %>
-<% form_for :about_me do |f| %>
+<%= form_for :about_me do |f| %>
<div class="form_note">
<h1><%= _('Edit text about you')%></h1>
<p>
@@ -26,7 +26,7 @@
<%= _(' Include relevant links, such as to a campaign page, your blog or a
twitter account. They will be made clickable.
e.g.')%>
- <a href="https://twitter.com/<%= Configuration::twitter_username %>">https://twitter.com/<%= Configuration::twitter_username %></a>
+ <a href="https://twitter.com/<%= AlaveteliConfiguration::twitter_username %>">https://twitter.com/<%= AlaveteliConfiguration::twitter_username %></a>
</p>
</div>
diff --git a/app/views/user/show.rhtml b/app/views/user/show.html.erb
index 31ea2a70b..76ecdeda0 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.html.erb
@@ -55,7 +55,7 @@
<% else %>
<% if @is_you %>
<span id="set_photo">
- <%= link_to _('Set your profile photo'), set_profile_photo_url() %>
+ <%= link_to _('Set your profile photo'), set_profile_photo_path %>
</span>
<% end %>
<% end %>
@@ -66,12 +66,12 @@
<p class="subtitle">
<%= _('Joined {{site_name}} in', :site_name=>site_name) %> <%= year_from_date(@display_user.created_at) %>
<% if !@user.nil? && @user.admin_page_links? %>
- (<%= link_to "admin", user_admin_url(@display_user) %>)
+ (<%= link_to "admin", admin_user_show_path(@display_user) %>)
<% end %>
</p>
<p>
- <%= link_to _('Send message to ') + h(@display_user.name), contact_user_url(:id => @display_user.id) %>
+ <%= link_to _('Send message to ') + h(@display_user.name), contact_user_path(:id => @display_user.id) %>
<% if @is_you %>
(<%= _('just to see how it works')%>)
<% end %>
@@ -97,7 +97,7 @@
<% if not @is_you %>
<p id="user_not_logged_in">
- <%= raw(_('<a href="%s">Sign in</a> to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name)) % [signin_url(:r => request.request_uri)]) %>
+ <%= _('<a href="{{url}}">Sign in</a> to change password, subscriptions and more ({{user_name}} only)',:user_name=>h(@display_user.name), :url => signin_url(:r => request.fullpath).html_safe) %>
</p>
<% end %>
</div>
@@ -105,11 +105,22 @@
<div style="clear:both"></div>
<% end %>
+<% if @show_batches %>
+
+ <% if @is_you && !@display_user.info_request_batches.empty? %>
+ <h2 class="batch_results" id="batch_requests">
+ <%= n_('Your {{count}} batch requests', 'Your {{count}} batch requests', @display_user.info_request_batches.size, :count => @display_user.info_request_batches.size) %>
+ </h2>
+ <%= render :partial => 'info_request_batch/info_request_batch', :collection => @display_user.info_request_batches %>
+ <% end %>
+
+<% end %>
+
<% if @show_requests %>
<div id="user_profile_search">
- <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %>
+ <%= form_tag(show_user_url, :method => "get", :id=>"search_form") do %>
<div>
- <%= text_field_tag(:user_query, params[:user_query]) %>
+ <%= text_field_tag(:user_query, params[:user_query], {:title => "type your search term here" }) %>
<% if @is_you %>
<%= submit_tag(_("Search your contributions")) %>
<% else %>
@@ -128,7 +139,7 @@
<% 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.matches_estimated) % @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) % @xapian_requests.matches_estimated %>
+ <%= @is_you ? n_('Your {{count}} Freedom of Information request', 'Your {{count}} Freedom of Information requests', @xapian_requests.matches_estimated, :count => @xapian_requests.matches_estimated) : n_("This person's {{count}} Freedom of Information request", "This person's {{count}} Freedom of Information requests", @xapian_requests.matches_estimated, :count => @xapian_requests.matches_estimated) %>
<!-- matches_estimated <%=@xapian_requests.matches_estimated%> -->
<%= @match_phrase %>
<%= @page_desc %>
@@ -158,7 +169,7 @@
<% end %>
<% else %>
<h2 id="annotations">
- <%= @is_you ? n_('Your %d annotation', 'Your %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size : n_('This person\'s %d annotation', 'This person\'s %d annotations', @display_user.visible_comments.size) % @display_user.visible_comments.size %>
+ <%= @is_you ? n_('Your {{count}} annotation', 'Your {{count}} annotations', @display_user.visible_comments.size, :count => @display_user.visible_comments.size) : n_("This person's {{count}} annotation", "This person's {{count}} annotations", @display_user.visible_comments.size, :count => @display_user.visible_comments.size) %>
<!-- matches_estimated <%=@xapian_comments.matches_estimated%> -->
<%= @page_desc %>
</h2>
@@ -181,12 +192,12 @@
<p><%= _("You're not following anything.")%></p>
<% else %>
<% if @track_things_grouped.size == 1 %>
- <% form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>
+ <%= form_tag({:controller => 'track', :action => 'delete_all_type'}, :class => "feed_form") do %>
<h3>
<%=TrackThing.track_type_description(@track_things[0].track_type)%>
<%= hidden_field_tag 'track_type', @track_things[0].track_type %>
<%= hidden_field_tag 'user', @display_user.id %>
- <%= hidden_field_tag 'r', request.request_uri %>
+ <%= hidden_field_tag 'r', request.fullpath %>
<% if @track_things.size > 1 %>
<%= submit_tag _('unsubscribe all') %>
<% end %>
@@ -195,12 +206,12 @@
<% 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 %>
+ <%= 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 %>
+ <%= hidden_field_tag 'r', request.fullpath %>
<% if track_things.size > 1 %>
<%= submit_tag _('unsubscribe all')%>
<% end %>
@@ -211,11 +222,11 @@
<ul>
<% for track_thing in track_things %>
<li>
- <% form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %>
+ <%= form_tag({:controller => 'track', :action => 'update', :track_id => track_thing.id}, :class => "feed_form") do %>
<div>
<%= track_thing.params[:list_description] %>
<%= hidden_field_tag 'track_medium', "delete", { :id => 'track_medium_' + track_thing.id.to_s } %>
- <%= hidden_field_tag 'r', request.request_uri, { :id => 'r_' + track_thing.id.to_s } %>
+ <%= hidden_field_tag 'r', request.fullpath, { :id => 'r_' + track_thing.id.to_s } %>
<%= submit_tag _('unsubscribe') %>
</div>
<% end %>
diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.html.erb
index 6a1979155..e8c5d5a58 100644
--- a/app/views/user/sign.rhtml
+++ b/app/views/user/sign.html.erb
@@ -12,7 +12,9 @@
<% end %>
</p>
<% if @post_redirect.post_params["controller"] == "admin_general" %>
- <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>
+ <% 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 } %>
diff --git a/app/views/user/signchangeemail.rhtml b/app/views/user/signchangeemail.html.erb
index 0f8b76bc5..7308179f4 100644
--- a/app/views/user/signchangeemail.rhtml
+++ b/app/views/user/signchangeemail.html.erb
@@ -4,7 +4,7 @@
<div id="change_email">
-<% form_tag({:action => "signchangeemail"}, {:id => "signchangeemail_form"}) do %>
+<%= form_tag({:action => "signchangeemail"}, {:id => "signchangeemail_form"}) do %>
<%= foi_error_messages_for :signchangeemail %>
<div class="form_note">
diff --git a/app/views/user/signchangeemail_confirm.rhtml b/app/views/user/signchangeemail_confirm.html.erb
index bfedbac2d..bfedbac2d 100644
--- a/app/views/user/signchangeemail_confirm.rhtml
+++ b/app/views/user/signchangeemail_confirm.html.erb
diff --git a/app/views/user/signchangepassword.rhtml b/app/views/user/signchangepassword.html.erb
index edb980b9f..51bcb466d 100644
--- a/app/views/user/signchangepassword.rhtml
+++ b/app/views/user/signchangepassword.html.erb
@@ -4,7 +4,7 @@
<div id="change_password">
-<% form_tag({:action => "signchangepassword"}, {:id => "signchangepassword_form"}) do %>
+<%= form_tag({:action => "signchangepassword"}, {:id => "signchangepassword_form"}) do %>
<%= foi_error_messages_for :user %>
<div class="form_note">
diff --git a/app/views/user/signchangepassword_confirm.rhtml b/app/views/user/signchangepassword_confirm.html.erb
index 63b6515cd..63b6515cd 100644
--- a/app/views/user/signchangepassword_confirm.rhtml
+++ b/app/views/user/signchangepassword_confirm.html.erb
diff --git a/app/views/user/signchangepassword_send_confirm.rhtml b/app/views/user/signchangepassword_send_confirm.html.erb
index 84ee28f07..850237c34 100644
--- a/app/views/user/signchangepassword_send_confirm.rhtml
+++ b/app/views/user/signchangepassword_send_confirm.html.erb
@@ -2,7 +2,7 @@
<div id="change_password">
-<% form_tag({:action => "signchangepassword"}, {:id => "signchangepassword_form"}) do %>
+<%= form_tag({:action => "signchangepassword"}, {:id => "signchangepassword_form"}) do %>
<%= foi_error_messages_for :signchangepassword %>
<div class="form_note">
diff --git a/app/views/user/signin_successful.rhtml b/app/views/user/signin_successful.html.erb
index 675701d74..675701d74 100644
--- a/app/views/user/signin_successful.rhtml
+++ b/app/views/user/signin_successful.html.erb
diff --git a/app/views/user/wall.html.erb b/app/views/user/wall.html.erb
new file mode 100644
index 000000000..6699c55fa
--- /dev/null
+++ b/app/views/user/wall.html.erb
@@ -0,0 +1,19 @@
+<% @title = h(@display_user.name) + _(" - wall") %>
+<div class="medium_column">
+ <% if @is_you %>
+ <h2><%= _("My wall") %></h2>
+ <p><%= _('You can change the requests and users you are following on <a href="{{profile_url}}">your profile page</a>.', :profile_url => show_user_profile_path) %></p>
+ <%= render :partial => 'change_receive_email' %>
+ <% else %>
+ <h2><%= _("This is <a href=\"{{profile_url}}\">{{user_name}}'s</a> wall", :profile_url => show_user_profile_path, :user_name => h(@display_user.name)) %></h2>
+ <% end %>
+</div>
+<div id="user_profile_search">
+ <% if !@feed_results.nil? and !@feed_results.empty? %>
+ <% for result in @feed_results %>
+ <%= render :partial => 'request/wall_listing', :locals => { :event => result, :info_request => result.info_request } %>
+ <% end %>
+ <% else %>
+ <p><%= _("There is nothing to display yet.") %></p>
+ <% end %>
+</div>
diff --git a/app/views/user/wall.rhtml b/app/views/user/wall.rhtml
deleted file mode 100644
index 190cc0a6d..000000000
--- a/app/views/user/wall.rhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-<% @title = h(@display_user.name) + _(" - wall") %>
-<% if @is_you %>
-<div class="medium_column">
- <p><%= _('You can change the requests and users you are following on <a href="{{profile_url}}">your profile page</a>.', :profile_url => show_user_profile_path) %>
- <%= render :partial => 'change_receive_email' %>
-</div>
-<% end %>
-<div id="user_profile_search">
- <% if !@feed_results.nil? %>
- <% for result in @feed_results %>
- <%= render :partial => 'request/wall_listing', :locals => { :event => result, :info_request => result.info_request } %>
- <% end %>
- <% end %>
-
-
-</div>
diff --git a/app/views/user/wrong_user.rhtml b/app/views/user/wrong_user.html.erb
index 30256a639..30256a639 100644
--- a/app/views/user/wrong_user.rhtml
+++ b/app/views/user/wrong_user.html.erb
diff --git a/app/views/user/wrong_user_unknown_email.html.erb b/app/views/user/wrong_user_unknown_email.html.erb
new file mode 100644
index 000000000..c1967fc1f
--- /dev/null
+++ b/app/views/user/wrong_user_unknown_email.html.erb
@@ -0,0 +1,8 @@
+
+<p id="sign_in_reason">
+<%= @reason_params[:web] %>. <%= _('Unfortunately we don\'t know the FOI
+email address for that authority, so we can\'t validate this.
+Please <a href="{{url}}">contact us</a> to sort it out.', :url => help_contact_path.html_safe) %>
+</p>
+
+
diff --git a/app/views/user/wrong_user_unknown_email.rhtml b/app/views/user/wrong_user_unknown_email.rhtml
deleted file mode 100644
index c59c56941..000000000
--- a/app/views/user/wrong_user_unknown_email.rhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-<p id="sign_in_reason">
-<%= @reason_params[:web] %>. <%= raw(_('Unfortunately we don\'t know the FOI
-email address for that authority, so we can\'t validate this.
-Please <a href="%s">contact us</a> to sort it out.') % [help_contact_path]) %>
-</p>
-
-
diff --git a/app/views/user_mailer/already_registered.rhtml b/app/views/user_mailer/already_registered.text.erb
index 59ffcbf94..32c2c7e63 100644
--- a/app/views/user_mailer/already_registered.rhtml
+++ b/app/views/user_mailer/already_registered.text.erb
@@ -1,10 +1,10 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('You just tried to sign up to {{site_name}}, when you
already have an account. Your name and password have been
left as they previously were.
-Please click on the link below.', :site_name=>site_name)%> <%=@reasons[:email]%>
+Please click on the link below.', :site_name=>site_name)%> <%=raw @reasons[:email] %>
<%=@url%>
diff --git a/app/views/user_mailer/changeemail_already_used.rhtml b/app/views/user_mailer/changeemail_already_used.text.erb
index 1d74dda35..1d74dda35 100644
--- a/app/views/user_mailer/changeemail_already_used.rhtml
+++ b/app/views/user_mailer/changeemail_already_used.text.erb
diff --git a/app/views/user_mailer/changeemail_confirm.rhtml b/app/views/user_mailer/changeemail_confirm.text.erb
index ffb9737f7..c73e9486b 100644
--- a/app/views/user_mailer/changeemail_confirm.rhtml
+++ b/app/views/user_mailer/changeemail_confirm.text.erb
@@ -1,4 +1,4 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('Please click on the link below to confirm that you want to
change the email address that you use for {{site_name}}
diff --git a/app/views/user_mailer/confirm_login.rhtml b/app/views/user_mailer/confirm_login.text.erb
index 6f4feff00..fa86dc2b1 100644
--- a/app/views/user_mailer/confirm_login.rhtml
+++ b/app/views/user_mailer/confirm_login.text.erb
@@ -1,7 +1,7 @@
-<%= @name %>,
+<%= raw @name %>,
<%= _('Please click on the link below to confirm your email address.')%>
-<%=@reasons[:email]%>
+<%= raw @reasons[:email] %>
<%=@url%>