[openstreetmap-website] User page redesign a.k.a. activity stream (#54)

Tom Hughes notifications at github.com
Sun Aug 12 16:45:15 BST 2012


> @@ -52,6 +52,37 @@ def set_closed_time_now
>      end
>    end
>  
> +  # Determines the best 'summary' of the changeset, either from comments or automatically
> +  def summary
> +    unless (self.tags['comment'].nil?)
> +      return self.tags['comment'].nil?
> +    else
> +      "#{self.num_changes} modifications made in this changeset."
> +    end
> +  end
> +
> +  def activity_actor
> +    return self.user
> +  end
> +
> +  # Returns a list of nodes that represent city/town/village that is nearby the center of changeset's bounding box.
> +  def related_places(radius = 5)

This method is likely to be very expensive - at the very least it will need to get the bounds from the GC object and do an `sql_for_area` filter using those bounds so that we can roughly cut down the matches using a tile index filter.

If this is just to get a description for the location of a changset though then I would suggest using the `describe_location` helper function, which uses Nomination to get a description. We would also need to think about caching the result of that, in the same way the diary pages do.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/54/files#r1358594
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20120812/a4c42dcb/attachment.html>


More information about the rails-dev mailing list