Render the links using partial so we can do the appropriate rendering
authorTom Hughes <tom@compton.nu>
Wed, 5 Aug 2009 23:39:24 +0000 (23:39 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 5 Aug 2009 23:39:24 +0000 (23:39 +0000)
for HTML and Atom versions and hopefully get the escaping right in the
feed. Closes #2135.

app/controllers/changeset_controller.rb
app/views/changeset/_bbox.atom.builder [new file with mode: 0644]
app/views/changeset/_bbox.html.erb [new file with mode: 0644]
app/views/changeset/_user.atom.builder [new file with mode: 0644]
app/views/changeset/_user.html.erb [new file with mode: 0644]

index c02ced7c26ef3de71853dbc585389e622c335be1..e451f6d04904f80467620e16f612db6ac1cadc39 100644 (file)
@@ -281,11 +281,11 @@ class ChangesetController < ApplicationController
     if bbox
       conditions = cond_merge conditions, conditions_bbox(bbox)
       bbox = BoundingBox.from_s(bbox)
-      bbox_link = "<a href='#{url_for(:controller => "site", :action => "index", :minlon => bbox.min_lon, :minlat => bbox.min_lat, :maxlon => bbox.max_lon, :maxlat => bbox.max_lat, :box => "yes")}'>#{bbox.to_s}</a>"
+      bbox_link = render_to_string :partial => "bbox", :object => bbox
     end
 
     if user
-      user_link = "<a href='#{url_for(:controller => "user", :action => "view", :display_name => user.display_name)}'>#{user.display_name}</a>"
+      user_link = render_to_string :partial => "user", :object => user
     end
 
     if user and bbox
diff --git a/app/views/changeset/_bbox.atom.builder b/app/views/changeset/_bbox.atom.builder
new file mode 100644 (file)
index 0000000..de3b1f1
--- /dev/null
@@ -0,0 +1 @@
+xml.a(bbox.to_s, :href => url_for(:controller => "site", :action => "index", :minlon => bbox.min_lon, :minlat => bbox.min_lat, :maxlon => bbox.max_lon, :maxlat => bbox.max_lat, :box => "yes"))
diff --git a/app/views/changeset/_bbox.html.erb b/app/views/changeset/_bbox.html.erb
new file mode 100644 (file)
index 0000000..f9424be
--- /dev/null
@@ -0,0 +1 @@
+<%= link_to bbox.to_s, :controller => "site", :action => "index", :minlon => bbox.min_lon, :minlat => bbox.min_lat, :maxlon => bbox.max_lon, :maxlat => bbox.max_lat, :box => "yes" %>
diff --git a/app/views/changeset/_user.atom.builder b/app/views/changeset/_user.atom.builder
new file mode 100644 (file)
index 0000000..61faea9
--- /dev/null
@@ -0,0 +1 @@
+xml.a(user.display_name, :href => url_for(:controller => "user", :action => "view", :display_name => user.display_name))
diff --git a/app/views/changeset/_user.html.erb b/app/views/changeset/_user.html.erb
new file mode 100644 (file)
index 0000000..0e95076
--- /dev/null
@@ -0,0 +1 @@
+<%= link_to user.display_name, :controller => "user", :action => "view", :display_name => user.display_name %>