forked from Map-A-Droid/MAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Routecalc in MADmin (Map-A-Droid#643)
* Routecalc in MADmin Routecalcs are now editable in MADmin. A legend has been added to the area page to describe each button
- Loading branch information
1 parent
d61d407
commit d00d4ee
Showing
5 changed files
with
136 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{% extends "settings.html" %} | ||
|
||
{% block header %} | ||
{{ super() }} | ||
{% endblock %} | ||
|
||
{% block scripts %} | ||
{{ super() }} | ||
<script type="text/javascript" src="{{ url_for('static', filename='js/madmin_settings.js') }}"></script> | ||
<script> | ||
$(document).ready(function () { | ||
$("#submit").click(function() { | ||
$.blockUI({ message: '<img src="{{ url_for('static', filename='loading.gif') }}" width="100px" /><br /><h2>Saving {{ subtab }}...</h2>' }); | ||
save_data = get_save_data(); | ||
if(isEmptyObj(save_data) != false) { | ||
alert('No changes have been made'); | ||
window.location.replace('{{ redirect }}'); | ||
} else { | ||
process_api_request("{{ uri }}", "{{ method }}", "{{ redirect }}"); | ||
} | ||
}); | ||
}); | ||
|
||
function get_routefile_definition() { | ||
var routefile = []; | ||
$.each($("#routefile").val().trim().split("\n"), function() { | ||
if(this.length > 0) { | ||
routefile.push(this); | ||
} | ||
}); | ||
return routefile; | ||
} | ||
|
||
</script> | ||
{% endblock %} | ||
|
||
{% block content %} | ||
{{ super() }} | ||
|
||
<h1 class="display-4">Routecalc for {{ areaname }}</h1> | ||
<div class="row"> | ||
<div class="col-sm"> | ||
<div class="form-group"> | ||
<label for="routefile">routefile</label> | ||
<textarea data-callback='get_routefile_definition' rows=20 class="form-control" id="routefile" name="routefile" value="{{ element.routefile }}" data-default="{{ element.routefile }}">{{ element.routefile|join('\n') }}</textarea> | ||
<small class="form-text text-muted">Route stops</small> | ||
</div> | ||
<button type="button" id="submit" class="btn btn-success btn-lg btn-block">Save</button> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
|
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