diff options
-rw-r--r-- | sbhs/templates/account/account_index.html | 4 | ||||
-rw-r--r-- | sbhs/templates/account/home.html | 12 | ||||
-rw-r--r-- | sbhs/templates/base.html | 111 | ||||
-rw-r--r-- | sbhs/templates/dashboard/all_bookings.html | 53 | ||||
-rw-r--r-- | sbhs/templates/dashboard/all_images.html | 9 | ||||
-rw-r--r-- | sbhs/templates/dashboard/dashboard_index.html | 87 | ||||
-rw-r--r-- | sbhs/templates/dashboard/fetch_logs.html | 58 | ||||
-rw-r--r-- | sbhs/templates/dashboard/profile.html | 49 | ||||
-rw-r--r-- | sbhs/templates/dashboard/show_all_boards.html | 40 | ||||
-rw-r--r-- | sbhs/templates/dashboard/test_boards.html | 145 | ||||
-rw-r--r-- | sbhs/templates/dashboard/update_mid.html | 9 | ||||
-rw-r--r-- | sbhs/templates/experiment/logs.html | 31 | ||||
-rw-r--r-- | sbhs/templates/footer.html | 68 | ||||
-rw-r--r-- | sbhs/templates/modals.html | 4 | ||||
-rw-r--r-- | sbhs/templates/nav.html | 41 | ||||
-rw-r--r-- | sbhs/templates/pages/about.html | 93 | ||||
-rw-r--r-- | sbhs/templates/pages/experiments.html | 2 | ||||
-rw-r--r-- | sbhs/templates/pages/feedback.html | 3 | ||||
-rw-r--r-- | sbhs/templates/pages/info.html | 28 | ||||
-rw-r--r-- | sbhs/templates/pages/theory.html | 4 | ||||
-rw-r--r-- | sbhs/templates/slot/new.html | 4 |
21 files changed, 640 insertions, 215 deletions
diff --git a/sbhs/templates/account/account_index.html b/sbhs/templates/account/account_index.html index 2d5789a..60fece6 100644 --- a/sbhs/templates/account/account_index.html +++ b/sbhs/templates/account/account_index.html @@ -19,7 +19,9 @@ <form action="{% url 'account_create' %}" method="POST"> {% csrf_token %} {{registration_form.as_p}} - + {% for field in registration_form %} + + {% endfor %} <input type="submit" class="btn btn-inverse" value="New User? Sign-Up"> </form> </div> diff --git a/sbhs/templates/account/home.html b/sbhs/templates/account/home.html index f2089b3..5f647bb 100644 --- a/sbhs/templates/account/home.html +++ b/sbhs/templates/account/home.html @@ -3,18 +3,6 @@ {% block content %} <div class="container"> <div class="row"> - <div class="span12" style="position: relative;top: 1.3em;"> - <ul class="nav nav-pills"> - <li id="home-nav"><a href="">Home</a></li> - <li id="book-slot-nav"><a href="{% url 'slot_new' %}">Book slot</a></li> - <li id="download-log-nav"><a href="">Download log files</a></li> - <li id="video-nav"><a href="">Show video</a></li> - {% if user.profile.is_moderator %} - <li id="admin-nav"><a href="{% url 'moderator_dashboard' %}">Moderator Dashboard</a></li> - {% endif %} - <br><br> - </ul> - </div> <script type="text/javascript"> document.getElementById("home-nav").classList.add("active"); </script> diff --git a/sbhs/templates/base.html b/sbhs/templates/base.html index c6294a6..a1e36f2 100644 --- a/sbhs/templates/base.html +++ b/sbhs/templates/base.html @@ -9,22 +9,66 @@ <link rel="stylesheet" type="text/css" href="{% static 'img/favicon.ico' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.min.css' %}"> <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-responsive.min.css' %}"> + <link rel="stylesheet" type="text/css" href="{% static 'css/base.css' %}"> <script src="{% static 'js/jquery-latest.min.js' %}"></script> <script src="{% static 'js/bootstrap.min.js' %}"></script> {% block headerfiles %} {% endblock %} - <style> - html { margin: 0; height: 100%; } - body { padding-top: 70px; position: relative; margin: 0; min-height: 88%; } - </style> - {% block style_block %} {% endblock %} </head> <body> - {% include 'nav.html' %} + {% block nav %} + <nav class="navbar navbar-fixed-top navbar-inverse"> + <div class="container"> + + <div class="navbar-header"> + <a class="navbar-brand navbar-left" href="{% url 'pages_index' %}" class="brand">Single Board Heater System Lab</a> + </div> + + <div id="navbar" class="collapse navbar-collapse"> + <ul class="nav navbar-nav navbar-right"> + {% if user.is_authenticated %} + <li id="book-slot-nav"><a href="{% url 'slot_new' %}">Book slot</a></li> + <li id="download-log-nav"><a href="{% url 'experiment_logs' %}">Download log files</a></li> + <li id="video-nav"><a href="">Show video</a></li> + {% if user.profile.is_moderator %} + <li id="admin-nav"><a href="{% url 'moderator_dashboard' %}">Moderator Dashboard</a></li> + {% endif %} + {% endif %} + <li class="nav-item dropdown"> + <a class="dropdown-toggle nav-link" id="info_dropdown" data-toggle="dropdown" href="#">SBHS InfoCentre + <span class="caret"></span></a> + <div class="dropdown-menu"> + <ul class="nav"> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#info">Info</a></li> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#theory">Theory</a><li> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#procedure">Procedure</a></li> + </ul> + </div> + </li> + + {% if user.is_authenticated %} + <li class="nav-item dropdown"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{ user.username|title }} <span class="caret"></span></a> + <div class="dropdown-menu"> + <ul class="nav"> + <li><a class="dropdown-item" href="{% url 'password_change'%}">Change Password</a></li> + <li><a>Request machine change</a></li> + <li><a href="{% url 'account_logout' %}">Logout</a></li> + </ul> + </div> + </li> + {% else %} + <li><a href="{% url 'account_enter' %}">Log In</a></li> + {% endif %} + </div><!-- /.navbar --> + </div><!-- /.container --> + </nav><!-- /.navbar --> +{% endblock %} + {% if messages %} <div class = "container"> {% for message in messages %} @@ -35,10 +79,53 @@ {% endfor %} </div> {% endif %} - {% block content %} - {% endblock %} - <br><br><br> - {% include 'footer.html' %} - {% include 'modals.html' %} + <div class="content"> + {% block content %} + {% endblock %} + </div> + + <div class="footer"> + {% block footer %} + <div class="footer-left"> + <p>Server time: <span id="timer">{% now "jS M Y h:i:s A" %}</span> + <span>Copyright © {% now "Y" %}</span></p> + </div> + + <div class="container text-center"> + <p>Designed and hosted by <a href="http://www.cdeep.iitb.ac.in/" target="_blank">Automation Lab, CDEEP</a>,<a href="http://www.iitb.ac.in" target="_blank"> IIT Bombay</a> + </div> + + <div class="container text-center"> + <a class = "text-muted credit" href="{% url 'pages_about' %}">About Us</a> + </div> + + <script> + (function(){ + var date_string = "{% now 'Y-m-d H:i:s' %}"; + var a = date_string.split(/[^0-9]/); + for(i=0;i<6;i++){a[i]=parseInt(a[i])} + window.date = new Date(a[0],a[1]-1,a[2],a[3],a[4],a[5]); + window.monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + window.ordinalize = function (i) { + var j = i % 10; + if (j == 1 && i != 11) return i + "st"; + if (j == 2 && i != 12) return i + "nd"; + if (j == 3 && i != 13) return i + "rd"; + return i + "th"; + } + window.num_padding = function(i) { + return i < 10 ? "0" + i : i; + } + var timer = function() { + window.date.setSeconds(window.date.getSeconds() + 1); + str = window.ordinalize(window.date.getDate()) + " " + window.monthNames[window.date.getMonth()] + " " + window.date.getFullYear() + " " + window.date.toLocaleTimeString().toUpperCase(); + document.getElementById("timer").innerHTML = str; + } + setInterval(timer, 1000); + })(); + </script> + + {% endblock %} + </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/sbhs/templates/dashboard/all_bookings.html b/sbhs/templates/dashboard/all_bookings.html new file mode 100644 index 0000000..810a506 --- /dev/null +++ b/sbhs/templates/dashboard/all_bookings.html @@ -0,0 +1,53 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% block title %} + All Bookings +{% endblock %} +{% block main %} + <div> + <h4>All Bookings</h4> + + {% if slots %} + <table class="table table-bordered"> + <thead> + <tr> + <th>Date</th> + <th>Slot</th> + <th>Board</th> + <th>User</th> + </tr> + </thead> + <tbody> + {% for slot in slots %} + <tr> + <td>{{slot.start_time|date:"d M Y"}}</td> + <td>{{slot.start_time|time:"H:i"}} to {{slot.end_time|time:"H:i"}}</td> + <td>{{slot.user.userboard_set.get.board.mid}}</td> + <td>{{slot.user}}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + <p>No slots have been booked. </p> + {% endif %} + + +<center> +<div class="pagination"> + <span class="step-links"> + {% if slots.has_previous %} + <a href="?page={{ slots.previous_page_number }}"class="btn btn-primary">< Previous</a> + {% endif %} + + <span class="current"> + Page {{ slots.number }} of {{ slots.paginator.num_pages }} + </span> + + {% if slots.has_next %} + <a href="?page={{ slots.next_page_number }}" class="btn btn-primary">Next ></a> + {% endif %} + </span> +</div> +</center> +</div> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/all_images.html b/sbhs/templates/dashboard/all_images.html new file mode 100644 index 0000000..102a93b --- /dev/null +++ b/sbhs/templates/dashboard/all_images.html @@ -0,0 +1,9 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% block title %} + All Images +{% endblock %} +{% block main %} + <div> + <h4>All Images</h4> + </div> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/dashboard_index.html b/sbhs/templates/dashboard/dashboard_index.html index 8dacb7a..ccbba77 100644 --- a/sbhs/templates/dashboard/dashboard_index.html +++ b/sbhs/templates/dashboard/dashboard_index.html @@ -5,101 +5,52 @@ {% endblock %} {% block headerfiles %} - <script type="{% static 'js/jquery-ui.js' %}"></script> + <script src="{% static 'js/jquery-ui.js' %}"></script> <link rel="stylesheet" type="text/css" href="{% static 'css/jquery.datetimepicker.css' %}"/> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/> + <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"/> + <script type="text/javascript" src = "https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script> {% endblock %} {% block content %} <br> <div class="row"> - <div class="col-sm-3 col-md-2 sidebar"> + <div class="col-md-2 col-md-2 sidebar"> <ul class="nav nav-sidebar nav-stacked"> <li class = "active"> - <a href="#tab_a" data-toggle="pill">Show all Boards</a> + <a href="{% url 'moderator_dashboard' %}">Show all Boards</a> </li> <li> - <a href="#tab_b" data-toggle="pill">Show all Bookings</a> + <a href="{% url 'all_bookings' %}">Show all Bookings</a> </li> <li> - <a href="#tab_c" data-toggle="pill">Show all Images</a> + <a href="{% url 'all_images' %}">Show all Images</a> </li> <li> - <a href="#tab_d" data-toggle="pill">Test Boards</a> + <a href="{% url 'test_boards' %}">Test Boards</a> </li> <li> - <a href="#tab_e" data-toggle="pill">Update MID</a> + <a href="{% url 'update_mid' %}">Update MID</a> </li> <li> - <a href="#tab_f" data-toggle="pill">Fetch Logs</a> + <a href="{% url 'fetch_logs' %}">Fetch Logs</a> </li> <li> - <a href="#tab_g" data-toggle="pill">Download Experiment Directory</a> + <a href="{% url 'logs_folder_index' %}">Download Experiment Directory</a> </li> <li> - <a href="#tab_h" data-toggle="pill">Turn On all Boards</a> + <a href="{% url 'turn_on_all_boards' %}">Turn On all Boards</a> </li> <li> - <a href="#tab_i" data-toggle="pill">Turn Off all Boards</a> + <a href="{% url 'turn_off_all_boards' %}">Turn Off all Boards</a> </li> <li> - <a href="#tab_j" data-toggle="pill">Book all Slots</a> + <a href="{% url 'book_all_suser_slots' %}">Book all Slots</a> </li> </ul> </div> - <div class="tab-content col-md-10"> - {# Div for Show all boards #} - <div class = "tab-pane active" id="tab_a"> - <h4>All Active Boards</h4> - <br> - <table class = "table table-striped"> - {% for board in all_active_boards %} - <thead> - <tr> - <th>Board MID</th> - <th>Webcam</th> - <th>Temperature Profile</th> - <th>Download Logs</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{board.mac_ids.0}}</td> - <td></td> - <td></td> - <td></td> - </tr> - </tbody> - {% endfor %} - </table> - </div> - <div class = "tab-pane" id="tab_b"> - <h4>All Bookings</h4> - </div> - <div class = "tab-pane" id="tab_c"> - <h4>All Images</h4> - </div> - <div class = "tab-pane" id="tab_d"> - <h4>Test Boards</h4> - </div> - <div class = "tab-pane" id="tab_e"> - <h4>Update MID</h4> - </div> - <div class = "tab-pane" id="tab_f"> - <h4>Fetch Logs</h4> - </div> - <div class = "tab-pane" id="tab_g"> - <h4>Download Experiment Directory</h4> - </div> - <div class = "tab-pane" id="tab_h"> - <h4>Turn On all Boards</h4> - </div> - <div class = "tab-pane" id="tab_i"> - <h4>Turn Off all Boards</h4> - </div> - <div class = "tab-pane" id="tab_j"> - <h4>Book all Slots</h4> - </div> - </div> + +<div class="col-md-8 col-md-offset-1 main"> +{% block main %} +{% endblock %} +</div> </div> - {% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/fetch_logs.html b/sbhs/templates/dashboard/fetch_logs.html new file mode 100644 index 0000000..8f870c5 --- /dev/null +++ b/sbhs/templates/dashboard/fetch_logs.html @@ -0,0 +1,58 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% load staticfiles %} +{% load custom_filter %} +{% block title %} + Fetch Logs +{% endblock %} +{% block headerfiles %} + <script src = "{% static 'js/jquery.datetimepicker.full.min.js' %}"></script> + <script type="{% static 'js/jquery-ui.js' %}"></script> + <link rel="stylesheet" type="text/css" href="{% static 'css/jquery.datetimepicker.css' %}"> + <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous"> + +{% endblock %} +{% block main %} + <div> + <h4>Filter Log files</h4> + <form class = "form-horizontal" action = "" method="POST" autocomplete="off"> + <center> + <div class = "form-group"> + {% csrf_token %} + {{form.as_p}} + <button class="btn btn-primary" type="submit" name='book_date' value='book_date'>Fetch</button><br/> + </div> + </center> + + </form> + <table class = "table table-border"> + <thead> + <tr> + <th>Sl.No</th> + <th>User</th> + <th>Filename</th> + </tr> + </thead> + <tbody> + {% for experiment in experiments %} + <tr> + <td>{{forloop.counter}}</td> + <td>{{experiment.slot.user.get_full_name}}</td> + <td><a href="{%url 'download_file' experiment.id %}">{{experiment.log}}</td> + + </tr> + {% endfor %} + </tbody> + </table> + </div> + <script type="text/javascript"> + var dateToday = new Date(); + $(function(){ + $(".datetimepicker").datetimepicker({ + format:'Y-m-d', + maxDate: dateToday, + timepicker:false, + }); + }) + </script> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/profile.html b/sbhs/templates/dashboard/profile.html new file mode 100644 index 0000000..8a055df --- /dev/null +++ b/sbhs/templates/dashboard/profile.html @@ -0,0 +1,49 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% load staticfiles %} +{% block title %} + Dashboard - Profile +{% endblock %} +{% block headerfiles %} + + <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" type="text/javascript"></script> + <script type="{% static 'js/jquery-ui.js' %}"></script> + <link rel="stylesheet" type="text/css" href="{% static 'css/jquery.datetimepicker.css' %}"/> + <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"/> + <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.css" /> + <script src="//cdnjs.cloudflare.com/ajax/libs/dygraph/2.1.0/dygraph.min.js"></script> +{% endblock %} +{% block main %} + <div class = "row"> + <div class = "span12"> + <h2>SBHS MID: {{ mid }} <small>Profile for past {{ delta_T }} instances</small></h2> + <h3>Heat</h3> + <div id="heat" style="width:800px; height: 80px"></div> + <h3>Fan</h3> + <div id="fan" style="width:800px; height: 80px"></div> + <h3>Temperature</h3> + <div id="temp" style="width:800px; height: 80px"></div> + </div> + </div> + <script> + (function(){ + var h = new Dygraph( + document.getElementById("heat"), + "{{ heat }}", + { + valueRange: [0,100] + } + ); + var f = new Dygraph( + document.getElementById("fan"), + "{{ fan }}", + { + valueRange: [0,100] + } + ); + var t = new Dygraph( + document.getElementById("temp"), + "{{ temp }}" + ); + })(); +</script> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/show_all_boards.html b/sbhs/templates/dashboard/show_all_boards.html new file mode 100644 index 0000000..e247ffe --- /dev/null +++ b/sbhs/templates/dashboard/show_all_boards.html @@ -0,0 +1,40 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% block title %} + All boards +{% endblock %} + +{% block main %} +<div class="tab-content col-md-10"> + {# Div for Show all boards #} + <div class = "tab-pane active" id="tab_a"> + <h4>All Active Boards</h4> + <br> + <table class = "table table-striped inlineTable"> + <thead> + <tr> + <th>Board MID</th> + <th>Status</th> + <th>Power Status</th> + <th>Webcam</th> + <th>Temperature Profile</th> + <th>Download Logs</th> + + </tr> + </thead> + <tbody> + {% for board in all_boards %} + <tr> + <td>{{board.mid}}</td> + <td><span style="cursor: pointer;" class = "label label-{% if board.online %}success{% else %}danger{% endif %}">{% if board.online %}Online{% else %}Offline{% endif %}</span></td> + <td><span style="cursor: pointer;" class = "label label-{% if board.online %}success{% else %}danger{% endif %}">{% if board.online %}On{% else %}Off{% endif %}</span></td> + <td><a href = "">View Image</a></td> + <td><a href = "{% url 'profile' board.mid %}">View Profile</a></td> + <td><a href = "{% url 'download_log' board.mid %}" target="_blank">Download</a></td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + </div> + +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/test_boards.html b/sbhs/templates/dashboard/test_boards.html new file mode 100644 index 0000000..11362df --- /dev/null +++ b/sbhs/templates/dashboard/test_boards.html @@ -0,0 +1,145 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% load staticfiles %} +{% load custom_filter %} +{% block title %} + Test Boards +{% endblock %} + +{% block style_block %} + <style type="text/css"> + .highlight{ + background-color: lightblue; + } + + </style> +{% endblock %} +{% block main %} +<div class = "container"> + <div class = "row"> + <div class = "span7"> + <table class = "table table-striped" id = "tableId"> + <thead> + <tr> + <th>Board MID</th> + <th>Status</th> + <th>Occupied</th> + </tr> + </thead> + <tbody> + {% for board in boards %} + <tr style="cursor:pointer;" title="Test/Monitor board" data-toggle="modal" data-target="#myModal"> + <td>{{board.mid}}</td> + <td> + <span class = "label label-{% if board.online %}success{% else %}danger{% endif %}">{% if board.online %}Online{% else %}Offline{% endif %}</span> + </td> + <td> + {% vacant_slot slot_history.start_time slot_history.end_time now as slot_status %} + {% if slot_status == "vacant" %} + <p class="label label-{% if board.online %}success{% else %}danger{% endif %}">{% if board.online %}Vacant{% else %}Not available{% endif %}</p> + {% elif slot_status == "occupied" %} + <p class = "label label-danger">Occupied</p> + {% endif %} + + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + + <!-- Modal code starts here --> + + <div id="myModal" class="modal fade test-modal" id="" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> + <h3>Test Board</h3> + </div> + <div id="orderDetails" class="modal-body"> + <div class = "input-group"> + <input type="text" class = "form-control" id = temp" disabled = "true"name=""> + <span class = "input-group-btn"> + <button class = "btn btn-primary" onclick="getTemp()">Get Temperature</button> + </span> + </div> + <br> + <div class = "input-group"> + Heater Input: <input type="number" size="3" min="0" max="250" id="heater-val"> + Fan Input: <input type="number" size="3" min="0" max="250" id="fan-val" name=""> + <span class = "input-group-btn"> + <button class = "btn btn-primary" onclick="setParams()">Set Parameters</button> + </span> + </div> + <br> + <div class = "input-group"> + <span class = "input-group-btn"> + <button class = "btn btn-primary" onclick="resetParams()">Reset Parameters</button> + </span> + </div> + </div> + <div class="modal-footer"> + <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> + </div> + </div> + </div> + </div> + + <!-- Modal code ends here --> + + <!-- Modal code starts here --> + + <div id="myModal" class="modal fade monitor-modal" id="" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button> + <h3>Monitor Experiment</h3> + </div> + <div id="orderDetails" class="modal-body"> + <div class = "input-group"> + <strong><p id = "username"></p></strong> + <p id = "log-data" style="word-spacing:4em"></p> + <span class = "input-group-btn"> + <button class = "btn btn-primary" onclick="getLogs()">Refresh Logs</button> + </span> + </div> + </div> + <div class="modal-footer"> + <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> + </div> + </div> + </div> + </div> + + <!-- Modal code ends here --> + </div> +</div> + +<script type="text/javascript"> + $("#tableId").on("click", "tr", function(e) { + $("#tableId").find("tr.highlight").removeClass("highlight"); + $(this).addClass("highlight"); + + label = e.currentTarget.getElementsByClassName("label")[1]; + console.log(label) + isSelectedMachineVacant = label.className.indexOf("label-success") > -1; + console.log(isSelectedMachineVacant); + + if (isSelectedMachineVacant) { + $("#temp").val(""); + $("#fan-val").val(""); + $("#heater-val").val(""); + $(".test-modal").modal('show'); + } + else { + $(".test-modal").modal('hide'); + $(".montor-modal").modal('show'); + getLogs(); + } + }); + function getLogs(){ + console.log('hello from getLogs'); + } +</script> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/dashboard/update_mid.html b/sbhs/templates/dashboard/update_mid.html new file mode 100644 index 0000000..ea2eb4d --- /dev/null +++ b/sbhs/templates/dashboard/update_mid.html @@ -0,0 +1,9 @@ +{% extends 'dashboard/dashboard_index.html' %} +{% block title %} + Update MID +{% endblock %} +{% block main %} + <div> + <h4>Update MID</h4> + </div> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/experiment/logs.html b/sbhs/templates/experiment/logs.html new file mode 100644 index 0000000..7e118ac --- /dev/null +++ b/sbhs/templates/experiment/logs.html @@ -0,0 +1,31 @@ +{% extends "base.html" %} +{% block title %} + Download Previous log files +{% endblock %} +{% block content %} +<div class = "container"> + <div class = "row"> + <h3>Download previous log files</h3> + <table class = "table table-condensed"> + <thead> + <tr> + <th>Date</th> + <th>Slot timings</th> + <th>Filename</th> + <th>Download</th> + </tr> + </thead> + <tbody> + {% for exp in experiment %} + <tr> + <td>{{exp.slot.start_time|date:"M d, Y"}}</td> + <td>{{exp.slot.start_time|time}} -- {{exp.slot.end_time|time}} </td> + <td>{{exp.logname}}</td> + <td><a href="{% url 'experiment_logs' exp.slot.id %}" target="_blank">Download</a></td> + </tr> + {% endfor %} + </tbody> + </table> + </div> +</div> +{% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/footer.html b/sbhs/templates/footer.html index f5782d6..fe7ae4a 100644 --- a/sbhs/templates/footer.html +++ b/sbhs/templates/footer.html @@ -1,43 +1,29 @@ -<div class="wrapper" style="position: absolute; bottom: 0; right: 0; width: 100%;"> - <div class="container"> - <div class="navbar"> - <ul class="nav pull-right"> - <li><a href="#"><b>External links</b></a></li> - <li><a href="http://www.iitb.ac.in/" target="_blank">IIT Bombay</a></li> - <li><a href="http://www.vlab.co.in/" target="_blank">Virtual Labs</a></li> - <li><a href="http://www.spoken-tutorial.org/" target="_blank">Spoken Tutorials</a></li> - <li><a href="http://www.co-learn.in/" target="_blank">Co-learn</a></li> - <li><a href="http://www.nex-robotics.com/" target="_blank">Nex Robotics</a></li> - <li><a href="http://sbhs.os-hardware.in/forum" target="_blank">SBHS Forum</a></li> - <li><a href="http://www.cdeep.iitb.ac.in/" target="_blank">CDEEP</a></li> - </ul> - </div> - <small style="float: right; font-size: 10px; margin: -8px 10px 2px 0;">Server time: <span id="timer">{% now "jS M Y h:i:s A" %}</span>. Copyright © 2014 <a href="www.iitb.ac.in" target="_blank">www.iitb.ac.in</a>. Designed and hosted by <a href="http://www.cdeep.iitb.ac.in/" target="_blank">Automation Lab, CDEEP, IIT Bombay</a></small> +<!-- Footer --> +<footer class="page-footer font-small pt-4"> + + <!-- Footer Links --> + <div class="container-fluid text-center text-md-left"> + + <!-- Grid row --> + <div class="row"> + <hr class="clearfix w-100 d-md-none pb-3"> + + <!-- Grid column --> + <div class="col-md-3 mb-md-0 mb-3"> + <!-- Links --> + <h5 class="text-uppercase"</h5> + </div> + <!-- Grid column --> + </div> + <!-- Grid row --> + + </div> + <!-- Footer Links --> + + <!-- Copyright --> + <div class="footer-copyright text-center py-3"><small style="float: right; font-size: 10px; margin: 4em -7em 2px 0;">Server time: <span id="timer">{% now "jS M Y h:i:s A" %}</span>. Copyright © {% now "Y" %} <a href="www.iitb.ac.in" target="_blank">www.iitb.ac.in</a>. Designed and hosted by <a href="http://www.cdeep.iitb.ac.in/" target="_blank">Automation Lab, CDEEP, IIT Bombay</a></small> </div> -</div> + <!-- Copyright --> -<script> -(function(){ - var date_string = "{% now 'Y-m-d H:i:s' %}"; - var a = date_string.split(/[^0-9]/); - for(i=0;i<6;i++){a[i]=parseInt(a[i])} - window.date = new Date(a[0],a[1]-1,a[2],a[3],a[4],a[5]); - window.monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; - window.ordinalize = function (i) { - var j = i % 10; - if (j == 1 && i != 11) return i + "st"; - if (j == 2 && i != 12) return i + "nd"; - if (j == 3 && i != 13) return i + "rd"; - return i + "th"; - } - window.num_padding = function(i) { - return i < 10 ? "0" + i : i; - } - var timer = function() { - window.date.setSeconds(window.date.getSeconds() + 1); - str = window.ordinalize(window.date.getDate()) + " " + window.monthNames[window.date.getMonth()] + " " + window.date.getFullYear() + " " + window.date.toLocaleTimeString().toUpperCase(); - document.getElementById("timer").innerHTML = str; - } - setInterval(timer, 1000); -})(); -</script>
\ No newline at end of file + </footer> + <!-- Footer --> diff --git a/sbhs/templates/modals.html b/sbhs/templates/modals.html index d23f879..2381d74 100644 --- a/sbhs/templates/modals.html +++ b/sbhs/templates/modals.html @@ -5,11 +5,11 @@ <h3>Change Password</h3> </div> <div class="modal-body"> - <p>Please click following button to send password change link to your email address.</p> + <p>Please click following button to reset password.</p> </div> <div class="modal-footer"> <a data-dismiss="modal" aria-hidden="true" class="btn">Close</a> - <a href="" class="btn btn-primary">Send password change link</a> + <a href="{% url 'password_reset' %}" class="btn btn-primary">Reset Password</a> </div> </div> diff --git a/sbhs/templates/nav.html b/sbhs/templates/nav.html index 28f7738..e69de29 100644 --- a/sbhs/templates/nav.html +++ b/sbhs/templates/nav.html @@ -1,41 +0,0 @@ -<div class="navbar navbar-inverse navbar-fixed-top"> - <div class="navbar-inner"> - <div class="container"> - {% if user.is_authenticated %} - <a href="{% url 'account_enter' %}" class="brand">Single Board Heater System Lab</a> - {% else %} - <a href="{% url 'pages_index' %}" class="brand">Single Board Heater System Lab</a> - {% endif %} - - - <ul class="nav pull-right"> - {% if user.is_authenticated %} - <li class="dropdown"> - <a class="dropdown-toggle" data-toggle="dropdown" href="#">Welcome, {{ user.username }} <b class="caret"></b></a> - <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> - <li><a href="#passwordModal" role="button" data-toggle="modal">Change Password</a></li> - <li><a href="#machineModal" role="button" data-toggle="modal">Request machine change</a></li> - <li><a href="{% url 'account_logout' %}">Logout</a></li> - </ul> - </li> - {% else %} - <li><a href="{% url 'account_enter' %}">Login / Register</a></li> - {% endif %} - </ul> - </div> - </div> - <div class="navbar-inner"> - <div class="container"> - <ul class="nav pull-right"> - <li><a href="{% url 'pages_info' %}">SBHS InfoCentre</a></li> - <li><a href="{% url 'pages_downloads' %}" target="_blank">Downloads</a></li> - <li><a href="{% url 'pages_theory' %}">Theory</a></li> - <li><a href="{% url 'pages_procedure' %}">Procedure</a></li> - <li><a href="{% url 'pages_experiments' %}">Experiments</a></li> - <li><a href="#">Quiz</a></li> - <li><a href="{% url 'pages_feedback' %}">Feedback / Contact Us</a></li> - <li><a href="{% url 'pages_about' %}">About Us</a></li> - </ul> - </div> - </div> -</div>
\ No newline at end of file diff --git a/sbhs/templates/pages/about.html b/sbhs/templates/pages/about.html index 699fdd7..5768e43 100644 --- a/sbhs/templates/pages/about.html +++ b/sbhs/templates/pages/about.html @@ -4,24 +4,23 @@ {% block content %} <div class="container"> <div class="row"> - {% if user.is_authenticated %} - {% include 'account/sub_nav.html' %} - {% endif %} <div class="span12"> - <div class="page-header"> - <div class="span1" style="margin-left: 0; margin-right: 20px;"> + <div class="span1" style="margin-left: 0; margin-right: 50px; margin-bottom: 30px"> <img src="{% static 'img/iitbLogo.png' %}" alt="IITB"> </div> - <h1>About us</h1> - <p>SBHS Virtual Labs Team</p> - </div> + <div style=""> + <h1>About us</h1> + <p>SBHS Virtual Labs Team</p> + </div> + + </div> <div class="span2"> <img src="{% static 'img/kannan.jpg' %}" alt="Prof. Kannan Moudgalya"> <b>Principal Investigator</b><br> Prof. Kannan Moudgalya </div> - <div class="span10"> + <div class="span9"> <p style="text-align:justify"> Prof. Kannan M. Moudgalya received a B.Tech degree in chemical engineering from IIT Madras, a Master of Electrical Engineering from Rice University and a Ph.D (Chemical Engineering) degree, also from Rice University. He has been a professor at IIT Bombay for 22 years. He spent one year at the University of Alberta as a visiting professor. <br><br> @@ -36,25 +35,63 @@ </div> </div> <div class="row"> - <div class="span10 offset2"> - <br> - <h3>SBHS Team</h3> - <ul> - <li>Inderpreet Arora</li> - <li>Rupak Rokade</li> - <li>Kaushik Venkata Belusonti</li> - <li>Prashant Shah</li> - <li>Victor Chakroborty</li> - <li>Shalini Shrivastava</li> - <li>Rakhi R</li> - <li>Sushant Poojary</li> - <li>Tanuj Bhojwani</li> - <li>Sitesh Patel</li> - <li>Ankit Bahuguna</li> - <li>Amol Mandhane</li> - <li>Akash Chavan</li> - </ul> - </div> + <table class = "table table-striped"> + <thead> + <tr> + <th>SBHS Team</th> + <th>SBHS Web Team</th> + </tr> + </thead> + <tbody> + <tr> + <td> + <ul> + <li>Inderpreet Arora</li> + <li>Rupak Rokade</li> + <li>Kaushik Venkata Belusonti</li> + <li>Prashant Shah</li> + <li>Victor Chakroborty</li> + <li>Shalini Shrivastava</li> + <li>Rakhi R</li> + <li>Sushant Poojary</li> + <li>Tanuj Bhojwani</li> + <li>Sitesh Patel</li> + <li>Ankit Bahuguna</li> + </ul> + </td> + <td> + <ul> + <li>Amol Mandhane</li> + <li>Mahesh Gudi</li> + <li>Akash Chavan</li> + </ul> + </td> + </tr> + </tbody> + </table> </div> </div> +<footer class="footer" style="position: fixed; bottom: 0; right: 0; width: 100%; height: 60px;"> + <div class="container"> + <div class="navbar"> + <ul class="nav navbar-nav navbar-right"> + <li><a href="#"><b>External links</b></a></li> + <li><a href="http://www.iitb.ac.in/" target="_blank">IIT Bombay</a></li> + <li><a href="http://www.vlab.co.in/" target="_blank">Virtual Labs</a></li> + <li><a href="http://www.spoken-tutorial.org/" target="_blank">Spoken Tutorials</a></li> + <li><a href="http://www.co-learn.in/" target="_blank">Co-learn</a></li> + <li><a href="http://www.nex-robotics.com/" target="_blank">Nex Robotics</a></li> + <li><a href="http://sbhs.os-hardware.in/forum" target="_blank">SBHS Forum</a></li> + <li><a href="http://www.cdeep.iitb.ac.in/" target="_blank">CDEEP</a></li> + </ul> + </div> + + <p>Feedback / Contact Us</p> + <p> + <h5>Write a mail to <a href="mailto:sbhs@os-hardware.in">sbhs[at]os-hardware[dot]in</a> to provide a feedback on SBHS virtual lab experience. If you have any questions, please use the <a href="http://sbhs.os-hardware.in/forum" target="_blank">forum</a>. + </h5> + </p> + </div> +</footer> + {% endblock %}
\ No newline at end of file diff --git a/sbhs/templates/pages/experiments.html b/sbhs/templates/pages/experiments.html index f3d9fe1..ba2ba68 100644 --- a/sbhs/templates/pages/experiments.html +++ b/sbhs/templates/pages/experiments.html @@ -6,7 +6,7 @@ <div class="container"> <div class="row"> {% if user.is_authenticated %} - {% include 'account/sub_nav.html' %} + {% endif %} <div class="span12"> <h2>Experiments</h2> diff --git a/sbhs/templates/pages/feedback.html b/sbhs/templates/pages/feedback.html index 736f5a4..b58c727 100644 --- a/sbhs/templates/pages/feedback.html +++ b/sbhs/templates/pages/feedback.html @@ -4,9 +4,6 @@ {% block content %} <div class="container"> <div class="row"> - {% if user.is_authenticated %} - {% include 'account/sub_nav.html' %} - {% endif %} <div class="span12"> <h2>Feedback / Contact Us</h2> <br> diff --git a/sbhs/templates/pages/info.html b/sbhs/templates/pages/info.html index 0d68339..0dffbbd 100644 --- a/sbhs/templates/pages/info.html +++ b/sbhs/templates/pages/info.html @@ -14,7 +14,7 @@ </div> </div> <div class="row"> - <div class="span8"> + <div class="span8" id="info"> <p style="text-align:justify"> Welcome to SBHS Virtual Labs. Here you can remotely access the Single Board Heater Systems (SBHS) hosted at IIT Bombay, and perform various experiments using it. <br><br> @@ -31,6 +31,32 @@ <li>Launch Scilab, load the appropriate code and start experimenting remotely!</li> </ol> </div> + <div class="span12" id="theory"> + <h2>Theory</h2> + <br> + <br> + <iframe src="{% static 'data/theory.pdf' %}" width="100%" height="900px" ></iframe> + <br> + </div> + <div class="span12" id="procedure"> + <h2>Procedure</h2> + <h4> + <strong>See the spoken tutorial on how to use SBHS virtual labs</strong> + </h4> + <center> + <div class="embed-responsive embed-responsive-16by9"> + <iframe width="500" height="300" src="https://www.youtube.com/embed/Ax7lYwQctog" frameborder="0" allowfullscreen></iframe> + </div> + </center><br> + <h4> + <strong>For more information please read the pdf</strong> + </h4> + <center> + <div class="embed-responsive embed-responsive-16by9"> + <iframe src="{% static 'data/procedure.pdf' %}" width="100%" height="900px"></iframe><br> + </div> + </center> + </div> </div> </div> {% endblock %} diff --git a/sbhs/templates/pages/theory.html b/sbhs/templates/pages/theory.html index e94e10d..019b2c0 100644 --- a/sbhs/templates/pages/theory.html +++ b/sbhs/templates/pages/theory.html @@ -5,9 +5,7 @@ <div class="container"> <div class="row"> - {% if user.is_authenticated %} - {#{% include 'account/sub_nav.html' %}#} - {% endif %} + <div class="span12"> <h2>Theory</h2> <br> diff --git a/sbhs/templates/slot/new.html b/sbhs/templates/slot/new.html index f2464fa..2713396 100644 --- a/sbhs/templates/slot/new.html +++ b/sbhs/templates/slot/new.html @@ -11,7 +11,7 @@ <script type="{% static 'js/jquery-ui.js' %}"></script> <link rel="stylesheet" type="text/css" href="{% static 'css/jquery.datetimepicker.css' %}"> - <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> + <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"> {% endblock %} <br> <div class="row"> @@ -75,7 +75,7 @@ {% elif slot_status == "ongoing" %} <td><p class="label label-success">Ongoing</p></td> {% else %} - <td><p class="label label-danger">Finished </p></td> + <td><p class="label label-danger">Finished</p></td> {% endif %} </tr> {% endfor %} |