aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/public_body.rb5
-rw-r--r--app/views/public_body/_body_listing_single.html.erb13
-rw-r--r--app/views/public_body/show.html.erb10
-rw-r--r--app/views/public_body/view_email.html.erb2
4 files changed, 17 insertions, 13 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 36d66b665..5e5b35c5b 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -262,6 +262,11 @@ class PublicBody < ActiveRecord::Base
end
end
+ def special_not_requestable_reason?
+ self.defunct? || self.not_apply?
+ end
+
+
class Version
def last_edit_comment_for_html_display
diff --git a/app/views/public_body/_body_listing_single.html.erb b/app/views/public_body/_body_listing_single.html.erb
index 771027622..aa794c5d5 100644
--- a/app/views/public_body/_body_listing_single.html.erb
+++ b/app/views/public_body/_body_listing_single.html.erb
@@ -25,7 +25,7 @@
<%= _("Added on {{date}}", :date => simple_date(public_body.created_at)) %>.
</span>
<br>
- <% if !public_body.is_requestable? && public_body.not_requestable_reason != 'bad_contact' %>
+ <% if public_body.special_not_requestable_reason? %>
<% if public_body.not_requestable_reason == 'not_apply' %>
<%= _('FOI law does not apply to this authority.')%>
<% elsif public_body.not_requestable_reason == 'defunct' %>
@@ -33,12 +33,11 @@
<% end %>
<% end %>
</span>
- <% if @include_request_link_in_authority_listing %>
- <% if public_body.is_requestable? || public_body.not_requestable_reason == 'bad_contact' %>
- <div class="make-request-quick-button">
- <%= link_to _("Make a request"), new_request_to_body_path(:url_name => public_body.url_name), :class => "link_button_green" %>
- </div>
- <% end %>
+
+ <% if request_link && !public_body.special_not_requestable_reason? %>
+ <div class="make-request-quick-button">
+ <%= link_to _("Make a request"), new_request_to_body_path(:url_name => public_body.url_name), :class => "link_button_green" %>
+ </div>
<% end %>
</div>
diff --git a/app/views/public_body/show.html.erb b/app/views/public_body/show.html.erb
index 403216c6c..ac8f3a34e 100644
--- a/app/views/public_body/show.html.erb
+++ b/app/views/public_body/show.html.erb
@@ -39,7 +39,7 @@
<% end %>
</p>
- <% if @public_body.is_requestable? || @public_body.not_requestable_reason == 'bad_contact' %>
+ <% if !@public_body.special_not_requestable_reason? %>
<% if @public_body.has_notes? %>
<p><%= @public_body.notes_as_html.html_safe %></p>
<% end %>
@@ -52,15 +52,15 @@
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.is_requestable? %>
<%= 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? %>
+ <% end %>
+
+ <% if @public_body.has_notes? %>
<%= @public_body.notes_as_html.html_safe %>
<% end %>
diff --git a/app/views/public_body/view_email.html.erb b/app/views/public_body/view_email.html.erb
index 5f4bc95f4..399caaa61 100644
--- a/app/views/public_body/view_email.html.erb
+++ b/app/views/public_body/view_email.html.erb
@@ -24,7 +24,7 @@
</p>
<p>
- <% if @public_body.is_requestable? || @public_body.not_requestable_reason != 'bad_contact' %>
+ <% if @public_body.has_request_email? %>
<%= 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="{{url}}">send it to us</a>.