summaryrefslogtreecommitdiff
path: root/workshop_app/templates
diff options
context:
space:
mode:
authorpnshiralkar2020-05-05 12:11:12 +0530
committerpnshiralkar2020-05-05 12:11:12 +0530
commit0fd8703ca8e0b4caf02df30d6e63320fe6f98338 (patch)
tree4203677d5afaff90b48edffc3863b2d6d9fda958 /workshop_app/templates
parentae1b1252f203b9c02139f4fe4d1f097af7952a44 (diff)
downloadworkshop_booking-0fd8703ca8e0b4caf02df30d6e63320fe6f98338.tar.gz
workshop_booking-0fd8703ca8e0b4caf02df30d6e63320fe6f98338.tar.bz2
workshop_booking-0fd8703ca8e0b4caf02df30d6e63320fe6f98338.zip
My workshops view for coordinator done
Diffstat (limited to 'workshop_app/templates')
-rw-r--r--workshop_app/templates/workshop_app/my_workshops.html190
-rw-r--r--workshop_app/templates/workshop_app/workshop_status.html234
2 files changed, 253 insertions, 171 deletions
diff --git a/workshop_app/templates/workshop_app/my_workshops.html b/workshop_app/templates/workshop_app/my_workshops.html
index b6e3731..b5b4add 100644
--- a/workshop_app/templates/workshop_app/my_workshops.html
+++ b/workshop_app/templates/workshop_app/my_workshops.html
@@ -1,203 +1,65 @@
{% extends "workshop_app/base.html" %}
{% block title %}
- Workshop Status
+ My Workshops
{% endblock %}
-{% block extra-dependencies %}
- <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
- <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
-{% endblock %}
-{% block extra-custom-scripts %}
- <script>
- //ToolTip popup function on-hover
- $(document).ready(function () {
- $('[data-toggle="popover"]').popover({
- placement: 'top',
- trigger: 'hover'
- });
- });
-
- //ToolTip popup function on-hover
- $(document).ready(function () {
- $('[data-toggle="popinfo"]').popover({
- placement: 'top',
- trigger: 'hover'
- });
- });
-
- // Change date modal
- function changeDate(date) {
- var previous_date = new Date(date);
- var dateToday = new Date();
- var upto = new Date();
-
- previous_date.setDate(previous_date.getDate() + 1);
- upto.setFullYear(dateToday.getFullYear() + 1);
-
- if (date[0] == 'P') {
- var counter = date.split(" ");
- var id = counter.slice(-1).pop();
- counter = '.pDate' + id
- $(counter).datepicker({
- changeMonth: true,
- changeYear: true,
- minDate: dateToday,
- maxDate: upto,
- dateFormat: "yy-mm-dd",
- });
- $(".ui-dialog-content").dialog("close");
- $('.myDialogP' + id).dialog();
-
- } else {
- var counter = date.split(" ");
- var id = counter.slice(-1).pop();
- counter = '.rDate' + id;
- $(counter).datepicker({
- changeMonth: true,
- changeYear: true,
- minDate: dateToday,
- maxDate: upto,
- dateFormat: "yy-mm-dd",
- });
- $(".ui-dialog-content").dialog("close");
- $('.myDialogR' + id).dialog();
-
- }
- };
-
- </script>
-{% endblock %}
-
-
{% block content %}
{% if workshops %}
- <h3 align="center" style="color:#2952a2;">The status of your workshops </h3>
+ <h3 class="text-center" style="color:#2952a2;">The status of your workshops </h3>
<br>
<!-- Accepted View -->
+
<br>
<div class="container">
- <h3 align="center" style="color: #04a9cf;"><strong>Workshops Accepted</strong></h3>
+ <h3 class="text-center" style="color: #04a9cf;"><strong>Workshops Accepted</strong></h3>
<table class="table table-striped">
<thead>
<tr>
- {% if request.user.profile.position == 'instructor' %}
- <th>Coordinator Name</th>
- <th>Institute</th>
- {% else %}
- <th>Instructor Name</th>
- {% endif %}
+ <th>Instructor Name</th>
<th>Workshop Name</th>
<th>Workshop Day</th>
<th>Status</th>
</tr>
</thead>
- {% csrf_token %}
+
{% for workshop in workshops %}
<tbody>
<tr>
- {% if workshop.status == 1 and workshop.workshop_type %}
- {% if request.user.profile.position == 'instructor' %}
- <td>
- <a href="{{ URL_ROOT }}/view_profile/{{ workshop.coordinator.profile.user.id }}">
- {{ workshop.coordinator.get_full_name }}</a></td>
- <td>{{ workshop.coordinator.profile.institute }}</td>
- {% else %}
- <td>{{ workshop.instructor.get_full_name }}</td>
- {% endif %}
+ {% if workshop.status %}
+ <td>{{ workshop.instructor.get_full_name }}</td>
<td>{{ workshop.workshop_type |capfirst }}</td>
- {% if workshop.date > today %}
- <td>{{ workshop.date | date }}
- <span class="material-icons" style="cursor:pointer;" data-toggle="popinfo"
- title="Note"
- data-content="Click here to change date"
- class="datepicker"
- onclick="changeDate('R,{{ workshop.date| safe }}, {{ forloop.counter }}')">event</span>
- <div class="myDialogR{{ forloop.counter }}" style="display: none;"
- title="Select New Date">
- <form method="post">
- <input type="text" name="new_date" class="rDate{{ forloop.counter }}"/><br>
- <input type="hidden" name="action" value="change_date">
- <input type="hidden" name="workshop_id" value="{{ workshop.id }}">
- <input type="hidden" name="cid" value="{{ workshop.coordinator.id }}">
- {% csrf_token %}
- <button class="btn btn-primary btn-xs" type="submit">Save</button>
- </form>
- </div>
- </td>
- {% else %}
- <td>{{ workshop.date | date }}</td>
- {% endif %}
+ <td>{{ workshop.date | date }}</td>
<td><span class="badge badge-success">{{ workshop.get_status }}</span></td>
{% endif %}
</tr>
</tbody>
-
{% endfor %}
</table>
</div>
-
<!-- Proposed View -->
+
<br>
<div class="container">
-
- {% if request.user.profile.position == 'instructor' %}
- <h3 align="center" style="color: #04a9cf;"><strong>Workshops Proposed By Coordinators</strong>
- </h3>
- {% else %}
- <h3 align="center" style="color: #04a9cf;"><strong>Workshops Proposed By Me</strong></h3>
- {% endif %}
+ <h3 class="text-center" style="color: #04a9cf;"><strong>Workshops Proposed By Me</strong></h3>
<table class="table table-striped">
<thead>
<tr>
- {% if request.user.profile.position == 'instructor' %}
- <th>Coordinator Name</th>
- <th>Institute</th>
- {% else %}
-
- {% endif %}
<th>Workshop Name</th>
<th>Workshop Day</th>
<th>Status</th>
- {% if request.user.profile.position == 'instructor' %}
- <th>Action</th>
- {% endif %}
</tr>
</thead>
- {% csrf_token %}
{% for workshop in workshops %}
<tbody>
<tr>
- {% if workshop.status == 0 and workshop.tnc_accepted %}
- {% if request.user.profile.position == 'instructor' %}
-
- <td>
- <a href="{{ URL_ROOT }}/view_comment_profile/{{ workshop.coordinator.profile.user.id }}">
- {{ workshop.coordinator.get_full_name }}</a></td>
- <td>{{ workshop.coordinator.profile.institute }}</td>
- {% endif %}
+ {% if not workshop.status and workshop.tnc_accepted %}
<td>{{ workshop.workshop_type }}</td>
<td>{{ workshop.date | date }}</td>
-
<td><span class="badge badge-warning">{{ workshop.get_status }}</span></td>
- {% if request.user.profile.position == 'instructor' and workshop.status == 0 %}
- <td>
- <form method="post">
- <input type="hidden" name="action" value="accept">
- <input type="hidden" name="workshop_id" value="{{ workshop.id }}">
- {% csrf_token %}
- <button class="btn btn-primary btn-sm" id="book-btn" data-toggle="popover"
- title="Please Note"
- data-content="Once Accepted you can't Reject, you have to personally contact the Coordinator if the workshop is to be cancelled">
- Accept
- </button>
- </form>
- </td>
- {% endif %}
{% endif %}
</tr>
</tbody>
@@ -206,29 +68,15 @@
</table>
</div>
-
-
{% else %}
- {% if request.user.profile.position == 'instructor' %}
- <div class="container">
- <div class="jumbotron">
- <h1>Welcome {{ user.first_name }}</h1>
- <p>Your workshop related information will be shown here, Please navigate to <b>Workshop list</b> and
- depending upon
- your expertise and availability create a workshop by going to
- <b>Create Workshop</b>.</p>
- </div>
- </div>
- {% else %}
- <div class="container">
- <div class="jumbotron">
- <h1>Welcome {{ user.first_name }}</h1>
- <p>Information Related to your workshops will be shown here, you can also
- propose a Workshop as per your available date in <strong>Workshops > Propose a Workshop
- tab</strong> .</p>
- </div>
+ <div class="container">
+ <div class="jumbotron">
+ <h1>Welcome {{ user.first_name }}</h1>
+ <p>Information Related to your workshops will be shown here, you can also
+ propose a Workshop as per your available date in <strong>Workshops > Propose a Workshop
+ tab</strong> .</p>
</div>
- {% endif %}
+ </div>
{% endif %}
{% endblock %}
diff --git a/workshop_app/templates/workshop_app/workshop_status.html b/workshop_app/templates/workshop_app/workshop_status.html
new file mode 100644
index 0000000..b6e3731
--- /dev/null
+++ b/workshop_app/templates/workshop_app/workshop_status.html
@@ -0,0 +1,234 @@
+{% extends "workshop_app/base.html" %}
+
+{% block title %}
+ Workshop Status
+{% endblock %}
+
+{% block extra-dependencies %}
+ <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
+ <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
+ <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
+{% endblock %}
+{% block extra-custom-scripts %}
+ <script>
+ //ToolTip popup function on-hover
+ $(document).ready(function () {
+ $('[data-toggle="popover"]').popover({
+ placement: 'top',
+ trigger: 'hover'
+ });
+ });
+
+ //ToolTip popup function on-hover
+ $(document).ready(function () {
+ $('[data-toggle="popinfo"]').popover({
+ placement: 'top',
+ trigger: 'hover'
+ });
+ });
+
+ // Change date modal
+ function changeDate(date) {
+ var previous_date = new Date(date);
+ var dateToday = new Date();
+ var upto = new Date();
+
+ previous_date.setDate(previous_date.getDate() + 1);
+ upto.setFullYear(dateToday.getFullYear() + 1);
+
+ if (date[0] == 'P') {
+ var counter = date.split(" ");
+ var id = counter.slice(-1).pop();
+ counter = '.pDate' + id
+ $(counter).datepicker({
+ changeMonth: true,
+ changeYear: true,
+ minDate: dateToday,
+ maxDate: upto,
+ dateFormat: "yy-mm-dd",
+ });
+ $(".ui-dialog-content").dialog("close");
+ $('.myDialogP' + id).dialog();
+
+ } else {
+ var counter = date.split(" ");
+ var id = counter.slice(-1).pop();
+ counter = '.rDate' + id;
+ $(counter).datepicker({
+ changeMonth: true,
+ changeYear: true,
+ minDate: dateToday,
+ maxDate: upto,
+ dateFormat: "yy-mm-dd",
+ });
+ $(".ui-dialog-content").dialog("close");
+ $('.myDialogR' + id).dialog();
+
+ }
+ };
+
+ </script>
+{% endblock %}
+
+
+{% block content %}
+ {% if workshops %}
+ <h3 align="center" style="color:#2952a2;">The status of your workshops </h3>
+ <br>
+
+ <!-- Accepted View -->
+ <br>
+ <div class="container">
+ <h3 align="center" style="color: #04a9cf;"><strong>Workshops Accepted</strong></h3>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ {% if request.user.profile.position == 'instructor' %}
+ <th>Coordinator Name</th>
+ <th>Institute</th>
+ {% else %}
+ <th>Instructor Name</th>
+ {% endif %}
+ <th>Workshop Name</th>
+ <th>Workshop Day</th>
+ <th>Status</th>
+ </tr>
+ </thead>
+ {% csrf_token %}
+ {% for workshop in workshops %}
+ <tbody>
+ <tr>
+ {% if workshop.status == 1 and workshop.workshop_type %}
+ {% if request.user.profile.position == 'instructor' %}
+ <td>
+ <a href="{{ URL_ROOT }}/view_profile/{{ workshop.coordinator.profile.user.id }}">
+ {{ workshop.coordinator.get_full_name }}</a></td>
+ <td>{{ workshop.coordinator.profile.institute }}</td>
+ {% else %}
+ <td>{{ workshop.instructor.get_full_name }}</td>
+ {% endif %}
+ <td>{{ workshop.workshop_type |capfirst }}</td>
+ {% if workshop.date > today %}
+ <td>{{ workshop.date | date }}
+ <span class="material-icons" style="cursor:pointer;" data-toggle="popinfo"
+ title="Note"
+ data-content="Click here to change date"
+ class="datepicker"
+ onclick="changeDate('R,{{ workshop.date| safe }}, {{ forloop.counter }}')">event</span>
+ <div class="myDialogR{{ forloop.counter }}" style="display: none;"
+ title="Select New Date">
+ <form method="post">
+ <input type="text" name="new_date" class="rDate{{ forloop.counter }}"/><br>
+ <input type="hidden" name="action" value="change_date">
+ <input type="hidden" name="workshop_id" value="{{ workshop.id }}">
+ <input type="hidden" name="cid" value="{{ workshop.coordinator.id }}">
+ {% csrf_token %}
+ <button class="btn btn-primary btn-xs" type="submit">Save</button>
+ </form>
+ </div>
+ </td>
+ {% else %}
+ <td>{{ workshop.date | date }}</td>
+ {% endif %}
+ <td><span class="badge badge-success">{{ workshop.get_status }}</span></td>
+ {% endif %}
+ </tr>
+ </tbody>
+
+ {% endfor %}
+
+ </table>
+ </div>
+
+
+ <!-- Proposed View -->
+ <br>
+ <div class="container">
+
+ {% if request.user.profile.position == 'instructor' %}
+ <h3 align="center" style="color: #04a9cf;"><strong>Workshops Proposed By Coordinators</strong>
+ </h3>
+ {% else %}
+ <h3 align="center" style="color: #04a9cf;"><strong>Workshops Proposed By Me</strong></h3>
+ {% endif %}
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ {% if request.user.profile.position == 'instructor' %}
+ <th>Coordinator Name</th>
+ <th>Institute</th>
+ {% else %}
+
+ {% endif %}
+ <th>Workshop Name</th>
+ <th>Workshop Day</th>
+ <th>Status</th>
+ {% if request.user.profile.position == 'instructor' %}
+ <th>Action</th>
+ {% endif %}
+ </tr>
+ </thead>
+ {% csrf_token %}
+ {% for workshop in workshops %}
+ <tbody>
+ <tr>
+ {% if workshop.status == 0 and workshop.tnc_accepted %}
+ {% if request.user.profile.position == 'instructor' %}
+
+ <td>
+ <a href="{{ URL_ROOT }}/view_comment_profile/{{ workshop.coordinator.profile.user.id }}">
+ {{ workshop.coordinator.get_full_name }}</a></td>
+ <td>{{ workshop.coordinator.profile.institute }}</td>
+ {% endif %}
+ <td>{{ workshop.workshop_type }}</td>
+ <td>{{ workshop.date | date }}</td>
+
+ <td><span class="badge badge-warning">{{ workshop.get_status }}</span></td>
+ {% if request.user.profile.position == 'instructor' and workshop.status == 0 %}
+ <td>
+ <form method="post">
+ <input type="hidden" name="action" value="accept">
+ <input type="hidden" name="workshop_id" value="{{ workshop.id }}">
+ {% csrf_token %}
+ <button class="btn btn-primary btn-sm" id="book-btn" data-toggle="popover"
+ title="Please Note"
+ data-content="Once Accepted you can't Reject, you have to personally contact the Coordinator if the workshop is to be cancelled">
+ Accept
+ </button>
+ </form>
+ </td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ </tbody>
+
+ {% endfor %}
+ </table>
+ </div>
+
+
+
+ {% else %}
+ {% if request.user.profile.position == 'instructor' %}
+ <div class="container">
+ <div class="jumbotron">
+ <h1>Welcome {{ user.first_name }}</h1>
+ <p>Your workshop related information will be shown here, Please navigate to <b>Workshop list</b> and
+ depending upon
+ your expertise and availability create a workshop by going to
+ <b>Create Workshop</b>.</p>
+ </div>
+ </div>
+ {% else %}
+ <div class="container">
+ <div class="jumbotron">
+ <h1>Welcome {{ user.first_name }}</h1>
+ <p>Information Related to your workshops will be shown here, you can also
+ propose a Workshop as per your available date in <strong>Workshops > Propose a Workshop
+ tab</strong> .</p>
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
+
+{% endblock %}