-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34842 from dimagi/ze/refresh-warning-on-save-polygon
Refresh Warning After Saving Polygon (Geospatial)
- Loading branch information
Showing
5 changed files
with
55 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 50 additions & 29 deletions
79
corehq/apps/geospatial/templates/geospatial/partials/saved_polygon_filter.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,54 @@ | ||
{% load i18n %} | ||
|
||
<div class="col-sm-8"> | ||
<div class="row form-horizontal"> | ||
<label for="saved-polygons" class="control-label col-sm-2"> | ||
{% trans "Filter by Saved Area" %} | ||
</label> | ||
<div class="col-sm-5" style="display:flex"> | ||
<select id="saved-polygons" | ||
class="form-control" | ||
data-bind="select2: savedPolygons,value: selectedSavedPolygonId,"> | ||
</select> | ||
<button class="btn btn-default" data-bind="click: clearSelectedPolygonFilter, visible: selectedSavedPolygonId"> | ||
<i class="fa fa-remove"></i> | ||
</button> | ||
</div> | ||
<div class="col-sm-5"> | ||
<a class="btn btn-default" data-bind="click: exportSelectedPolygonGeoJson, visible: selectedSavedPolygonId"> | ||
{% trans 'Export Area' %} | ||
</a> | ||
<button class="btn btn-danger" data-toggle="modal" data-target="#delete-saved-area-modal" | ||
data-bind="visible: selectedSavedPolygonId"> | ||
<i class="fa fa-trash"></i> | ||
{% trans 'Delete Area' %} | ||
</button> | ||
<div class="panel" id="polygon-filters"> | ||
<div class="row"> | ||
<div class="col-sm-8"> | ||
<div class="row form-horizontal"> | ||
<label for="saved-polygons" class="control-label col-sm-2"> | ||
{% trans "Filter by Saved Area" %} | ||
</label> | ||
<div class="col-sm-5" style="display:flex"> | ||
<select id="saved-polygons" | ||
class="form-control" | ||
data-bind="select2: savedPolygons,value: selectedSavedPolygonId,"> | ||
</select> | ||
<button class="btn btn-default" data-bind="click: clearSelectedPolygonFilter, visible: selectedSavedPolygonId"> | ||
<i class="fa fa-remove"></i> | ||
</button> | ||
</div> | ||
<div class="col-sm-5"> | ||
<a class="btn btn-default" data-bind="click: exportSelectedPolygonGeoJson, visible: selectedSavedPolygonId"> | ||
{% trans 'Export Area' %} | ||
</a> | ||
<button class="btn btn-danger" data-toggle="modal" data-target="#delete-saved-area-modal" | ||
data-bind="visible: selectedSavedPolygonId"> | ||
<i class="fa fa-trash"></i> | ||
{% trans 'Delete Area' %} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<button id="btnSaveDrawnArea" class="btn btn-default" style="float:right; margin-right:1em" | ||
data-bind="attr: { disabled: btnSaveDisabled }, click: saveGeoPolygon"> | ||
{% trans 'Save Area' %} | ||
</button> | ||
{% include 'geospatial/partials/delete_saved_area_modal.html' %} | ||
{% if uses_disbursement == 'true' %} | ||
<a id="btnRunDisbursement" class="col-sm-2 btn btn-primary" style="float:right; margin-right:1em" data-bind="attr: { disabled: btnRunDisbursementDisabled }"> | ||
{% trans 'Run Disbursement' %} | ||
</a> | ||
{% endif %} | ||
</div> | ||
<div class="alert alert-info" style="margin-top:10px;" data-bind="visible: shouldRefreshPage"> | ||
{% blocktrans %} | ||
Please | ||
<a href="">refresh the page</a> | ||
to apply the polygon filtering changes. | ||
{% endblocktrans %} | ||
</div> | ||
<div class="alert alert-warning" data-bind="visible: hasUrlError"> | ||
{% blocktrans %} | ||
There are too many polygons on the map. Please remove some before refreshing the page, otherwise the | ||
newly added polygons will be lost. | ||
{% endblocktrans %} | ||
</div> | ||
</div> | ||
<button id="btnSaveDrawnArea" class="btn btn-default" style="float:right; margin-right:1em" | ||
data-bind="attr: { disabled: btnSaveDisabled }, click: saveGeoPolygon"> | ||
{% trans 'Save Area' %} | ||
</button> | ||
{% include 'geospatial/partials/delete_saved_area_modal.html' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters