content_tag(:span, time_ago_in_words(date), :title => l(date, :format => :friendly))
end
+ def note_author(object, link_options = {})
+ if object.author.nil?
+ h(object.author_name)
+ else
+ link_to h(object.author_name), link_options.merge({:controller => "user", :action => "view", :display_name => object.author_name})
+ end
+ end
+
+ def with_format(format, &block)
+ old_format = @template_format
+ @template_format = format
+ result = block.call
+ @template_format = old_format
+ return result
+ end
+
private
def javascript_strings_for_key(key)
end
end
- def note_author(object)
- if object.author.nil?
- h(object.author_name)
- else
- link_to h(object.author_name), :controller => "user", :action => "view", :display_name => object.author_name
- end
- end
-
private
ICON_TAGS = [
--- /dev/null
+<div>
+ <% description.comments.each do |comment| -%>
+ <div class="note-comment" style="margin-top: 5px">
+ <div class="note-comment-description" style="font-size: smaller; color: #999999"><%= t "note.description.#{comment.event}_at_by", :when => friendly_date(comment.created_at), :user => note_author(comment, :only_path => false) %></div>
+ <div class="note-comment-text"><%= comment.body %></div>
+ </div>
+ <% end -%>
+</div>
xml.wpt("lon" => note.lon, "lat" => note.lat) do
- xml.desc do
- xml.cdata! note.flatten_comment("<hr />")
+ with_format(:html) do
+ xml.desc do
+ xml.cdata! render(:partial => "description", :object => note, :format => :html)
+ end
end
xml.extension do
xml.link url_for(:controller => "browse", :action => "note", :id => note.id, :only_path => false)
xml.guid url_for(:controller => "note", :action => "read", :id => note.id, :only_path => false)
- xml.description htmlize(note.flatten_comment("<br><br>"))
+ with_format(:html) do
+ xml.description render(:partial => "description", :object => note)
+ end
xml.author note.author_name
xml.pubDate note.updated_at.to_s(:rfc822)
xml.geo :lat, note.lat
at_by: "%{when} ago by %{user}"
description: "Description:"
comments: "Comments:"
-
- comment_by: "Comment by: "
- comment: "Comment:"
- date: "Date:"
changeset:
changeset_paging_nav:
showing_page: "Showing page %{page}"
revoker: "Revoker:"
needs_view: "The user needs to log in before this block will be cleared."
note:
+ description:
+ opened_at_by: "Created %{when} ago by %{user}"
+ commented_at_by: "Updated %{when} ago by %{user}"
+ closed_at_by: "Resolved %{when} ago by %{user}"
+ reopened_at_by: "Reactivated %{when} ago by %{user}"
rss:
title: "OpenStreetMap Notes"
description_area: "A list of notes, reported, commented on or closed in your area [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})]"
description: "Notes submitted or commented on by %{user}"
id: "Id"
last_changed: "Last changed"
-
javascripts:
map:
base: