diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin_public_body/_form.rhtml | 20 | ||||
-rw-r--r-- | app/views/general/_credits.rhtml | 2 | ||||
-rw-r--r-- | app/views/general/_frontpage_intro_sentence.rhtml | 7 | ||||
-rw-r--r-- | app/views/general/blog.rhtml | 2 | ||||
-rw-r--r-- | app/views/general/frontpage.rhtml | 70 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 21 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 4 | ||||
-rw-r--r-- | app/views/request/_next_actions.rhtml | 1 | ||||
-rw-r--r-- | app/views/request/_sidebar.rhtml | 23 | ||||
-rw-r--r-- | app/views/track_mailer/event_digest.rhtml | 12 | ||||
-rw-r--r-- | app/views/user/show.rhtml | 28 | ||||
-rw-r--r-- | app/views/user/sign.rhtml | 2 |
12 files changed, 106 insertions, 86 deletions
diff --git a/app/views/admin_public_body/_form.rhtml b/app/views/admin_public_body/_form.rhtml index 191b29e89..6a9013071 100644 --- a/app/views/admin_public_body/_form.rhtml +++ b/app/views/admin_public_body/_form.rhtml @@ -26,20 +26,20 @@ <div id="div-locale-<%=locale.to_s%>"> <%= t.hidden_field :locale, :value => locale.to_s %> - <p><label for="public_body_name">Name</label><br/> - <%= t.text_field :name, :size => 60 %></p> + <p><label for="<%= form_tag_id(t.object_name, :name) %>">Name</label><br/> + <%= t.text_field :name, :size => 60, :id => form_tag_id(t.object_name, :name) %></p> - <p><label for="public_body_short_name">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 %></p> + <p><label for="<%= form_tag_id(t.object_name, :short_name) %>">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) %></p> - <p><label for="public_body_request_email">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 %></p> + <p><label for="<%= form_tag_id(t.object_name, :request_email) %>">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) %></p> - <p><label for="public_body_publication_scheme">Publication scheme URL</label><br/> - <%= t.text_field :publication_scheme, :size => 60 %></p> + <p><label for="<%= form_tag_id(t.object_name, :publication_scheme) %>">Publication scheme URL</label><br/> + <%= t.text_field :publication_scheme, :size => 60, :id => form_tag_id(t.object_name, :publication_scheme) %></p> - <p><label for="public_body_notes">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 %></p> + <p><label for="<%= form_tag_id(t.object_name, :notes) %>">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) %></p> </div> <% end diff --git a/app/views/general/_credits.rhtml b/app/views/general/_credits.rhtml index 8c519ce7e..b1a9ce05e 100644 --- a/app/views/general/_credits.rhtml +++ b/app/views/general/_credits.rhtml @@ -1 +1 @@ -| <%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>.') %> +| <%= _('Powered by <a href="http://www.alaveteli.org/">Alaveteli</a>') %> diff --git a/app/views/general/_frontpage_intro_sentence.rhtml b/app/views/general/_frontpage_intro_sentence.rhtml index 4e6dbecb3..70b47ad06 100644 --- a/app/views/general/_frontpage_intro_sentence.rhtml +++ b/app/views/general/_frontpage_intro_sentence.rhtml @@ -1,3 +1,4 @@ -<h3>Use your Right to Know</h3> - -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> +<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> diff --git a/app/views/general/blog.rhtml b/app/views/general/blog.rhtml index 4bc23832d..4ff408e52 100644 --- a/app/views/general/blog.rhtml +++ b/app/views/general/blog.rhtml @@ -4,7 +4,7 @@ <div id="right_column"> <div class="act_link"> <h2>Stay up to date</h2> - <img src="/images/twitter-16.png" alt="twitter icon" valign="middle"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a><br/><br/> + <img src="/images/twitter-16.png" alt="twitter icon" class="twitter-icon"> <a href="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>">Follow us on twitter</a><br/><br/> <img src="/images/feed-16.png" alt="RSS icon" valign="middle"> <a href="<%= MySociety::Config.get('BLOG_FEED') %>">Subscribe to blog</a> </div> <div id="twitter"> diff --git a/app/views/general/frontpage.rhtml b/app/views/general/frontpage.rhtml index e1cdaa52e..55b00b753 100644 --- a/app/views/general/frontpage.rhtml +++ b/app/views/general/frontpage.rhtml @@ -1,37 +1,43 @@ <% view_cache :ttl => 5.minutes, :tag => I18n.locale do %> - - - <div class="frontpage-box" id="frontpage-box-1"> - <%= render :partial => 'frontpage_intro_sentence' %> - </div> - - <div class="frontpage-box" id="frontpage-box-2"> - <div id="bighand"> - Make a new <strong>Freedom of Information</strong> request - <br /> - <a href="/select_authority"><img alt="Start-button" src="/images/start-button.png"></a> - </div> - </div> - - <div class="frontpage-box" id="frontpage-box-3"> - <div id="littlehand"> - Search over <strong><%= InfoRequest.count %> requests</strong> and <strong><%= PublicBody.count %> authorities</strong>: - <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> - <%= text_field_tag 'query', params[:query], { :size => 30 } %> - <%= hidden_field_tag 'bodies', 1 %> - <%= image_submit_tag 'button-search.png', :title => 'Search' %> - <br> - <%= render :partial => 'frontpage_search_examples' %> - <% end %> + <div id="frontpage_splash"> + <div id="left_column"> + <h1> + <%= _("Make a new<br/> + <strong>Freedom <span>of</span><br/> + Information<br/> + request</strong>") %> + </h1> + <a class="link_button_green_large" href="/select_authority"><%= _("Start now »") %></a> + </div> + <div id="right_column"> + <div id="frontpage_search_box"> + <h2> + <%= _("Search over<br/> + <strong>{{number_of_requests}} requests</strong> <span>and</span><br/> + <strong>{{number_of_authorities}} authorities</strong>", + :number_of_requests => InfoRequest.count, :number_of_authorities => PublicBody.count) %> + </h2> + <% form_tag({:action => "search_redirect"}, {:id => "search_form"}) do %> + <div> + <%= text_field_tag 'query', params[:query], { :size => 30 } %> + <%= hidden_field_tag 'bodies', 1 %> + <%= submit_tag _('Search') %> + </div> + <% end %> + </div> + <div id="frontpage_right_to_know"> + <%= render :partial => 'frontpage_intro_sentence' %> + </div> </div> + <div style="clear:both"></div> </div> - <div id="frontpage_examples"> <% if @popular_bodies.size > 0 %> <div id="examples_0"> - <h3>Who has the information?</h3> - <%= site_name %> covers requests to <%= PublicBody.count %> authorities, including: + <h3><%= _("Who can I request information from?") %></h3> + <%= _("{{site_name}} covers requests to {{number_of_authorities}} authorities, including:", + :site_name => site_name, :number_of_authorities => PublicBody.count) %> <ul> <% for popular_body in @popular_bodies %> <li><%=public_body_link(popular_body)%> @@ -46,13 +52,13 @@ <% end %> <div id="examples_1"> - <h3>What are people asking?</h3> - <%= site_name %> users have asked <%= InfoRequest.count %> questions. + <h3><%= _("What information has been released?") %></h3> + <%= _("{{site_name}} users have made {{number_of_requests}} requests, including:", + :site_name => site_name, :number_of_requests => InfoRequest.count) %> <ul> - - <% for event in @successful_request_events %> + <% for event in @request_events %> <li> - <%= public_body_link(event.info_request.public_body) %> answered a question about + <%= public_body_link(event.info_request.public_body) %> answered a request about <%=link_to h(event.info_request.title), request_url(event.info_request)%> <%= _('{{length_of_time}} ago', :length_of_time => time_ago_in_words(event.described_at)) %> <p class="excerpt" onclick="document.location.href='<%=request_url(event.info_request)%>'"><%= excerpt(event.info_request.title, "", 200) %></p> diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index f0c5f1576..ba060d33c 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -20,10 +20,11 @@ <% 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 %> <p> - <%= text_field_tag :query, params[:query], { :size => 40 } %> + <%= text_field_tag :query, @query, { :size => 60 } %> <%= hidden_field_tag 'sortby', @inputted_sortby %> <% if @bodies %> <%= hidden_field_tag 'bodies', 1 %> @@ -32,6 +33,7 @@ <%= link_to _('Simple search'), search_redirect_path %> </p> <% end %> + </div> <% else %> <% form_tag(request.url, {:method => "get", :id => "search_form"}) do %> <p> @@ -41,15 +43,18 @@ <%= hidden_field_tag 'bodies', 1 %> <% end %> <%= submit_tag _("Search") %> + <%= link_to(_("Advanced search"), advanced_search_url) %> + + </p> <div id="common-subfilters"> <div id="variety-filter"> <h3 class="title"><%= _("Showing") %></h3> <% labels = [ - ["all", _("everything")], ["requests", _("requests")], ["users", _("users")], - ["bodies", _("authorities")]]%> + ["bodies", _("authorities")], + ["all", _("everything")]]%> <% for variety, label in labels %> <% if @variety_postfix != variety %> <% if variety != "users" %> @@ -109,20 +114,20 @@ <%= text_field_tag(:request_date_before, params[:request_date_before], {:class => "use-datepicker", :size => 10}) %> </div> </div> -<br/> <% end %> +<div> <%= submit_tag("Filter") if @variety_postfix == "requests"%> +</div> <% end %> - <p><%= link_to(_("Advanced search"), advanced_search_url) %></p> <% end %> <% if !@query.nil? %> <p id="search_controls"> - <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, 'relevant') %> + <%=link_to_unless @sortby == 'relevant', _("Show most relevant results first"), search_url(@query, @variety_postfix, 'relevant') %> | - <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, 'newest') %> + <%=link_to_unless @sortby == 'newest', _("Newest results first"), search_url(@query, @variety_postfix, 'newest') %> <% if @sortby == 'described' %> | <%= _('Recently described results first') %> <% end %> @@ -191,7 +196,7 @@ <% if @xapian_requests_hits == 1 && @page == 1 %> <h2 class="foi_results"><%= _("One FOI request found") %></h2> <% else %> - <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s) %></h2> + <h2 class="foi_results"><%= _("FOI requests {{start_count}} to {{end_count}} of {{total_count}}", :start_count => ((@page-1)*@requests_per_page+1).to_s, :end_count => [@page*@requests_per_page, @xapian_requests.matches_estimated].min.to_s, :total_count => @xapian_requests.matches_estimated.to_s) %></h2> <% end %> <div class="results_block"> diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index 6ff52a3a7..75ba167e8 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -53,7 +53,7 @@ <%= render :partial => 'general/before_head_end' %> </head> - <body> + <body <%= "class='front'" if params[:action] == 'frontpage' %>> <!-- XXX: move to a separate file --> <% if force_registration_on_new_request && !@user %> @@ -150,6 +150,7 @@ <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="http://www.twitter.com/<%= MySociety::Config.get('TWITTER_USERNAME') %>"><%= _("Follow us on twitter") %></a> <%= render :partial => 'general/credits' %> </div> <div class="after-footer"> </div> @@ -158,3 +159,4 @@ </div> </body> </html> + diff --git a/app/views/request/_next_actions.rhtml b/app/views/request/_next_actions.rhtml new file mode 100644 index 000000000..f318df6e4 --- /dev/null +++ b/app/views/request/_next_actions.rhtml @@ -0,0 +1 @@ +<!-- Consider listing websites that users might find useful here (in your theme) --> diff --git a/app/views/request/_sidebar.rhtml b/app/views/request/_sidebar.rhtml index 4dce18e76..e562c4f6a 100644 --- a/app/views/request/_sidebar.rhtml +++ b/app/views/request/_sidebar.rhtml @@ -3,31 +3,22 @@ <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => @info_request.user == @user, :location => 'sidebar' } %> <h2><%= _("Act on what you've learnt") %></h2> + <div class="act_link"> - <%= link_to '<img src="/images/helpmeinvestigate.png" alt="" class="rss">', "http://helpmeinvestigate.com/"%> - <%= link_to 'Get help investigating', "http://helpmeinvestigate.com/"%> - </div> - <div class="act_link"> - <%= link_to '<img src="/images/writetothem.png" alt="" class="rss">', "http://www.writetothem.com"%> - <%= link_to 'Write to your politician', "http://www.writetothem.com"%> - </div> - <div class="act_link"> - <%= link_to '<img src="/images/pledgebank.png" alt="" class="rss">', "http://www.pledgebank.com"%> - <%= link_to 'Pledge with others', "http://www.pledgebank.com"%> + <% tweet_link = "http://twitter.com/share?url=#{h(request.url)}&via=#{h(MySociety::Config.get('TWITTER_USERNAME', ''))}&text='#{h(@info_request.title)}'&related=#{_('alaveteli_foi:The software that runs {{site_name}}', :site_name => h(site_name))}" %> + <%= link_to '<img src="/images/twitter-16.png" alt="twitter icon">', tweet_link %> + <%= link_to _("Tweet this request"), tweet_link %> </div> - <!-- <div class="act_link"> - <%= link_to '<img src="/images/petitions.png" alt="" class="rss">', "http://petitions.number10.gov.uk"%> - <%= link_to 'Petition the PM', "http://petitions.number10.gov.uk"%> - </div> --> <div class="act_link"> <%= link_to '<img src="/images/wordpress.png" alt="" class="rss">', "http://wordpress.com/"%> - <%= link_to 'Start your own blog', "http://wordpress.com/"%> + <%= link_to _("Start your own blog"), "http://wordpress.com/"%> </div> + <%= render :partial => 'request/next_actions' %> <% view_cache :ttl => 1.day, :tag => ['similar', @info_request.id, I18n.locale] do %> <% if !@xapian_similar.nil? && @xapian_similar.results.size > 0 %> - <h2><% _('Similar requests')%></h2> + <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 %> diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index 46f230da1..089b778f8 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -18,17 +18,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)) - main_text += event.info_request.public_body.name + " sent a response to " + event.info_request.user.name + 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)) - main_text += event.info_request.user.name + " sent a follow up message to " + event.info_request.public_body.name + 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)) - main_text += event.info_request.user.name + " sent a request to " + event.info_request.public_body.name + 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)) - main_text += event.comment.user.name + " added an annotation" + main_text += _("{{user_name}} added an annotation", :user_name => event.comment.user.name) else raise "unknown type in event_digest " + event.event_type end @@ -57,10 +57,10 @@ main_text += "\n" end -%><%=main_text%>Alter your subscription +%><%=main_text%><%= _("Alter your subscription")%> ======================= -Please click on the link below to cancel or alter these emails. +<% _("Please click on the link below to cancel or alter these emails.") %> <%=@unsubscribe_url%> -- <%= _('the {{site_name}} team', :site_name=>site_name) %> diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index 17fc0c46d..63f9fe3a0 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -116,19 +116,34 @@ </div> </div> <div style="clear:both"></div> + <% form_tag(show_user_url, :method => "get", :id=>"search_form") do %> + <div> + <%= text_field_tag(:user_query, params[:user_query]) %> + <% if @is_you %> + <%= submit_tag(_("Search your contributions")) %> + <% else %> + <%= submit_tag(_("Search contributions by this person")) %> + <% end %> + </div> + <% end %> + <% if !@xapian_requests.nil? %> <% if @xapian_requests.results.empty? %> <% if @page == 1 %> - <h2 class="foi_results" id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> </h2> + <h2 class="foi_results" id="foi_requests"><%= @is_you ? 'Freedom of Information requests made by you' : 'Freedom of Information requests made by this person' %> <%= @match_phrase %> +</h2> <p><%= @is_you ? _('You have made no Freedom of Information requests using this site.') : _('This person has made no Freedom of Information requests using this site.') %> + <%= @page_desc %> <% end %> <% else %> <h2 class="foi_results" id="foi_requests"> - <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @display_user.info_requests.size) % @display_user.info_requests.size %> + <%= @is_you ? n_('Your %d Freedom of Information request', 'Your %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size : n_('This person\'s %d Freedom of Information request', 'This person\'s %d Freedom of Information requests', @xapian_requests.results.size) % @xapian_requests.results.size %> <!-- matches_estimated <%=@xapian_requests.matches_estimated%> --> - <%= @page_desc %> + <%= @match_phrase %> + <%= @page_desc %> </h2> + <% for result in @xapian_requests.results %> <%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %> @@ -144,7 +159,9 @@ <% if !@xapian_comments.nil? %> <% if @xapian_comments.results.empty? %> <% if @page == 1 %> - <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %></h2> + <h2><%= @is_you ? _('Your annotations') : _('This person\'s annotations') %> + <%= @match_phrase %> + </h2> <p><%= _('None made.')%></p> <% end %> <% else %> @@ -213,6 +230,3 @@ <% end %> <% end %> <% end %> - -</div> - diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml index 1140d961a..76732c09a 100644 --- a/app/views/user/sign.rhtml +++ b/app/views/user/sign.rhtml @@ -37,7 +37,7 @@ - or - </div> <div id="right_half"> - <h1>Sign up</h2> + <h1>Sign up</h1> <%= render :partial => 'signup' %> </div> <div style="clear:both"></div> |