X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/1f0d1dab3b741742893cd16bc9cfe05efe244f01..bb4720f09b42749746151dae1d0348f062696574:/app/helpers/changesets_helper.rb diff --git a/app/helpers/changesets_helper.rb b/app/helpers/changesets_helper.rb index 970522160..4605658f6 100644 --- a/app/helpers/changesets_helper.rb +++ b/app/helpers/changesets_helper.rb @@ -3,7 +3,7 @@ module ChangesetsHelper if changeset.user.status == "deleted" t("users.no_such_user.deleted") elsif changeset.user.data_public? - link_to changeset.user.display_name, changeset.user + link_to changeset.user.display_name, changeset.user, :class => "mw-100 d-inline-block align-bottom text-truncate text-wrap", :dir => "auto" else t("browse.anonymous") end @@ -41,4 +41,20 @@ module ChangesetsHelper 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