Skip to content

Commit

Permalink
feat: add surrounding area support to areasheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Vergez committed Oct 12, 2022
1 parent c32b5af commit a63eb44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion atlas/atlasRoutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def area_sheet(id_area):
session, current_app.config["NB_LAST_OBS"], id_area
)

surroundingAreas = []
surroundingAreas = vmAreasRepository.get_surrounding_areas(session=session, id_area=id_area)

observers = vmAreasRepository.get_observers_area(session, id_area=id_area)

Expand Down
2 changes: 1 addition & 1 deletion atlas/modeles/repositories/vmAreasRepository.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def get_surrounding_areas(session, id_area):
VmBibAreasTypes.type_name,
)
.join(VmBibAreasTypes, VmAreas.id_type == VmBibAreasTypes.id_type)
.filter(and_(VmAreas.the_geom.st_intersects(subquery.c.the_geom)))
.filter(and_(VmAreas.the_geom.st_intersects(subquery.c.the_geom.st_buffer(0)), VmAreas != id_area))
)

return query.all()
Expand Down
2 changes: 1 addition & 1 deletion atlas/templates/areaSheet/surrounding_areas.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h3 class="modal-title" id="surroundingAreasLabel">{{ _('associate.zone') }}</h3
<li class="list-group-item border-0">
<small>{{ area.type_name }}</small><br><b>{{ area.area_name }}</b>
<span class="float-right "><a class="badge badge-info"
href="{{ url_for('main.areaSheet',type_code=area.type_code, area_code=area.area_code) }}">
href="{{ url_for('main.area_sheet',id_area=area.id_area) }}">
{{ _('check.area.sheet') }}</a>
</span>
</li>
Expand Down

0 comments on commit a63eb44

Please sign in to comment.