[openstreetmap-website] Changeset discussion feature (#772)
Matt Amos
notifications at github.com
Fri Aug 8 12:30:12 UTC 2014
> @@ -0,0 +1,26 @@
> +changeset_attributes = { :id => changeset.id, :created_at => changeset.created_at.xmlschema, :closed_at => changeset.closed_at, :open => changeset.is_open? }
> +changeset_attributes[:uid] = changeset.user.id if changeset.user.data_public?
> +changeset_attributes[:user] = changeset.user.display_name if changeset.user.data_public?
> +changeset.bbox.to_unscaled.add_bounds_to(changeset_attributes, '_') if changeset.bbox.complete?
> +
> +xml.changeset(changeset_attributes) do |asterx|
> + changeset.tags.each do |k,v|
> + xml.tag :k => k, :v => v
> + end
> + if @comments
> + xml.discussion do
I would have implemented comments by passing the `:include_discussion` flag to `Changeset.to_xml` and `Changeset.to_xml_node`, but I don't know if that's the better solution :wink:. Equally, just unit testing the output of the builder against `to_xml` would ensure we stay in sync. The other benefit of implementing it in the `to_xml` methods is that it would then be trivial to include comments in the controller's `:query` and update methods, if anyone wants that.
About the document type - sorry, I didn't explain what I meant very well. Looking more closely, I see you're using the `RichText` helper, but hard-coding the type to "text". I think it would be useful to allow choice of that format by the commenter - I certainly find Markdown useful for linking and so forth.
About the outdating - that seems fine for now, although I think it's likely to be requested pretty quickly post-release :smile:
---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/772/files#r15990043
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20140808/28417bad/attachment.html>
More information about the rails-dev
mailing list