pedestal_conf_edit.html
50 lines
| 1.6 KiB
| text/html
|
HtmlDjangoLexer
|
r166 | {% extends "dev_conf_edit.html" %} | |
r335 | {% load bootstrap4 %} | ||
|
r166 | {% load static %} | |
r346 | {% block extra-head %} | ||
<style type="text/css"> | |||
/* show the move cursor as the user moves the mouse over the panel header.*/ | |||
.panel-default { cursor: move; } | |||
</style> | |||
<script src="{% static 'js/jquery-ui.min.js' %}"></script> | |||
r335 | |||
r346 | {% endblock %} | ||
r335 | |||
|
r166 | {% block content %} | |
<form class="form" method="post"> | |||
{% csrf_token %} | |||
r346 | {% bootstrap_form form layout='horizontal' size='medium' %} | ||
|
r166 | <div style="clear: both;"></div> | |
<br> | |||
<div class="pull-right"> | |||
<button type="button" class="btn btn-primary" onclick="{% if previous %}window.location.replace('{{ previous }}');{% else %}history.go(-1);{% endif %}">Cancel</button> | |||
<button type="submit" class="btn btn-primary">{{button}}</button> | |||
</div> | |||
</form> | |||
{% endblock %} | |||
r369 | |||
{% block extra-js %} | |||
<script type="text/javascript"> | |||
$("#id_mode").change(function() { | |||
if ($("#id_mode").val()=="position") { | |||
$("#id_angle").removeAttr('disabled'); | |||
$("#id_speed").attr('disabled','disabled'); | |||
$("#id_max_value").attr('disabled','disabled'); | |||
$("#id_min_value").attr('disabled','disabled'); | |||
} else if ($("#id_mode").val()=="speed") { | |||
$("#id_speed").removeAttr('disabled'); | |||
$("#id_angle").attr('disabled','disabled'); | |||
$("#id_max_value").attr('disabled','disabled'); | |||
$("#id_min_value").attr('disabled','disabled'); | |||
} else if ($("#id_mode").val()=="table" ) { | |||
$("#id_speed").removeAttr('disabled'); | |||
$("#id_angle").removeAttr('disabled'); | |||
$("#id_max_value").removeAttr('disabled'); | |||
$("#id_min_value").removeAttr('disabled'); | |||
} | |||
}); | |||
</script> | |||
{% endblock%} | |||
r346 |