Skip to content

Commit 36b5ff3

Browse files
tordanswillemarcel
andcommitted
Add aoi-param to atom-link
The link-element now shows https://osmcha.mapbox.com/changesets/<id>/?aoi=<hash> which will tell the left sidebar to load the aoi-search that was used to generate the atom-feed. This way the user can continue looking at changesets from this aoi-search via the sidebar. Co-Authored-By: willemarcel <[email protected]>
1 parent 2145698 commit 36b5ff3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

osmchadjango/supervise/tests/test_views.py

+5
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,11 @@ def test_aoi_changesets_feed_view(self):
754754
rss_data = ET.fromstring(response.content).getchildren()[0].getchildren()
755755
title = [i for i in rss_data if i.tag == 'title'][0]
756756
items = [i for i in rss_data if i.tag == 'item']
757+
link = [i for i in rss_data if i.tag == 'link']
758+
self.assertIn(
759+
"?aoi=",
760+
link.text
761+
)
757762
self.assertEqual(
758763
title.text,
759764
'Changesets of Area of Interest {} by {}'.format(

osmchadjango/supervise/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def item_geometry(self, item):
138138
return item.bbox
139139

140140
def item_link(self, item):
141-
return reverse('frontend:changeset-detail', args=[item.id])
141+
return reverse('frontend:changeset-detail', args=[item.id], kwargs={'aoi':obj.id})
142142

143143
def item_pubdate(self, item):
144144
return item.date

0 commit comments

Comments
 (0)