summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJAY BORA2019-02-26 20:52:52 +0530
committerJAY BORA2019-02-26 20:52:52 +0530
commitc980565c107d09b6d779d143e2ad23fc396c2d93 (patch)
tree497e30ccc01336231c1d2b5fca44bb599cb0bdaf
parent8a1bb484cb08b3cf22cae3d2202f9fac25cb80e0 (diff)
downloadworkshop_booking-c980565c107d09b6d779d143e2ad23fc396c2d93.tar.gz
workshop_booking-c980565c107d09b6d779d143e2ad23fc396c2d93.tar.bz2
workshop_booking-c980565c107d09b6d779d143e2ad23fc396c2d93.zip
Updated as said.
-rw-r--r--workshop_app/templates/workshop_app/view_comment_profile.html27
-rw-r--r--workshop_app/templates/workshop_app/view_profile.html4
-rw-r--r--workshop_app/views.py11
3 files changed, 24 insertions, 18 deletions
diff --git a/workshop_app/templates/workshop_app/view_comment_profile.html b/workshop_app/templates/workshop_app/view_comment_profile.html
index 68855a2..25596c7 100644
--- a/workshop_app/templates/workshop_app/view_comment_profile.html
+++ b/workshop_app/templates/workshop_app/view_comment_profile.html
@@ -57,19 +57,20 @@
<th><label for="id_workshop_date"><h5>Workshop date</h5></label></th>
<th><label for="id_workshop_type"><h5>Workshop type</h5></label></th>
</tr>
- {% for foo in Requested_Workshop %}
- <tr>
- <td><label for="id_instructor_name"><h5>{{ foo.requested_workshop_instructor }}</h5></label></td>
- <td><label for="id_workshop_date"><h5>{{ foo.requested_workshop_date }}</h5></label></td>
- <td><label for="id_workshop_type"><h5>{{ foo.requested_workshop_title }}</h5></label></td>
- </tr>
- {% endfor %}
- {% for bar in Proposed_workshop %}
- <tr>
- <td><label for="id_instructor_name"><h5>{{ bar.proposed_workshop_instructor }}</h5></label></td>
- <td><label for="id_workshop_date"><h5>{{ bar.proposed_workshop_date }}</h5></label></td>
- <td><label for="id_workshop_type"><h5>{{ bar.proposed_workshop_title }}</h5></label></td>
- </tr>
+ {% for workshop in Workshops%}
+ {% if workshop.proposed_workshop_date %}
+ <tr>
+ <td><label for="id_instructor_name"><h5>{{ workshop.proposed_workshop_instructor }}</h5></label></td>
+ <td><label for="id_workshop_date"><h5>{{ workshop.proposed_workshop_date }}</h5></label></td>
+ <td><label for="id_workshop_type"><h5>{{ workshop.proposed_workshop_title }}</h5></label></td>
+ </tr>
+ {% else %}
+ <tr>
+ <td><label for="id_instructor_name"><h5>{{ workshop.requested_workshop_instructor }}</h5></label></td>
+ <td><label for="id_workshop_date"><h5>{{ workshop.requested_workshop_date }}</h5></label></td>
+ <td><label for="id_workshop_type"><h5>{{ workshop.requested_workshop_title }}</h5></label></td>
+ </tr>
+ {% endif %}
{% endfor %}
</table>
</div>
diff --git a/workshop_app/templates/workshop_app/view_profile.html b/workshop_app/templates/workshop_app/view_profile.html
index f83993d..6be4b7e 100644
--- a/workshop_app/templates/workshop_app/view_profile.html
+++ b/workshop_app/templates/workshop_app/view_profile.html
@@ -49,9 +49,9 @@
</tr>
</table>
<br>
- <a class="btn btn-primary pull-right" href="{{ URL_ROOT }}/edit_profile/">Edit Profile</a>
+ <a class="btn btn-primary" href="{{ URL_ROOT }}/edit_profile/">Edit Profile</a>
{% if user.profile.position == 'instructor' %}
- <a class="btn btn-primary pull-right" href="{{ URL_ROOT }}/download/">Download Workshop</a>
+ <a class="btn btn-primary " href="{{ URL_ROOT }}/download/">Download Workshop</a>
{% endif %}
diff --git a/workshop_app/views.py b/workshop_app/views.py
index ad02dc0..961445a 100644
--- a/workshop_app/views.py
+++ b/workshop_app/views.py
@@ -1194,6 +1194,12 @@ def view_comment_profile(request, user_id):
'requested_workshop_title')
propose_workshop = ProposeWorkshopDate.objects.filter(proposed_workshop_coordinator=user_id).order_by(
'proposed_workshop_date')
+ workshops=[]
+ for workshop in propose_workshop:
+ workshops.append(workshop)
+
+ for workshop in requested_workshop:
+ workshops.append(workshop)
try:
comments = ProfileComments.objects.filter(coordinator_profile_id=user_id).order_by('-created_date')
except:
@@ -1224,13 +1230,12 @@ def view_comment_profile(request, user_id):
except EmptyPage:
#If page is out of range(e.g 999999), deliver last page.
comments = paginator.page(paginator.num_pages)
-
+ workshop={}
return render(request, "workshop_app/view_comment_profile.html",
{"coordinator_profile": coordinator_profile,
"comments": comments,
"comment_form": comment_form,
- "Proposed_workshop":propose_workshop,
- "Requested_Workshop":requested_workshop})
+ "Workshops":workshops})
return redirect('/book/')
@login_required