diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin_general/index.html.erb | 99 | ||||
-rw-r--r-- | app/views/admin_public_body/edit.html.erb | 2 | ||||
-rw-r--r-- | app/views/comment/_single_comment.html.erb | 2 | ||||
-rw-r--r-- | app/views/general/_responsive_topnav.html.erb | 13 | ||||
-rw-r--r-- | app/views/help/unhappy.html.erb | 5 | ||||
-rw-r--r-- | app/views/request/_act.html.erb | 5 | ||||
-rw-r--r-- | app/views/request/_followup.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/_incoming_correspondence.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/_outgoing_correspondence.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/_resent_outgoing_correspondence.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/new.html.erb | 4 | ||||
-rw-r--r-- | app/views/request/new_bad_contact.html.erb | 2 | ||||
-rw-r--r-- | app/views/request/show.html.erb | 4 | ||||
-rw-r--r-- | app/views/request_game/play.html.erb | 7 | ||||
-rw-r--r-- | app/views/widgets/new.html.erb | 15 | ||||
-rw-r--r-- | app/views/widgets/show.html.erb | 48 |
16 files changed, 162 insertions, 52 deletions
diff --git a/app/views/admin_general/index.html.erb b/app/views/admin_general/index.html.erb index ba0563bb6..8840bce74 100644 --- a/app/views/admin_general/index.html.erb +++ b/app/views/admin_general/index.html.erb @@ -2,17 +2,10 @@ <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> + <h1><%= @title %></h1> + <p> + <%= link_to 'Summary stats have moved →', admin_stats_path %> + </p> </div> </div> @@ -28,8 +21,14 @@ <% 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> + <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> @@ -39,11 +38,13 @@ <% if message.get_body_for_quoting.strip.size == 0 %> <%= link_to "(no body)", admin_raw_email_path(message.raw_email_id) %> <% else %> - <%= link_to excerpt(message.get_body_for_quoting, "", :radius => 60), admin_raw_email_path(message.raw_email_id) %> + <%= link_to admin_raw_email_path(message.raw_email_id) do %> + <%= excerpt(message.get_body_for_quoting, "", :radius => 60) %> + <% end %> <% end %> </td> <td class="span2"> - <%=simple_date(message.sent_at)%> + <%= simple_date(message.sent_at) %> </td> </tr> <% end %> @@ -67,7 +68,7 @@ <%= request_both_links(@request) %> </td> <td class="span2"> - <%=simple_date(@request.info_request_events.last.created_at)%> + <%= simple_date(@request.last_event_time) %> </td> </tr> <% end %> @@ -92,7 +93,7 @@ <%= request_both_links(@request) %> </td> <td class="span2"> - <%=simple_date(@request.info_request_events.last.created_at)%> + <%= simple_date(@request.last_event_time) %> </td> </tr> <% end %> @@ -116,7 +117,7 @@ <%= request_both_links(@request) %> </td> <td class="span2"> - <%=simple_date(@request.info_request_events.last.created_at)%> + <%= simple_date(@request.last_event_time) %> </td> </tr> <% end %> @@ -178,18 +179,33 @@ <% 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> + <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'%> - <%= form_tag admin_change_request_path(@change_request), :method => 'put', :class => "form form-horizontal" do %> - <%= submit_tag 'Close', :class => "btn btn-danger" %> - <%= link_to("Close and respond", edit_admin_change_request_path(@change_request), :class => 'btn') %> - <%= link_to("Add authority", new_admin_body_path(:change_request_id => @change_request.id), :class => 'btn btn-primary') %> - <% end %> + <% for @change_request in @new_body_requests %> + <%= render :partial => 'change_request_summary'%> - <% end %> + <%= form_tag admin_change_request_path(@change_request), + :method => 'put', + :class => "form form-horizontal" do %> + + <%= submit_tag 'Close', :class => "btn btn-danger" %> + + <%= link_to "Close and respond", + edit_admin_change_request_path(@change_request), + :class => 'btn' %> + + <%= link_to "Add authority", + new_admin_body_path(:change_request_id => @change_request.id), + :class => 'btn btn-primary' %> + <% end %> + <% end %> </div> </div> <% end %> @@ -197,17 +213,34 @@ <% 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> + <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' %> - <%= form_tag admin_change_request_path(@change_request), :class => "form form-horizontal", :method => 'put' do %> - <%= submit_tag 'Close', :class => "btn btn-danger" %> - <%= link_to("Close and respond", edit_admin_change_request_path(@change_request), :class => 'btn') %> - <%= link_to("Make update", edit_admin_body_path(@change_request.public_body, :change_request_id => @change_request.id), :class => 'btn btn-primary') %> - <% end %> + <%= render :partial => 'change_request_summary' %> + + <%= form_tag admin_change_request_path(@change_request), + :class => "form form-horizontal", + :method => 'put' do %> + + <%= submit_tag 'Close', :class => "btn btn-danger" %> + + <%= link_to "Close and respond", + edit_admin_change_request_path(@change_request), + :class => 'btn' %> + + <%= link_to "Make update", + edit_admin_body_path(@change_request.public_body, + :change_request_id => @change_request.id), + :class => 'btn btn-primary' %> <% end %> + <% end %> </div> </div> <% end %> diff --git a/app/views/admin_public_body/edit.html.erb b/app/views/admin_public_body/edit.html.erb index dcafbd270..fc9c25e8f 100644 --- a/app/views/admin_public_body/edit.html.erb +++ b/app/views/admin_public_body/edit.html.erb @@ -13,7 +13,7 @@ <div class="row"> <div class="span8"> <div class="well"> - <%= link_to 'Show', admin_bodies_path(@public_body), :class => "btn" %> + <%= link_to 'Show', admin_body_path(@public_body), :class => "btn" %> <%= link_to 'List all', admin_bodies_path, :class => "btn" %> </div> </div> diff --git a/app/views/comment/_single_comment.html.erb b/app/views/comment/_single_comment.html.erb index 07017dabf..badc39d9a 100644 --- a/app/views/comment/_single_comment.html.erb +++ b/app/views/comment/_single_comment.html.erb @@ -1,4 +1,4 @@ -<div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> +<div class="comment_in_request box" id="comment-<%=comment.id.to_s%>"> <% 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=""> diff --git a/app/views/general/_responsive_topnav.html.erb b/app/views/general/_responsive_topnav.html.erb index 0af6629c8..c99864cab 100644 --- a/app/views/general/_responsive_topnav.html.erb +++ b/app/views/general/_responsive_topnav.html.erb @@ -21,11 +21,16 @@ </li> <li id="navigation_search"> - <form id="navigation_search_form" method="get" action="<%= search_redirect_path %>"> - <label for="navigation_search_button"> - <img src="/assets/search.png" alt="Search:"> + <form id="navigation_search_form" method="get" action="<%= search_redirect_path %>" role="search"> + <label class="visually-hidden" for="navigation_search_button"> + <%= _("Search") %> </label> - <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :title => "type your search term here" } %> + <%= text_field_tag 'query', params[:query], { :id => "navigation_search_button", :type => "search", :placeholder => _("Search"), :title => _("type your search term here") } %> + <button type="submit"> + <span class="visually-hidden"> + <%= _("Submit Search") %> + </span> + </button> </form> </li> </ul> diff --git a/app/views/help/unhappy.html.erb b/app/views/help/unhappy.html.erb index 79e3f8273..c0444fb54 100644 --- a/app/views/help/unhappy.html.erb +++ b/app/views/help/unhappy.html.erb @@ -101,9 +101,8 @@ contact any registered user from their page. There may be an Internet forum or group that they hang out in. If it is a local matter, use <a href="http://www.groupsnearyou.com">GroupsNearYou</a> to find such a forum.</li> -<li><strong>Start a pledge</strong> on <a href="http://www.pledgebank.com">PledgeBank</a> to get -others to act together with you. For example, you could arrange a meeting with -staff from the authority. Or you could form a small local campaigns group. +<li>You could form a small local campaign group and arrange a meeting +with staff from the authority.</li> </ul> diff --git a/app/views/request/_act.html.erb b/app/views/request/_act.html.erb index 878cdf4ff..c7bbd287f 100644 --- a/app/views/request/_act.html.erb +++ b/app/views/request/_act.html.erb @@ -20,3 +20,8 @@ <% end %> <%= link_to _("Start your own blog"), "http://wordpress.com/"%> </div> +<% if AlaveteliConfiguration::enable_widgets %> + <div class="act_link"> + <%= link_to _("Create a widget for this request"), new_request_widget_path(@info_request) %> + </div> +<% end %> diff --git a/app/views/request/_followup.html.erb b/app/views/request/_followup.html.erb index 2643b767f..24cede824 100644 --- a/app/views/request/_followup.html.erb +++ b/app/views/request/_followup.html.erb @@ -20,7 +20,7 @@ </h2> <% end %> <% if @info_request.who_can_followup_to(incoming_message).count > 0 %> -<div id="other_recipients"> +<div id="other_recipients" class="box"> <%= _("Don't want to address your message to {{person_or_body}}? You can also write to:", :person_or_body => name_for_followup) %> <ul> <% @info_request.who_can_followup_to(incoming_message).each do |name, email, id| %> diff --git a/app/views/request/_incoming_correspondence.html.erb b/app/views/request/_incoming_correspondence.html.erb index 70bd25c7f..9d205204e 100644 --- a/app/views/request/_incoming_correspondence.html.erb +++ b/app/views/request/_incoming_correspondence.html.erb @@ -1,4 +1,4 @@ -<div class="incoming correspondence <%= incoming_message.prominence %>" id="incoming-<%=incoming_message.id.to_s%>"> +<div class="incoming correspondence box <%= 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 %> diff --git a/app/views/request/_outgoing_correspondence.html.erb b/app/views/request/_outgoing_correspondence.html.erb index dced5c94c..3b85cae7f 100644 --- a/app/views/request/_outgoing_correspondence.html.erb +++ b/app/views/request/_outgoing_correspondence.html.erb @@ -1,4 +1,4 @@ -<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>"> +<div class="outgoing correspondence box" 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 %> diff --git a/app/views/request/_resent_outgoing_correspondence.html.erb b/app/views/request/_resent_outgoing_correspondence.html.erb index 17b6b635b..287a5cac5 100644 --- a/app/views/request/_resent_outgoing_correspondence.html.erb +++ b/app/views/request/_resent_outgoing_correspondence.html.erb @@ -1,4 +1,4 @@ -<div class="outgoing correspondence" id="outgoing-<%=outgoing_message.id.to_s%>"> +<div class="outgoing correspondence box" id="outgoing-<%=outgoing_message.id.to_s%>"> <h2> <%= simple_date(info_request_event.created_at) %> </h2> diff --git a/app/views/request/new.html.erb b/app/views/request/new.html.erb index 486a89d45..23f7ad76a 100644 --- a/app/views/request/new.html.erb +++ b/app/views/request/new.html.erb @@ -144,7 +144,7 @@ <% 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) %> + <%= _("Browse <a href='{{url}}'>other requests</a> for examples of how to word your request.", :url=>request_list_successful_url) %> <% end %> </p> <% end %> @@ -156,7 +156,7 @@ this website <a href="{{url}}">forever</a>', :url => (help_privacy_path+"#public_request").html_safe)) %>. </p> <p> - <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>.', :url => (help_privacy_path+"#real_name").html_safe)) %> + <%= raw(_('<a href="{{url}}">Thinking of using a pseudonym?</a>', :url => (help_privacy_path+"#real_name").html_safe)) %> </p> <% else %> <p> diff --git a/app/views/request/new_bad_contact.html.erb b/app/views/request/new_bad_contact.html.erb index 56f3f4168..f9881b62b 100644 --- a/app/views/request/new_bad_contact.html.erb +++ b/app/views/request/new_bad_contact.html.erb @@ -5,6 +5,6 @@ <p><%= _('Unfortunately, we do not have a working {{info_request_law_used_full}} address for', :info_request_law_used_full => @info_request.law_used_full) %> <%=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="{{help_url}}">send it to us</a>.', :help_url => help_contact_path) %> +to find one, then please <a href="{{help_url}}">send it to us</a>.', :help_url => new_change_request_path(:body => @info_request.public_body.url_name)) %> </p> diff --git a/app/views/request/show.html.erb b/app/views/request/show.html.erb index 78e022aa9..5862413de 100644 --- a/app/views/request/show.html.erb +++ b/app/views/request/show.html.erb @@ -22,7 +22,7 @@ <% if ( @update_status || @info_request.awaiting_description ) && ! @info_request.is_external? %> - <div class="describe_state_form" id="describe_state_form_1"> + <div class="describe_state_form box" id="describe_state_form_1"> <%= render :partial => 'describe_state', :locals => { :id_suffix => "1" } %> </div> <% end %> @@ -146,7 +146,7 @@ <% end %> <% if @info_request.awaiting_description && ! @info_request.is_external? %> - <div class="describe_state_form" id="describe_state_form_2"> + <div class="describe_state_form box" id="describe_state_form_2"> <%= render :partial => 'describe_state', :locals => { :id_suffix => "2" } %> </div> <% end %> diff --git a/app/views/request_game/play.html.erb b/app/views/request_game/play.html.erb index 471a0e09e..44fe641f9 100644 --- a/app/views/request_game/play.html.erb +++ b/app/views/request_game/play.html.erb @@ -2,7 +2,12 @@ <div id="game_sidebar"> <p style="text-align: center"> - <img width=250 height=125 src="http://chart.apis.google.com/chart?chs=250x125&cht=gom&chd=t:<%=@percentage%>" alt="<%=@percentage%>% of requests have been categorised"> + <%= + image_tag "https://chart.googleapis.com/chart?chs=250x125&cht=gom&chd=t:#{@percentage}", + :size => "250x125", + :alt => "A chart showing #{@percentage}% of requests have been categorised", + :title => "#{@percentage}% of requests have been categorised" + %> <br><%=pluralize(@missing, 'request')%> left to categorise / <%=@total %> total </p> diff --git a/app/views/widgets/new.html.erb b/app/views/widgets/new.html.erb new file mode 100644 index 000000000..c706155a5 --- /dev/null +++ b/app/views/widgets/new.html.erb @@ -0,0 +1,15 @@ +<h1>Add a widget</h1> + +<p> +To add a widget for <b><%= @info_request.title %></b>, copy and paste the +following code to your web page: +<textarea autofocus readonly rows='4' cols='60' id='widgetbox'> +<iframe src='<%= request_widget_url(@info_request) %>' width='320' height='215' frameborder='0' marginwidth='0' marginheight='0'></iframe> +</textarea> +</p> + +<p> +The widget will look like this: +<br> +<iframe src='<%= request_widget_url(@info_request) %>' width='320' height='215' frameborder='0' marginwidth='0' marginheight='0'></iframe> +</p> diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb new file mode 100644 index 000000000..07c7b1908 --- /dev/null +++ b/app/views/widgets/show.html.erb @@ -0,0 +1,48 @@ +<head> + <%= stylesheet_link_tag "widget" %> +</head> +<body> + <div class="alaveteli-widget"> + <div class="alaveteli-widget__top"> + <div class="alaveteli-widget__left"> + <div class="alaveteli-widget__title"> + <%= link_to @info_request.title, request_path(@info_request), :target => "_top" %> + </div> + <div class="alaveteli-widget__status <%= @status %>"> + <p class="alaveteli-widget__status__status-label">Status</p> + <%= status_description(@info_request, @status) %> + </div> + </div> + <div class="alaveteli-widget__people-count"> + <%= n_('<div class="alaveteli-widget__count">{{count}}</div> person wants to know', '<div class="alaveteli-widget__count">{{count}}</div> people want to know', @count, :count => @count) %> + </div> + </div> + + + <div class="alaveteli-widget__bottom"> + <% if @info_request.user && @info_request.user == @user %> + <div class="alaveteli-widget__button alaveteli-widget__button--down"> + <%= _('This is your request') %> + </div> + <% elsif @existing_track %> + <a href="<%= url_for :controller => 'track', :action => 'update', :track_id => @existing_track.id, :track_medium => "delete", :r => request.fullpath %>"> + <div class="alaveteli-widget__button--down"> + <%= _('You are tracking this request') %> + </div> + </a> + <% else %> + <% if @user %> + <a href="<%= url_for do_track_path(@track_thing) %>" target="_blank"> + <div class="alaveteli-widget__button"> + <%= _('I also want to know!') %> + </div> + </a> + <% else %> + <%= form_tag request_widget_url(@info_request), :method => 'put', :target => '_blank' do %> + <%= submit_tag _('I also want to know!'), :class => 'alaveteli-widget__button' %> + <% end %> + <% end %> + <% end %> + </div> + </div> +</body> |