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 @@
+

Case: {{ case.title }}

+ {% if case.previous_case or case.next_case %} + + {% endif %}
View case in OHIF (new tab)
@@ -7,7 +27,6 @@
ID: {{ case.id }}
-

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 }}

diff --git a/atlas/templates/atlas/case_form.html b/atlas/templates/atlas/case_form.html index 2d7cd002..3f947d82 100755 --- a/atlas/templates/atlas/case_form.html +++ b/atlas/templates/atlas/case_form.html @@ -1,6 +1,7 @@ {% extends "atlas/base.html" %} +{% load crispy_forms_tags %} {% block css %} {% endblock %} {% block js %} @@ -59,6 +60,8 @@ {% include "atlas/question_link_header.html" %} {% endif %} + +

Submit Case

Instructions @@ -68,74 +71,77 @@
{% if form.collection %} - + {% endif %}
- {% csrf_token %} + {% crispy form form.helper %} + + {% comment %} {% crispy series_formset %} {% endcomment %} + + {% comment %} {{ form }} {% endcomment %} - {{ form }}

Series:

Add image sets here. These can only be added once created (they can also be added to cases on creation).
    - {% for form in series_formset %} -
  1. - {{form.non_field_errors}} - {{form.errors}} - {{ form }} -
  2. - {% endfor %} + {% for form in series_formset %} +
  3. + {{form.non_field_errors}} + {{form.errors}} + {{ form | crispy}} +
  4. + {% endfor %}
- {{ series_formset.management_form }} + {{ series_formset.management_form | crispy }}

Differential:

Add differential here.
    - {% for form in casedifferential_formset %} -
  1. - {{form.non_field_errors}} - {{form.errors}} - {{ form }} -
  2. - {% endfor %} + {% for form in casedifferential_formset %} +
  3. + {{form.non_field_errors}} + {{form.errors}} + {{ form | crispy}} +
  4. + {% endfor %}
- {{ casedifferential_formset.management_form }} + {{ casedifferential_formset.management_form | crispy }}

Resource:

Add resource here. Resource can be anything that is useful for the case (videos, pdf, etc). This can either be avalaible before attempting the case (such a for a pre reading list) or after.
    - {% for form in caseresource_formset %} -
  1. - {{form.non_field_errors}} - {{form.errors}} - {{ form }} -
  2. - {% endfor %} + {% for form in caseresource_formset %} +
  3. + {{form.non_field_errors}} + {{form.errors}} + {{ form | crispy}} +
  4. + {% endfor %}
- {{ caseresource_formset.management_form }} + {{ caseresource_formset.management_form | crispy}}
{% endblock %} diff --git a/atlas/templates/atlas/case_view.html b/atlas/templates/atlas/case_view.html new file mode 100755 index 00000000..41ecf0cf --- /dev/null +++ b/atlas/templates/atlas/case_view.html @@ -0,0 +1,27 @@ +{% extends 'atlas/base.html' %} + +{% load render_table from django_tables2 %} +{% block css %} +{% endblock %} + +{% block content %} + +
+

My Cases

+
+ +

Filter

+
+
+
+ {{ filter.form }} + +
+
+ View my cases. +
+ {% render_table table %} +
+ +
+{% endblock %} diff --git a/atlas/templates/atlas/collection_index_view.html b/atlas/templates/atlas/collection_index_view.html index 22bc84d7..19782d4e 100644 --- a/atlas/templates/atlas/collection_index_view.html +++ b/atlas/templates/atlas/collection_index_view.html @@ -1,7 +1,6 @@ {% extends 'atlas/base.html' %} {% block content %} - Create collection
    {% for collection in collections %}
  • {{collection.name}}
  • diff --git a/atlas/templates/atlas/series_view.html b/atlas/templates/atlas/series_view.html new file mode 100755 index 00000000..835f5538 --- /dev/null +++ b/atlas/templates/atlas/series_view.html @@ -0,0 +1,27 @@ +{% extends 'atlas/base.html' %} + +{% load render_table from django_tables2 %} +{% block css %} +{% endblock %} + +{% block content %} + +
    +

    My Series

    +
    + +

    Filter

    +
    +
    +
    + {{ filter.form }} + +
    +
    + View my cases. +
    + {% render_table table %} +
    + +
    +{% endblock %} diff --git a/atlas/templates/atlas/view.html b/atlas/templates/atlas/view.html index 505ef1df..aa514e3e 100755 --- a/atlas/templates/atlas/view.html +++ b/atlas/templates/atlas/view.html @@ -7,10 +7,6 @@ {% block content %}
    - Create a new collection / Collections to view / take - - -

    My Collections

    diff --git a/atlas/views.py b/atlas/views.py index 5a61dc8a..b4c6e29b 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -1182,7 +1182,7 @@ def get_examination_id(request): class CaseView(LoginRequiredMixin, SingleTableMixin, FilterView): model = Case table_class = CaseTable - template_name = "atlas/view.html" + template_name = "atlas/case_view.html" filterset_class = CaseFilter @@ -1190,7 +1190,7 @@ class CaseView(LoginRequiredMixin, SingleTableMixin, FilterView): class SeriesView(LoginRequiredMixin, SingleTableMixin, FilterView): model = Series table_class = SeriesTable - template_name = "atlas/view.html" + template_name = "atlas/series_view.html" filterset_class = SeriesFilter diff --git a/rad/static/css/anatomy.css b/rad/static/css/anatomy.css index 29f33256..98b7c763 100644 --- a/rad/static/css/anatomy.css +++ b/rad/static/css/anatomy.css @@ -142,18 +142,6 @@ button a { color: inherit; } -.main-nav-header { - /* max-width: 50%; */ - float: right; -} - -.main-nav-header span { - float: right; - padding-left: 10px; -} - -.top-bar-link {} - .marking-list pre { display: inline; white-space: pre-wrap; @@ -1114,7 +1102,7 @@ tr:has(> td > a) { #logout-form { display: inline; } -#logout-form button { +/* #logout-form button { background: none; border: none; cursor: pointer; @@ -1122,7 +1110,7 @@ tr:has(> td > a) { text-decoration: underline; color: #3282b8; } - + */ .resource-block { max-width: fit-content; } @@ -1317,4 +1305,18 @@ details.help-text > summary { .accordion-button { background-color: darkgray; -} \ No newline at end of file +} + +.navbar { + padding: 0px; +} + +.navbar .nav-link { + padding: 0px; +} + +.navbar .navbar-brand { + padding-top: 1px; + padding-bottom: 1px; +} + diff --git a/sbas/templates/sbas/base.html b/sbas/templates/sbas/base.html index 44904176..1b601c53 100644 --- a/sbas/templates/sbas/base.html +++ b/sbas/templates/sbas/base.html @@ -5,16 +5,39 @@ {% endblock %} {% block navigation %} - Sbas: - {% if request.user.is_authenticated %} - Exams / - Create Exam / - Questions / - Create Question - {% if request.user.is_superuser %} - / Answers - {% endif %} - {% endif %} + {% endblock %} {% block content %} {% endblock %} diff --git a/templates/base.html b/templates/base.html index 07562217..bb17ddd5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -73,57 +73,87 @@ {% endblock %} + {% block css %} {% endblock %} - +
    {% block navigation %} {% endblock %}