Use note.closed? in a consistent way

This commit is contained in:
Tom Hughes 2013-06-11 18:26:40 +01:00
parent 1d7719e01c
commit 5efe07f164
5 changed files with 5 additions and 5 deletions

View file

@ -17,7 +17,7 @@ xml.wpt("lon" => note.lon, "lat" => note.lat) do
xml.date_created note.created_at
xml.status note.status
if note.status == "closed"
if note.closed?
xml.date_closed note.closed_at
end
end

View file

@ -18,7 +18,7 @@ json.properties do
json.date_created note.created_at
json.status note.status
json.closed_at note.closed_at if note.status == "closed"
json.closed_at note.closed_at if note.closed?
json.comments(note.comments) do |comment|
json.date comment.created_at

View file

@ -1,7 +1,7 @@
xml.item do
location = describe_location(note.lat, note.lon, 14, locale)
if note.status == "closed"
if note.closed?
xml.title t('note.rss.closed', :place => location)
elsif note.comments.length > 1
xml.title t('note.rss.comment', :place => location)

View file

@ -12,7 +12,7 @@ xml.note("lon" => note.lon, "lat" => note.lat) do
xml.date_created note.created_at
xml.status note.status
if note.status == "closed"
if note.closed?
xml.date_closed note.closed_at
end

View file

@ -17,7 +17,7 @@
<% @notes.each do |note| -%>
<tr<% if note.author != @user2 %> class="creator"<% end %>>
<td>
<% if note.status == "closed" %>
<% if note.closed? %>
<%= image_tag("closed_note_marker.png", :alt => 'closed') %>
<% else %>
<%= image_tag("open_note_marker.png", :alt => 'open') %>