Skip to content

Commit

Permalink
"refactor[pre-commit.ci]: auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci"
  • Loading branch information
pre-commit-ci[bot] committed Nov 20, 2021
1 parent 489bc11 commit a3310c3
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 121 deletions.
4 changes: 1 addition & 3 deletions announcement/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
from django.contrib import messages
from django.core.files.storage import default_storage
from django.http import HttpResponse, HttpResponseRedirect
from django.template.defaultfilters import safe
from django.template.defaultfilters import striptags
from django.template.defaultfilters import truncatewords
from django.template.defaultfilters import safe, striptags, truncatewords
from django.urls import reverse_lazy
from django.views.generic import FormView, TemplateView
from firebase_admin import firestore
Expand Down
4 changes: 3 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def get(self, request):
df = pd.DataFrame(data["rows"])

# ### Convert Dates to Datetime
df["birth_date"] = pd.to_datetime(df["date_of_birth"], errors="coerce", format="%B %d, %Y")
df["birth_date"] = pd.to_datetime(
df["date_of_birth"], errors="coerce", format="%B %d, %Y"
)
df["date_accomplished"] = pd.to_datetime(
df["date_accomplished"], errors="coerce", format="%Y-%m-%d", utc=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,4 +623,4 @@
background: #fff;
border-top: 1px solid #f3f3f7;
padding: 15px;
}
}
76 changes: 38 additions & 38 deletions appointment/templates/appointment/appointment_query_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,38 @@ <h1 class="h4">My Appointments</h1>

{% block table_content %}
<thead class="table-dark">
<tr>
<th data-field="appointment_id" data-sortable="true" data-visible="false" class="border-0">APPOINTMENT I.D</th>
<th data-field="start_appointment" data-sortable="true" class="border-0">START APPOINTMENT</th>
<th data-field="end_appointment" data-sortable="true" class="border-0">END APPOINTMENT</th>
<th data-field="status" data-sortable="true" class="border-0">STATUS</th>
<th data-field="first_name" data-sortable="true">FIRST NAME</th>
<th data-field="middle_name" data-sortable="true">MIDDLE NAME</th>
<th data-field="last_name" data-sortable="true">LAST NAME</th>
<th data-field="document" data-sortable="true">DOCUMENT</th>
<th data-field="purpose" data-formatter="createdFormatter" data-sortable="true" class="border-0">PURPOSE</th>
<th data-field="contact_number" data-sortable="true" class="border-0">CONTACT NUMBER</th>
<th data-field="address" data-sortable="true" class="border-0">ADDRESS</th>
<th data-field="created_on" data-sortable="true" class="border-0">CREATED ON</th>
</tr>
</thead>
<tbody>
{% for appointment in appointments_data %}
<tr>
<td>{{ appointment.appointment_id }}</td>
<td>{{ appointment.start_appointment }}</td>
<td>{{ appointment.end_appointment }}</td>
<td>{{ appointment.status }}</td>
<td>{{ appointment.first_name }}</td>
<td>{{ appointment.middle_name }}</td>
<td>{{ appointment.last_name }}</td>
<td>{{ appointment.document|unordered_list }}</td>
<td>{{ appointment.appointment_purpose }}</td>
<td>{{ appointment.contact_number }}</td>
<td>{{ appointment.address }}</td>
<td>{{ appointment.created_on }}</td>
<th data-field="appointment_id" data-sortable="true" data-visible="false" class="border-0">APPOINTMENT I.D</th>
<th data-field="start_appointment" data-sortable="true" class="border-0">START APPOINTMENT</th>
<th data-field="end_appointment" data-sortable="true" class="border-0">END APPOINTMENT</th>
<th data-field="status" data-sortable="true" class="border-0">STATUS</th>
<th data-field="first_name" data-sortable="true">FIRST NAME</th>
<th data-field="middle_name" data-sortable="true">MIDDLE NAME</th>
<th data-field="last_name" data-sortable="true">LAST NAME</th>
<th data-field="document" data-sortable="true">DOCUMENT</th>
<th data-field="purpose" data-formatter="createdFormatter" data-sortable="true" class="border-0">PURPOSE</th>
<th data-field="contact_number" data-sortable="true" class="border-0">CONTACT NUMBER</th>
<th data-field="address" data-sortable="true" class="border-0">ADDRESS</th>
<th data-field="created_on" data-sortable="true" class="border-0">CREATED ON</th>
</tr>
{% endfor %}
</thead>
<tbody>
{% for appointment in appointments_data %}
<tr>
<td>{{ appointment.appointment_id }}</td>
<td>{{ appointment.start_appointment }}</td>
<td>{{ appointment.end_appointment }}</td>
<td>{{ appointment.status }}</td>
<td>{{ appointment.first_name }}</td>
<td>{{ appointment.middle_name }}</td>
<td>{{ appointment.last_name }}</td>
<td>{{ appointment.document|unordered_list }}</td>
<td>{{ appointment.appointment_purpose }}</td>
<td>{{ appointment.contact_number }}</td>
<td>{{ appointment.address }}</td>
<td>{{ appointment.created_on }}</td>
</tr>
{% endfor %}
</tbody>
{% endblock table_content %}

Expand All @@ -86,8 +86,8 @@ <h3 class="mb-0 text-truncated">%FIRSTNAME% %MIDDLENAME% %LASTNAME%</h3>
</div>
<div class="col-3 p-0 d-flex justify-content-end">
<a class="btn mx-1 text-end"
onclick="redirectToUrl('{% url "appointment:view_appointment" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="View">
onclick="redirectToUrl('{% url "appointment:view_appointment" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="View">
<i class="fas fa-eye fa-1x"></i>
</a>
</div>
Expand Down Expand Up @@ -132,20 +132,20 @@ <h3 class="mb-0 text-truncated">%FIRSTNAME% %MIDDLENAME% %LASTNAME%</h3>
{% if user_sess_data.role in 'admin, head_admin, secretary, worker ' %}
<div class="col-12 col-lg-12 pt-5 d-flex justify-content-center">
<a class="btn btn-outline-danger mx-1" id="btn-cancel"
onclick="redirectToUrl('{% url "appointment:appointment_cancel" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Cancel">
onclick="redirectToUrl('{% url "appointment:appointment_cancel" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Cancel">
<i class="fas fa-calendar-times"></i>
Cancel
</a>
<a class="btn btn-outline-primary mx-1"
onclick="redirectToUrl('{% url "appointment:reschedule_appointment" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Reschedule">
onclick="redirectToUrl('{% url "appointment:reschedule_appointment" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Reschedule">
<i class="fas fa-calendar-alt"></i>
Reschedule
</a>
<a class="btn btn-outline-info mx-1"
onclick="redirectToUrl('{% url "appointment:appointment_complete" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Complete">
onclick="redirectToUrl('{% url "appointment:appointment_complete" appointment_id=0 %}', '%APPOINTMENT_ID%')"
data-toggle="tooltip" data-placement="top" title="Complete">
<i class="fas fa-check"></i>
Complete
</a>
Expand Down
16 changes: 8 additions & 8 deletions appointment/templates/appointment/apt_edit_docu.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ <h1 class="h4">Document Info.</h1>
{% load crispy_forms_tags %}

<form action="{% url "appointment:docu_input_info" appointment_data.appointment_id document_slugify %}"
method="POST">
method="POST">
{% csrf_token %}
{{ form|crispy }}
<a class="btn btn-light"
href="{% url "appointment:view_appointment" appointment_data.appointment_id %}">Cancel</a>
href="{% url "appointment:view_appointment" appointment_data.appointment_id %}">Cancel</a>
<input class="btn btn-secondary" type="submit" value="Generate">

{% if info_status %}
Expand All @@ -42,16 +42,16 @@ <h1 class="h4">Document Info.</h1>

{% block scripts %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js"
integrity="sha384-NaWTHo/8YCBYJ59830LTz/P4aQZK1sS0SneOgAvhsIl3zBu8r9RevNg5lHCHAuQ/"
crossorigin="anonymous"></script>
integrity="sha384-NaWTHo/8YCBYJ59830LTz/P4aQZK1sS0SneOgAvhsIl3zBu8r9RevNg5lHCHAuQ/"
crossorigin="anonymous"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.2.7/pdfobject.min.js"
integrity="sha512-g16L6hyoieygYYZrtuzScNFXrrbJo/lj9+1AYsw+0CYYYZ6lx5J3x9Yyzsm+D37/7jMIGh0fDqdvyYkNWbuYuA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
integrity="sha512-g16L6hyoieygYYZrtuzScNFXrrbJo/lj9+1AYsw+0CYYYZ6lx5J3x9Yyzsm+D37/7jMIGh0fDqdvyYkNWbuYuA=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
integrity="sha512-894YE6QWD5I59HgZOGReFYm4dnWc1Qt5NtvYSaNcOP+u1T9qYdvdihz0PPSiiqn/+/3e7Jo4EaG7TubfWGUrMQ=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script type="text/javascript">
$(document).ready(function () {
Expand Down
26 changes: 13 additions & 13 deletions appointment/templates/appointment/view_appointment.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ <h1 class="h4">View Appointment</h1>
<div class="side-bar">
<div class="user-info">
<img class="img-profile img-circle img-responsive center-block rounded-circle"
src="{{ appointment_data.photo_url }}"
alt="{{ appointment_data.first_name }} {{ appointment_data.last_name }}">
src="{{ appointment_data.photo_url }}"
alt="{{ appointment_data.first_name }} {{ appointment_data.last_name }}">
<ul class="meta list list-unstyled">
<li class="name">
<p class="mb-0">{{ appointment_data.first_name }} {{ appointment_data.last_name }}</p>
Expand Down Expand Up @@ -58,7 +58,7 @@ <h2 class="title">Purpose</h2>
<div class="row">
<div class="col-12">
<textarea class="form-control" rows="3" disabled
readonly>{{ appointment_data.appointment_purpose }}</textarea>
readonly>{{ appointment_data.appointment_purpose }}</textarea>
</div>
</div>
</div>
Expand All @@ -74,27 +74,27 @@ <h2 class="title">Document</h2>
<div class="drive-item module text-center w-25">
<div class="drive-item-inner module-inner">
<div class="drive-item-title"><a
href="#">{{ data.document_name }}</a></div>
href="#">{{ data.document_name }}</a></div>
<div class="drive-item-thumb">
<i class="fas fa-file-alt fa-4x"></i>
</div>
</div>
<div class="drive-item-footer module-footer">
{% if user_sess_data.role in 'admin, head_admin, secretary, worker ' %}
<a class="btn btn-primary mx-1"
href="{% url "appointment:view_document_page" appointment_data.appointment_id data.slugify %}"
target="_blank">View</a>
href="{% url "appointment:view_document_page" appointment_data.appointment_id data.slugify %}"
target="_blank">View</a>
<a class="btn btn-secondary mx-1"
href="{% url "appointment:apt_edit_docu" appointment_data.appointment_id data.slugify %}">Edit</a>
href="{% url "appointment:apt_edit_docu" appointment_data.appointment_id data.slugify %}">Edit</a>
{% else %}
{% if appointment_data.status == "get" %}
{# <a class="btn btn-primary mx-1"#}
{# href="#"#}
{# target="_blank">View</a>#}
{# <a class="btn btn-primary mx-1"#}
{# href="#"#}
{# target="_blank">View</a>#}
{% else %}
<a class="btn btn-primary mx-1"
href="{% url "appointment:view_document_page" appointment_data.appointment_id data.slugify %}"
target="_blank">View</a>
href="{% url "appointment:view_document_page" appointment_data.appointment_id data.slugify %}"
target="_blank">View</a>
{% endif %}
{% endif %}
</div>
Expand All @@ -105,7 +105,7 @@ <h2 class="title">Document</h2>

<div class="drive-grid-view d-flex justify-content-center py-4">
<a class="btn btn-secondary mx-2"
href="{% url "appointment:appointment_query_list" %}">Cancel</a>
href="{% url "appointment:appointment_query_list" %}">Cancel</a>
<button class="btn btn-primary mx-2" id="btn-complete">
Complete
</button>
Expand Down
Loading

0 comments on commit a3310c3

Please sign in to comment.