summaryrefslogtreecommitdiff
path: root/sbhs/templates
diff options
context:
space:
mode:
Diffstat (limited to 'sbhs/templates')
-rw-r--r--sbhs/templates/account/account_index.html2
-rw-r--r--sbhs/templates/account/home.html16
-rw-r--r--sbhs/templates/base.html1
-rw-r--r--sbhs/templates/slot/new.html56
4 files changed, 24 insertions, 51 deletions
diff --git a/sbhs/templates/account/account_index.html b/sbhs/templates/account/account_index.html
index 4b95df0..2d5789a 100644
--- a/sbhs/templates/account/account_index.html
+++ b/sbhs/templates/account/account_index.html
@@ -11,7 +11,7 @@
{{login_form.as_p}}
<input type="submit" class="btn btn-primary" value="Login">
- &nbsp;&nbsp;<a href="#">Forgot Password?</a>
+ &nbsp;&nbsp;<a href="{% url "password_reset" %}">Forgot Password?</a>
</form>
</div>
<div class="span5 pull-right">
diff --git a/sbhs/templates/account/home.html b/sbhs/templates/account/home.html
index 16d475a..fa95a26 100644
--- a/sbhs/templates/account/home.html
+++ b/sbhs/templates/account/home.html
@@ -3,26 +3,20 @@
{% block content %}
<div class="container">
<div class="row">
- {% if user.profile.is_moderator %}
- <a href="" class="btn btn-info">Show all boards</a>
- <a href="" class="btn btn-info">Show all bookings</a>
- <a href="" class="btn btn-info">Show all images</a>
- <a href="" class="btn btn-info">Test boards</a>
- <a href="" class="btn btn-info">Update MID</a>
- <a href="" class="btn btn-info">Fetch Logs</a>
- {% endif %}
<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="view-slot-nav"><a href="">View/Delete 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 'dashboard_index' %}">Dashboard</a></li>
+ {% endif %}
<br><br>
</ul>
</div>
- <script>
- document.getElementById("home-nav").classList.add("active");
+ <script type="text/javascript">
+ document.getElementById("home-nav").classList.add("active");
</script>
<div class="span12">
<h2>Welcome to Single Board Heater System Lab</h2>
diff --git a/sbhs/templates/base.html b/sbhs/templates/base.html
index 3a88c8f..c6294a6 100644
--- a/sbhs/templates/base.html
+++ b/sbhs/templates/base.html
@@ -35,7 +35,6 @@
{% endfor %}
</div>
{% endif %}
-
{% block content %}
{% endblock %}
<br><br><br>
diff --git a/sbhs/templates/slot/new.html b/sbhs/templates/slot/new.html
index 27a0400..ec999c9 100644
--- a/sbhs/templates/slot/new.html
+++ b/sbhs/templates/slot/new.html
@@ -1,5 +1,6 @@
{% extends "account/home.html" %}
{% load staticfiles %}
+{% load custom_filter %}
{% load widget_tweaks %}
{% block title %}
Book Slot
@@ -26,46 +27,22 @@
</div>
<div class="tab-content col-md-9 col-md-offset-2 main">
<div class = "tab-pane active" id="tab_a">
- <h3>Book Slot</h3>
+ <br>
+ <h4>Book future slots:</h4>
<form class = "form-horizontal" action = "" method="POST" autocomplete="off">
+ <center>
<div class = "form-group">
{% csrf_token %}
- {% for field in form %}
- {% if field.errors %}
- <div class = "control-group error">
- <label class = "control-label">
- {{field.label}}
- </label>
- <div class = "controls">
- {{field}}
- <span class = "help-inline">
- {% for error in field.errors %}
- {{error}}
- {% endfor %}
- </span>
- </div>
- </div>
- {% else %}
- <div class = "control-group">
- <div class = "col-xs-2">
- <label class = "control-label">
- {{field.label}}:
- </label>
- <div class = "control">
- {{field}}
- {% if field.help_text %}
- <p class = "help-inline">
- <small>{{field.help_text}}</small>
- </p>
- {% endif %}
- </div>
- </div>
-
- </div>
- {% endif %}
- {% endfor %}
- <input type="submit" value = "Create" class = "btn btn-info" name="" >
+ <b>Book for a given date:</b><br/>
+ {{form.as_p}}
+ <button class="btn btn-primary" type="submit" name='book_date' value='book_date'>Book Date</button><br/>
+ <center>OR</center>
+ <b>Book for current date and time</b><br/>
+
+ <button class="btn btn-primary" type="submit" name="book_now" value="book_now">Book Now</button><br/>
</div>
+ </center>
+
</form>
</div>
@@ -91,9 +68,12 @@
{% endif %}
<td>{{h.start_time}}</td>
- <td>{{h.duration}}</td>
- {%if h.start_time >= now %}
+ <td>{{h.end_time}}</td>
+ {% compare_slot_time h.start_time h.end_time now as slot_status %}
+ {%if slot_status == "pending" %}
<td><p class="label label-warning">Pending</p></td>
+ {% elif slot_status == "ongoing" %}
+ <td><p class="label label-success">Ongoing</p></td>
{% else %}
<td><p class="label label-danger">Finished </p></td>
{% endif %}