diff options
-rw-r--r-- | app/views/request/_after_actions.rhtml | 8 | ||||
-rw-r--r-- | app/views/request/_other_describe_state.rhtml | 4 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 15 | ||||
-rw-r--r-- | public/stylesheets/main.css | 6 | ||||
-rw-r--r-- | spec/views/request/_after_actions.rhtml_spec.rb | 59 |
5 files changed, 77 insertions, 15 deletions
diff --git a/app/views/request/_after_actions.rhtml b/app/views/request/_after_actions.rhtml index aa6411453..b8d087a12 100644 --- a/app/views/request/_after_actions.rhtml +++ b/app/views/request/_after_actions.rhtml @@ -5,6 +5,9 @@ <div id="anyone_actions"> <%= link_to "Add an annotation", new_comment_url(:url_title => @info_request.url_title) %> (to help the requester or others) + <% if @old_unclassified %> + | <%= link_to "Update the status of this request", '#describe_state_form_1' %> + <% end %> </div> <div id="owner_actions"> @@ -14,8 +17,9 @@ <% else %> <%= link_to "Reply to " + RequestMailer.name_for_followup(@info_request, @last_response), show_response_url(:id => @info_request.id, :incoming_message_id => @last_response.id) + "#followup" %> <% end %> - | - <%= link_to "Update the status of this request", request_url(@info_request, :update_status => 1) %> + <% if !@old_unclassified %> + | <%= link_to "Update the status of this request", request_url(@info_request, :update_status => 1) %> + <% end %> | <%= link_to "Request an internal review", show_response_no_followup_url(:id => @info_request.id, :incoming_message_id => nil) + "?internal_review=1#followup" %> </div> diff --git a/app/views/request/_other_describe_state.rhtml b/app/views/request/_other_describe_state.rhtml index 25514cf52..aa153043b 100644 --- a/app/views/request/_other_describe_state.rhtml +++ b/app/views/request/_other_describe_state.rhtml @@ -2,10 +2,10 @@ <% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %> <h2>Can you help us by describing the status of this request now?</h2> - <small> + <div class="form_explanation"> <%= user_link(@info_request.user) %> hasn't yet let us know whether this request was successful or not. Perhaps you could help us out by doing so? - </small> + </div> <hr> <!------------------------------------------------> <% if @info_request.described_state != 'internal_review' %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index fa9c8f4a7..aac8d0851 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -28,10 +28,17 @@ 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 %> - This request has an <strong>unknown status</strong>. We're waiting for - <%= user_link(@info_request.user) %> to read - <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> - and update the status. + This request has an <strong>unknown status</strong>. + <% if @old_unclassified %> + We're waiting for someone to read + <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> + and update the status accordingly. Perhaps <strong>you</strong> might like to help out by doing that? + <% else %> + We're waiting for + <%= user_link(@info_request.user) %> to read + <%= MySociety::Format.fancy_pluralize(@new_responses_count, 'a recent response', 'recent responses') %> + and update the status. + <% end %> <% end %> <% elsif @status == 'waiting_response' %> Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>, diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 809de9862..b266d5206 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -631,7 +631,7 @@ div.pagination { text-align: center; padding-top: 0.3em;} } /*-------------------- Content : action notice */ -#notice, .describe_state_form, .undescribed_requests, .other_describe_state_form, .gone_postal_help +#notice, .describe_state_form, .undescribed_requests, .gone_postal_help { color: #16C132; font-size: 1.4em; @@ -642,6 +642,10 @@ div.pagination { text-align: center; padding-top: 0.3em;} background-color: #D5FFD8; padding: 0.5em; } + +.form_explanation{ + font-size: 0.8em; +} /* This doesn't seem to work, not sure why (if you turn it on, check all * flashes with <strong> in them work OK) #notice * strong diff --git a/spec/views/request/_after_actions.rhtml_spec.rb b/spec/views/request/_after_actions.rhtml_spec.rb index 7893d2e49..a92ef2dda 100644 --- a/spec/views/request/_after_actions.rhtml_spec.rb +++ b/spec/views/request/_after_actions.rhtml_spec.rb @@ -18,17 +18,64 @@ describe 'when displaying actions that can be taken with regard to a request' do render :partial => 'request/after_actions' end - def expect_owner_link(text) + def expect_owner_div do_render - response.should have_tag('div#owner_actions') do - with_tag('a', :text => text) - end + response.should have_tag('div#owner_actions'){ yield } + end + + def expect_anyone_div + do_render + response.should have_tag('div#anyone_actions'){ yield } + end + + def expect_owner_link(text) + expect_owner_div{ with_tag('a', :text => text) } end - it 'should display a link for the request owner to update the status of the request' do - expect_owner_link('Update the status of this request') + def expect_no_owner_link(text) + expect_owner_div{ without_tag('a', :text => text) } + end + + def expect_anyone_link(text) + expect_anyone_div{ with_tag('a', :text => text) } + end + + def expect_no_anyone_link(text) + expect_anyone_div{ without_tag('a', :text => text) } + end + + describe 'if the request is old and unclassified' do + + before do + assigns[:old_unclassified] = true + end + + it 'should not display a link for the request owner to update the status of the request' do + expect_no_owner_link('Update the status of this request') + end + + it 'should display a link for anyone to update the status of the request' do + expect_anyone_link('Update the status of this request') + end + end + describe 'if the request is not old and unclassified' do + + before do + assigns[:old_unclassified] = false + end + + it 'should display a link for the request owner to update the status of the request' do + expect_owner_link('Update the status of this request') + end + + it 'should not display a link for anyone to update the status of the request' do + expect_no_anyone_link('Update the status of this request') + end + + end + it 'should display a link for the request owner to request a review' do expect_owner_link('Request an internal review') end |