diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:18:43 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:41:43 +0100 |
commit | 710754b4bb053cf28773da13f43ad05b864305e1 (patch) | |
tree | bc836f27d44dd074c55d9d2c0e85502f4a779e78 | |
parent | 31161173281c718230d31f4d2345dc358edcee64 (diff) |
Handle the case of an empty string in the prominence_reason.
This will happen if the prominence has been changed in the admin
interface but no reason has been filled in.
Conflicts:
app/views/request/_incoming_correspondence.html.erb
-rw-r--r-- | app/views/request/_incoming_correspondence.html.erb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/request/_incoming_correspondence.html.erb b/app/views/request/_incoming_correspondence.html.erb index 591556f10..2293db66d 100644 --- a/app/views/request/_incoming_correspondence.html.erb +++ b/app/views/request/_incoming_correspondence.html.erb @@ -1,7 +1,7 @@ <div class="incoming correspondence <%= incoming_message.prominence %>" id="incoming-<%=incoming_message.id.to_s%>"> <%- if not incoming_message.user_can_view?(@user) %> <p id="hidden_message"> - <%- if incoming_message.prominence_reason %> + <%- if !incoming_message.prominence_reason.blank? %> <%= _('This message has been hidden. {{reason}} Please <a href="{{url}}">contact us</a> if you have any questions.', :url => help_contact_path.html_safe, :reason => incoming_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. Please <a href="{{url}}">contact us</a> if you have any questions.', :url => help_contact_path.html_safe) %> @@ -13,7 +13,7 @@ <%- else %> <% if incoming_message.prominence == 'hidden' %> <p id="hidden_message"> - <%- if incoming_message.prominence_reason %> + <%- if !incoming_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 => incoming_message.prominence_reason) %> <%- else %> <%= _('This message has prominence \'hidden\'. You can only see it because you are logged in as a super user.') %> @@ -22,7 +22,7 @@ <% end %> <% if incoming_message.prominence == 'requester_only' %> <p id="hidden_message"> - <%- if incoming_message.prominence_reason %> + <%- if !incoming_message.prominence_reason.blank? %> <%= _('This message is hidden, so that only you, the requester, can see it. {{reason}}', :url => help_requesting_path.html_safe, :reason => incoming_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) %> |