diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-24 16:05:57 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-24 16:05:57 +0100 |
commit | 2fa3b7134661deb201b1a9a9a907f0a8051640be (patch) | |
tree | 5236b0fde2b8dba57f49dba098df0edec9980741 /ctrack/organisations/templates | |
parent | 457cd45a13a4cd73626d70367be1179a070700f3 (diff) |
Contact history for person page added but doesn't filter private events out yet
Diffstat (limited to 'ctrack/organisations/templates')
3 files changed, 88 insertions, 2 deletions
diff --git a/ctrack/organisations/templates/organisations/contact_history.html b/ctrack/organisations/templates/organisations/contact_history.html new file mode 100644 index 0000000..4768331 --- /dev/null +++ b/ctrack/organisations/templates/organisations/contact_history.html @@ -0,0 +1,86 @@ +{% extends "base.html" %} + +{% load static %} + +{% block title %}Contact History for {{ person }}{% endblock %} + +{% block content %} + + <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> + <script type="application/javascript"> + $(document).ready(function () { + $('#datatable').DataTable({ + ordering: true, + searching: true, + buttons: true, + dom: 'B<"clear">lfrtip', + paging: false, + }); + }); + </script> + + <div class="col-12 m-2"> + <div class="row"> + <div class="col-12 mb-2"> + <h3>Contact history for {{ person }} | <span class="text-muted">{{ person.organisation.name }}</span></h3> + </div> + </div> + <div class="row justify-content-center"> + <div class="col-md-12"> + {% if events %} + <table id="datatable" class="table table-striped table-bordered"> + <thead> + <tr> + <th>Description</th> + <th>Date</th> + <th>User</th> + <th>Type</th> + <th>Comments</th> + <th>Action</th> + </tr> + </thead> + <tbody> + {% for event in events %} + <tr> + <td> + {{ event.type_descriptor }} + {% if event.private %} + <span class="badge badge-warning float-right">PRIVATE</span> + {% endif %} + </td> + <td>{{ event.date|date:"d M Y G:H" }}</td> + <td> + {% if event.user.name %} + {{ event.user.name }} + {% else %} + {{ event.user.username }} + {% endif %} + </td> + <td>{{ event.short_description }}</td> + <td> + {% if event.comments %} + {{ event.comments }} + {% else %} + NA + {% endif %} + <br> + {% if event.document_link %} + <a class="small" href="{{ event.document_link }}">[URL]</a> + {% endif %} + </td> + <td><a + href="{% url "register:event_update_simple_event_from_org" event.pk person.organisation.slug %}" + class="btn btn-outline-secondary btn-sm" role="button">Edit</a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% else %} + <p>There is no contact history for {{ person }}.</p> + {% endif %} + </div> + </div> + </div> + +{% endblock %} diff --git a/ctrack/organisations/templates/organisations/person_detail.html b/ctrack/organisations/templates/organisations/person_detail.html index b51a891..407823b 100644 --- a/ctrack/organisations/templates/organisations/person_detail.html +++ b/ctrack/organisations/templates/organisations/person_detail.html @@ -16,9 +16,9 @@ {% elif person.voluntary_point_of_contact %} <span class="badge badge-dark">Voluntary Point of Contact</span> {% else %} - {% endif %} </h3> + <p><a href="{% url "organisations:person_contact_history" person.pk %}">Contact History</a></p> </div> </div> <div class="row"> diff --git a/ctrack/organisations/templates/organisations/person_list.html b/ctrack/organisations/templates/organisations/person_list.html index 80c7d6a..92cee0e 100644 --- a/ctrack/organisations/templates/organisations/person_list.html +++ b/ctrack/organisations/templates/organisations/person_list.html @@ -57,7 +57,7 @@ <td><a href="{% url "organisations:detail" p.organisation.slug %}">{{ p.organisation.name }}</a></td> <td>{{ p.mobile }}</td> <td><a href="mailto:{{ p.email }}">{{ p.email }}</a></td> - <td><a href="#">Contact History</a></td> + <td><a href="{% url "organisations:person_contact_history" p.pk %} ">Contact History</a></td> </tr> {% endfor %} </table> |