diff --git a/OACPL/urls.py b/OACPL/urls.py index 5b6d8fa..36f46ec 100644 --- a/OACPL/urls.py +++ b/OACPL/urls.py @@ -29,7 +29,7 @@ urlpatterns = [ url(r'^caselaw/', case_law.views.browser, name='caselaw'), url(r'^contact/', main.views.contact, name='contact'), url(r'^experts/', expert_witnesses.views.browser, name='experts'), - url(r'^experts/(\d+)', expert_witnesses.views.viewer, name='expert'), + url(r'^experts/(?P\d+)', expert_witnesses.views.viewer, name='expert'), url(r'^login/', main.views.login, name='login'), url(r'^logout/', main.views.logout, name='logout'), url(r'^media/secure/(?P.*)$', protected_serve, {'document_root': os.path.join(settings.MEDIA_ROOT, 'secure')}, name='secure media'), diff --git a/expert_witnesses/models.py b/expert_witnesses/models.py index 9f1974a..098979e 100644 --- a/expert_witnesses/models.py +++ b/expert_witnesses/models.py @@ -15,7 +15,7 @@ class AreaOfExpertise(models.Model): class Expert(models.Model): - cases = models.ManyToManyField(Case) + cases = models.ManyToManyField(Case, blank=True) expertise = models.ManyToManyField(AreaOfExpertise) institute = models.CharField(max_length=255, null=True, blank=True) name = models.CharField(max_length=255) diff --git a/expert_witnesses/templates/expertBrowser.html b/expert_witnesses/templates/expertBrowser.html index 6961924..b7fb014 100644 --- a/expert_witnesses/templates/expertBrowser.html +++ b/expert_witnesses/templates/expertBrowser.html @@ -1,21 +1,55 @@ {% extends 'base.html' %} {% block body %} -
+
-
- {% for filter in filters %} -
{{ filter.field }}
- {% endfor %} -
- {% for expert in experts %} - {{ expert.name }} - {{ expert.institute }} - {% for e in expert.expertise.all|dictsort:'field' %} - {{ e.field }} - {% endfor %} - {% endfor %} +
+ {% for expert in experts %} +
+ {{ expert.name }} +
+ {% if expert.institute %} + {{ expert.institute }} + {% else %} + No Institute + {% endif %} +
+ {% for e in expert.expertise.all %} + {{ e.field }} + {% endfor %} +
+ {% endfor %} +
+
+
+

Filters:

+
+
+
Name
+ +
+
+
Institute
+ +
+
+
Areas of Expertise
+ +
+ +