t "changesets.index.title"
end
end
+
+ def changeset_data(changeset)
+ changeset_data = { :id => changeset.id }
+
+ if changeset.bbox_valid?
+ bbox = changeset.bbox.to_unscaled
+ changeset_data[:bbox] = {
+ :minlon => bbox.min_lon,
+ :minlat => bbox.min_lat,
+ :maxlon => bbox.max_lon,
+ :maxlat => bbox.max_lat
+ }
+ end
+
+ changeset_data
+ end
end
-<% changeset_data = { :id => changeset.id }
-
- if changeset.bbox_valid?
- bbox = changeset.bbox.to_unscaled
- changeset_data[:bbox] = {
- :minlon => bbox.min_lon,
- :minlat => bbox.min_lat,
- :maxlon => bbox.max_lon,
- :maxlat => bbox.max_lat
- }
- end %>
-
-<%= tag.li :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data }, :class => "list-group-item list-group-item-action" do %>
+<%= tag.li :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data(changeset) }, :class => "list-group-item list-group-item-action" do %>
<p class="fs-6 text-truncate text-wrap">
<a class="changeset_id link-body-emphasis stretched-link" href="<%= changeset_path(changeset) %>">
<span><%= changeset.tags["comment"].to_s.presence || t("browse.no_comment") %></span>