diff options
author | coderick14 | 2017-05-22 12:30:37 +0530 |
---|---|---|
committer | coderick14 | 2017-05-22 12:30:37 +0530 |
commit | 498468e0a2b0989dd2a094436e6e83ce62d50902 (patch) | |
tree | 636d4b0da533cc2a8bb649435649236fb7763dee /templates/admin/testexp.html | |
parent | b3e92855f4e3a1cba0e3ed5b1dd0361e5d19226c (diff) | |
download | SBHS-2018-Rpi-498468e0a2b0989dd2a094436e6e83ce62d50902.tar.gz SBHS-2018-Rpi-498468e0a2b0989dd2a094436e6e83ce62d50902.tar.bz2 SBHS-2018-Rpi-498468e0a2b0989dd2a094436e6e83ce62d50902.zip |
Create template for admin testing
Diffstat (limited to 'templates/admin/testexp.html')
-rw-r--r-- | templates/admin/testexp.html | 116 |
1 files changed, 60 insertions, 56 deletions
diff --git a/templates/admin/testexp.html b/templates/admin/testexp.html index 3a7d85c..5b9c1d5 100644 --- a/templates/admin/testexp.html +++ b/templates/admin/testexp.html @@ -5,82 +5,86 @@ <div class="container"> <div class="row"> {% include "account/sub_nav.html" %} - <div class="span12"> + <div style="margin-left: 30px"> {% include "admin/sub_nav.html" %} - <table id="tableId" class="table table-bordered table-condensed"> + <h1>Board status</h1> + </div> + <div class="span7"> + <table class="table table-bordered" id="tableId"> <thead> <tr> - <th>Date</th> - <th>Slot</th> - <th>Board</th> - <th>User</th> + <th>Board MID</th> + <th>Status</th> </tr> </thead> <tbody> - {% for b in bookings %} + {% for b in boards %} <tr> - <td>{{ b.booking_date }}</td> - <td>{{ b.slot }}</td> - <td>{{ b.account.board.mid }}</td> - <td>{{ b.account.name }}</td> + <td>{{ b.mid }}</td> + <td><span class="label label-{% if b.online %}success{% else %}important{% endif %}">{% if b.online %}Online{% else %}Offline{% endif %}</span></td> </tr> {% endfor %} </tbody> </table> - </div> + <div class="span5"> + <div> + <input type="text" id="temp" readonly="true"><br/> + <button class="btn btn-primary" onclick="getTemp()">Get Temperature</button> + </div> + <br><br> + + <form name="set" action="" method="POST"> + <div> + Heater Input: <input type="number" size="3" min="0" max="250" name="Heater_Input"><br/> + Fan Input:<input type="number" size="3" min="0" max="250" name="Fan_Input" style="margin-left: 20px"><br/> + <input type="submit" class="btn btn-primary" value="Set Parameters"> + <br><br> + </div> + </form> + <br><br> + + <form name="reset" action="" method="POST"> + <div> + <input type="submit" class="btn btn-primary" value="Reset Parameters"> + </div> + </form> + + </div> + </div> </div> +<style type="text/css"> + .highlight { + background-color: lightblue; + } +</style> <script> -function addRowHandlers() { - var table = document.getElementById("tableId"); - var rows = table.getElementsByTagName("tr"); - for (i = 0; i < rows.length; i++) { - var currentRow = table.rows[i]; - var createClickHandler = + var selected_mid = -1; + function addRowHandlers() { + var table = document.getElementById("tableId"); + var rows = table.getElementsByTagName("tr"); + for (i = 0; i < rows.length; i++) { + var currentRow = table.rows[i]; + var createClickHandler = function(row) { return function() { - var cell = row.getElementsByTagName("td")[2]; - var id = cell.innerHTML; - alert("id:" + id); - }; + var cell = row.getElementsByTagName("td")[0]; + selected_mid = cell.innerHTML; + }; }; - - currentRow.onclick = createClickHandler(currentRow); + currentRow.onclick = createClickHandler(currentRow); + } } -} -</script> -<div align="right"> -<input type="number" step="0.1" id="temp"> - -<button onclick="getTemp()">Get Temperature</button> -<script> -function getTemp() { - document.getElementById("field2").value = ; -} -<br> <br> + function getTemp() { + document.getElementById("field2").value = 0; + } + $("#tableId").on("click", "tr", function(e) { + $("#tableId").find("tr.highlight").removeClass("highlight"); + $(this).addClass("highlight"); + }); + addRowHandlers(); </script> -</div> - - -<form name="reset" action="" method="POST"> -<div align="right"> -<br><br> -<input type="hidden" value=100> -<input type="hidden" value=100> -<input type="submit" value="Reset Parameters"> -<br><br> -</div> -</form> - -<form name="set" action="" method="POST"> -<div align="right"> -Heater Input:<input type="number" size="3" name="Heater_Input"> -Fan Input:<input type="number" size="3" name="Fan_Input"> -<input type="submit" value="Set Parameters"> -<br><br> -</div> -</form> {% endblock %} |