diff options
author | pnshiralkar | 2020-05-05 12:38:00 +0530 |
---|---|---|
committer | pnshiralkar | 2020-05-05 12:38:00 +0530 |
commit | 1c4a9a7e1c0c08de08e6e95ea4fd403eab78a913 (patch) | |
tree | bc7d1c1971fc99676453b627d95a5a195f221af1 /workshop_app/templates | |
parent | 0fd8703ca8e0b4caf02df30d6e63320fe6f98338 (diff) | |
download | workshop_booking-1c4a9a7e1c0c08de08e6e95ea4fd403eab78a913.tar.gz workshop_booking-1c4a9a7e1c0c08de08e6e95ea4fd403eab78a913.tar.bz2 workshop_booking-1c4a9a7e1c0c08de08e6e95ea4fd403eab78a913.zip |
Workshop status view for instructor done
Diffstat (limited to 'workshop_app/templates')
-rw-r--r-- | workshop_app/templates/workshop_app/workshop_status.html | 150 |
1 files changed, 56 insertions, 94 deletions
diff --git a/workshop_app/templates/workshop_app/workshop_status.html b/workshop_app/templates/workshop_app/workshop_status.html index b6e3731..28d95b7 100644 --- a/workshop_app/templates/workshop_app/workshop_status.html +++ b/workshop_app/templates/workshop_app/workshop_status.html @@ -29,16 +29,16 @@ // Change date modal function changeDate(date) { - var previous_date = new Date(date); - var dateToday = new Date(); - var upto = new Date(); + let previous_date = new Date(date); + let dateToday = new Date(); + let 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(); + let counter = date.split(" "); + const id = counter.slice(-1).pop(); + if (date[0] === 'P') { counter = '.pDate' + id $(counter).datepicker({ changeMonth: true, @@ -51,8 +51,6 @@ $('.myDialogP' + id).dialog(); } else { - var counter = date.split(" "); - var id = counter.slice(-1).pop(); counter = '.rDate' + id; $(counter).datepicker({ changeMonth: true, @@ -73,7 +71,7 @@ {% 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 --> @@ -83,42 +81,36 @@ <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>Coordinator Name</th> + <th>Institute</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> + <a href="{% url 'view_profile' workshop.coordinator.profile.user.id %}"> + {{ workshop.coordinator.get_full_name }}</a> + </td> + <td>{{ workshop.coordinator.profile.institute }}</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" + <td>{{ workshop.date | date }} + + {% if workshop.date > today %} + <span class="material-icons datepicker" 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="text" placeholder="New date" 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 }}"> @@ -126,10 +118,8 @@ <button class="btn btn-primary btn-xs" type="submit">Save</button> </form> </div> - </td> - {% else %} - <td>{{ workshop.date | date }}</td> - {% endif %} + {% endif %} + </td> <td><span class="badge badge-success">{{ workshop.get_status }}</span></td> {% endif %} </tr> @@ -144,60 +134,44 @@ <!-- 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 Coordinators</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>Coordinator Name</th> + <th>Institute</th> <th>Workshop Name</th> <th>Workshop Day</th> <th>Status</th> - {% if request.user.profile.position == 'instructor' %} - <th>Action</th> - {% endif %} + <th>Action</th> </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> + <a href="{% url 'view_profile' workshop.coordinator.profile.user.id %}"> + {{ workshop.coordinator.get_full_name }}</a> + </td> + <td>{{ workshop.coordinator.profile.institute }}</td> <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 %} + <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 %} </tr> </tbody> @@ -206,29 +180,17 @@ </table> </div> - - + <!-- No workshops for the user --> {% 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>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> - {% endif %} + </div> {% endif %} {% endblock %} |