diff --git a/busManager/coord/admin.py b/busManager/coord/admin.py index b920b75..a16081d 100644 --- a/busManager/coord/admin.py +++ b/busManager/coord/admin.py @@ -75,6 +75,9 @@ class SchoolRollMixin: class TravellerRollMixin: + def confirmation_letter(self, request, queryset): + return render_to_pdf('mail/confirmation_letter.html', confirmation_letter_context(queryset)) + def send_sms(self, request, queryset): if 'send' in request.POST: message = request.POST["message"] diff --git a/busManager/coord/context_helpers.py b/busManager/coord/context_helpers.py index 3ae992d..0b65a56 100644 --- a/busManager/coord/context_helpers.py +++ b/busManager/coord/context_helpers.py @@ -237,3 +237,13 @@ def bus_summary_context(): return {'routes': bus_routes} +def confirmation_letter_context(queryset): + travellers = [] + for traveller in queryset: + for travellerRoute in TravellerRoute.objects.filter(traveller=traveller): + travellers.append({ + 'traveller': traveller, + 'stop': travellerRoute.busStop, + 'shuttle': traveller.shuttle, + }) + return {'travellers': travellers} diff --git a/busManager/coord/templates/mail/confirmation_letter.html b/busManager/coord/templates/mail/confirmation_letter.html new file mode 100644 index 0000000..c1b71e6 --- /dev/null +++ b/busManager/coord/templates/mail/confirmation_letter.html @@ -0,0 +1,41 @@ + + +{% for traveller in travellers %} +
Student Name: {{ traveller.traveller }}
+ School: {{ traveller.traveller.school }}
+ Route Name: {{ traveller.stop.bus }}
+ Stop Name: {{ traveller.stop.address }}
+ Pickup Time: {{ traveller.stop.am_time }}
+ Dropoff Time: {{ traveller.stop.pm_time }}
+ {% if traveller.traveller.shuttle %}
+ Shuttle: {{ traveller.shuttle.bus }}
+ {% endif %}
+ Fee Paying Status: {{ traveller.traveller.get_eligibility_status_display }}
We wish to advise a seat is available for travel in 2024. If your child is a fare paying student seats cannot be guaranteed as per the Department of Education School Bus Policy.
+ + {% if traveller.traveller.shuttle %} +After arriving at Echuca College, {{ traveller.traveller.first_name }} will transfer to the {{ traveller.shuttle.bus }} shuttle for travel to {{ traveller.shuttle.school }} and in reverse for the afternoon service.
+ {% endif %} + +It is advisable that the student is at the bus stop 10 minutes prior to the nominated departure time.
+ +It is essential that parents of junior students are present at the bus stop to collect students in the afternoon, as a bus driver will not leave a student at an unattended stop if he/she has any concern re student safety.
+ +TRAVEL IS AVAILABLE FOR ORIENTATION DAY 2023 UNDER THESE ARRANGEMENTS
+ +Any queries please contact Nicole Edwards on 5482 1133
++{% endfor %} \ No newline at end of file