diff --git a/atlas/forms.py b/atlas/forms.py index cea1ab7b..cfdb4d70 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -48,6 +48,8 @@ from generic.models import Examination#, Sign from django.contrib.admin.widgets import FilteredSelectMultiple from django.forms.widgets import RadioSelect, TextInput, Textarea, Select +from crispy_forms.layout import Submit, Layout, Fieldset, Field, Div +from crispy_forms.bootstrap import Accordion, AccordionGroup from tinymce.widgets import TinyMCE @@ -304,8 +306,6 @@ class CaseForm(ModelForm): js = ["jsi18n.js", "tesseract.min.js", "js/upload_form_helpers.js"] def __init__(self, *args, **kwargs): - logging.info("LOG") - logging.debug(kwargs) self.user = kwargs.pop( "user" ) # To get request.user. Do not use kwargs.pop('user', None) due to potential security hole @@ -340,6 +340,34 @@ class CaseForm(ModelForm): case_queryset = get_cases_available_to_user(self.user) self.fields["previous_case"].queryset=case_queryset + + self.helper = FormHelper() + self.helper.form_id = "id-case-form" + self.helper.form_class = "case-form" + self.helper.form_method = "post" + self.helper.form_action = "submit" + self.helper.form_tag = False + + self.helper.layout = Layout( + Fieldset( + "Case details", + "title", + "subspecialty", + "description", + "history", + "presentation", + "discussion", + "condition", + "pathological_process", + "report", + "open_access", + "previous_case", + "diagnostic_certainty", + ), + + ) + + def get_queryset(self, request): return ( super() diff --git a/atlas/templates/atlas/base.html b/atlas/templates/atlas/base.html index e37b039a..14692972 100755 --- a/atlas/templates/atlas/base.html +++ b/atlas/templates/atlas/base.html @@ -5,19 +5,83 @@ {% endblock %} {% block navigation %} - Atlas: {% if request.user.is_authenticated %} - Collections / - Cases / - Series / - Categories / - {% comment %} Resources / {% endcomment %} - Create Case / - Create Series / - Resources / - Uploads / - Question Schemas / - Help + {% endif %} {% comment %} Questions by: diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html index 7436858f..16be651b 100755 --- a/atlas/templates/atlas/case_display_block.html +++ b/atlas/templates/atlas/case_display_block.html @@ -1,4 +1,24 @@
Title: {{ case.title }}
Description: {{ case.description }}
@@ -176,6 +195,9 @@ {% endfor %} + + +Previous case: {{ case.previous_case.get_link }}
Next case: {{ case.next_case.get_link }}