send_command_cameraVIS_1.html 3.03 KB
{% extends "base.html" %}
{% load staticfiles%}

{% block title %}
	Send Command to DDRAGO 1
{% endblock %}

{% block content %}
<html lang="en">
<head>
    <meta charset="UTF-8">

</head>
<body>
    <style>

    .conteneur
    {
        display: flex;
        flex-wrap: wrap-reverse;
        justify-content: space-between;
    }
    .element
    {

        margin: auto;
        list-style-image: none;
        font-family: 'Montserra', sans-serif;

    }

    .element h2
    {
        text-align: center;
        font-weight: normal;
    }
    .log
    {
        font-size: 1.13em;
        list-style-image: none;
        list-style-type: none;
        color: green;
        font-weight: bold;
        font-family: "Arial";
        height: 500px;
        width: 650px;
        overflow: scroll;
        background-color: black;
    }

    #id_first_command
    {
       font-size: 19px;
    }


    #submit_button
    {
        display: block;
        font-size: 20px;
        margin: auto;
    }
    #expert_mode
    {
        font-size: 15px;
    }
</style>

    <!-- TODO:Passer aux django forms une fois que la grammaire sera fixée -->

    <div class="conteneur">
        <div id="command" class="element">
            <form id=command_form method="POST" action={% url "submit_command_to_cameraVIS_1" %}>

                <label for="Command"><h2>Select the command</h2></label><br/>

               <select name="first_command" id="id_first_command">
                   <option value="Command" selected>Command :</option>
                   <option value="SET">SET</option>
                   <option value="GET">GET</option>
                   <option value="DO">DO</option>
               </select>

        </form>
        <br><br>
        <form id="command_form_expert" method="POST" action="{% url "submit_command_to_cameraVIS_1_expert" %}">
            <label for="Command"><h2>Enter the command in expert mode</h2></label><br/>
            <button id="expert_mode" type="button">Expert Mode</button>
            {% csrf_token %}
        </form>
        </div>
        <div id="logs" class="element">
    		    <div id=ddrago>
       			    <h2>DDRAGO</h2>
    			     <ul class="log" id="ddrago_r_logs">
    				    <br>
    			    </ul>
                </div>
        </div>
    </div>
        <script> var data = {{ json_str | safe }}</script>
		<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
		<script src="{% static "/js/command_control_cameraVIS_1.js" %}" type=text/javascript></script>
        <script>

            $( "#command_form" ).submit(function( event ) {
            alert( "Handler for .submit() called." );
            event.preventDefault();
            var inputElem = document.createElement('input');
            inputElem.type = 'hidden';
            inputElem.name = 'csrfmiddlewaretoken';
            inputElem.value = '{{ csrf_token }}';

            document.getElementById("command_form").appendChild(inputElem);
            $( "#command_form" ).submit();
});


        </script>


</body>
</html>
{% endblock %}