summaryrefslogtreecommitdiffstats
path: root/instruments
diff options
context:
space:
mode:
Diffstat (limited to 'instruments')
-rw-r--r--instruments/templates/instruments/sop_list.html53
-rw-r--r--instruments/tests/test_views.py10
-rw-r--r--instruments/urls.py8
-rw-r--r--instruments/views.py9
4 files changed, 79 insertions, 1 deletions
diff --git a/instruments/templates/instruments/sop_list.html b/instruments/templates/instruments/sop_list.html
new file mode 100644
index 0000000..7550ca1
--- /dev/null
+++ b/instruments/templates/instruments/sop_list.html
@@ -0,0 +1,53 @@
+
+{% extends "core/base.html" %}
+
+{% block content %}
+
+
+<div class="flex py-4">
+ <div class="w-1/2 px-4 py-8 my-5 bg-white shadow-md rounded-lg">
+ <header class="bg-blue-100 p-4">
+ <h2 class="text-2xl font-bold">Standard Operating Procedures (SOPs)</h2>
+
+ </header>
+ <div class="p-4 mb-4">
+ <div class="overflow-x-auto">
+ <table class="divide-y divide-gray-200">
+ <thead class="bg-gray-50">
+ <tr>
+ <th scope="col" class="px-2 py-1 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
+ <th scope="col" class="px-2 py-1 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Sharepoint</th>
+ <th scope="col" class="px-2 py-1 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Lead Inspector</th>
+ <th scope="col" class="px-2 py-1 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
+ </tr>
+ </thead>
+ <tbody class="divide-y divide-gray-200">
+ {% for obj in object_list %}
+ <tr>
+ <td class="px-2 py-1 whitespace-nowrap text-m">{{ obj.name }}</td>
+ <td class="px-2 py-1 whitespace-nowrap text-m">{{ obj.sp_link }}</td>
+ <td class="px-2 py-1 whitespace-nowrap text-m">{{ obj.author_lead.fullname }}</td>
+ <td class="px-2 py-1 whitespace-nowrap text-m">{{ obj.draft_status }}</td>
+
+ </tr>
+ <tr>
+ <td colspan="5">
+ <p class="text-sm text-gray-500 px-1 py-2">{% lorem %}</p>
+ </td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+
+ </div>
+
+ </div>
+
+
+
+
+ </div>
+
+</div>
+
+{% endblock content %}
diff --git a/instruments/tests/test_views.py b/instruments/tests/test_views.py
new file mode 100644
index 0000000..048ab47
--- /dev/null
+++ b/instruments/tests/test_views.py
@@ -0,0 +1,10 @@
+import pytest
+from django.urls import reverse
+
+pytestmark = pytest.mark.django_db
+
+
+def test_view_url_exists_at_desired_location(client):
+ url = reverse("instruments:sop-list")
+ response = client.get(url)
+ assert response.status_code == 200
diff --git a/instruments/urls.py b/instruments/urls.py
new file mode 100644
index 0000000..4358f91
--- /dev/null
+++ b/instruments/urls.py
@@ -0,0 +1,8 @@
+from django.urls import path
+
+from . import views
+
+app_name = "instruments"
+urlpatterns = [
+ path("sops", views.SOPListView.as_view(), name="sop-list"),
+]
diff --git a/instruments/views.py b/instruments/views.py
index fd0e044..0329e00 100644
--- a/instruments/views.py
+++ b/instruments/views.py
@@ -1,3 +1,10 @@
# from django.shortcuts import render
-# Create your views here.
+from django.views.generic.list import ListView
+
+from .models import SOP
+
+
+class SOPListView(ListView):
+ model = SOP
+ paginate_by = 100