switch case form to crispy and start using bootstrap nav
This commit is contained in:
+30
-2
@@ -48,6 +48,8 @@ from generic.models import Examination#, Sign
|
|||||||
|
|
||||||
from django.contrib.admin.widgets import FilteredSelectMultiple
|
from django.contrib.admin.widgets import FilteredSelectMultiple
|
||||||
from django.forms.widgets import RadioSelect, TextInput, Textarea, Select
|
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
|
from tinymce.widgets import TinyMCE
|
||||||
|
|
||||||
@@ -304,8 +306,6 @@ class CaseForm(ModelForm):
|
|||||||
js = ["jsi18n.js", "tesseract.min.js", "js/upload_form_helpers.js"]
|
js = ["jsi18n.js", "tesseract.min.js", "js/upload_form_helpers.js"]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
logging.info("LOG")
|
|
||||||
logging.debug(kwargs)
|
|
||||||
self.user = kwargs.pop(
|
self.user = kwargs.pop(
|
||||||
"user"
|
"user"
|
||||||
) # To get request.user. Do not use kwargs.pop('user', None) due to potential security hole
|
) # 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)
|
case_queryset = get_cases_available_to_user(self.user)
|
||||||
self.fields["previous_case"].queryset=case_queryset
|
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):
|
def get_queryset(self, request):
|
||||||
return (
|
return (
|
||||||
super()
|
super()
|
||||||
|
|||||||
@@ -5,19 +5,83 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Atlas:
|
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<a href="{% url 'atlas:collection_view' %}">Collections</a> /
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
<a href="{% url 'atlas:case_view' %}">Cases</a> /
|
<div class="container-fluid">
|
||||||
<a href="{% url 'atlas:series_view' %}">Series</a> /
|
<a class="navbar-brand" href="{% url 'atlas:index' %}">Atlas</a>
|
||||||
<a href="{% url 'atlas:categories_list' %}">Categories</a> /
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
{% comment %} <a href="{% url 'atlas:resource_view' %}">Resources</a> / {% endcomment %}
|
<span class="navbar-toggler-icon"></span>
|
||||||
<a href="{% url 'atlas:case_create' %}" title="Create a new atlas case">Create Case</a> /
|
</button>
|
||||||
<a href="{% url 'atlas:series_create' %}" title="Create a new image series">Create Series</a> /
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<a href="{% url 'atlas:resource_view' %}" title="Resources">Resources</a> /
|
<ul class="navbar-nav">
|
||||||
<a href="{% url 'atlas:user_uploads' %}" title="View unimported uploads">Uploads</a> /
|
<li class="nav-item dropdown">
|
||||||
<a href="{% url 'atlas:question_schema_overview' %}" title="View and edit question schemas">Question Schemas</a> /
|
<a class="nav-link d-inline" href="{% url 'atlas:collection_view' %}">Collections</a>
|
||||||
<a href="{% url 'atlas:help' %}" title="View the atlas help pages">Help</a>
|
<a class="nav-link d-inline dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<span class="visually-hidden">Toggle Dropdown</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:user_collections' %}">Collections to view / take</a>
|
||||||
|
</li>
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:collection_view' %}">Manage Collections</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:exam_create' %}">Create collection</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link d-inline" href="{% url 'atlas:case_view' %}">Cases</a>
|
||||||
|
<a class="nav-link d-inline dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<span class="visually-hidden">Toggle Dropdown</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:case_view' %}">Manage Cases</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:case_create' %}">Create Case</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link d-inline" href="{% url 'atlas:series_view' %}">Series</a>
|
||||||
|
<a class="nav-link d-inline dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<span class="visually-hidden">Toggle Dropdown</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:series_view' %}">Manage Series</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{% url 'atlas:series_create' %}">Create Series</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'atlas:categories_list' %}">Categories</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'atlas:resource_view' %}" title="Resources">Resources</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'atlas:user_uploads' %}" title="View unimported uploads">Uploads</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'atlas:question_schema_overview' %}" title="View and edit question schemas">Question Schemas</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'atlas:help' %}" title="View the atlas help pages">Help</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% comment %} </br>
|
{% comment %} </br>
|
||||||
Questions by:
|
Questions by:
|
||||||
|
|||||||
@@ -1,4 +1,24 @@
|
|||||||
<div class="atlas {% if case.scrapped %}atlas-scrapped{% endif %}">
|
<div class="atlas {% if case.scrapped %}atlas-scrapped{% endif %}">
|
||||||
|
<h2>Case: {{ case.title }}</h2>
|
||||||
|
{% if case.previous_case or case.next_case %}
|
||||||
|
<div class="alert alert-info" role="alert">
|
||||||
|
This case is part of a series.<br/>
|
||||||
|
<div class="row">
|
||||||
|
{% if case.previous_case %}
|
||||||
|
<div class="col-sm-6 mb-3 mb-sm-0">
|
||||||
|
<h5 class="card-title">Previous Case</h5>
|
||||||
|
{{ case.previous_case.get_link }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if case.next_case %}
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<h5 class="card-title">Next Case</h5>
|
||||||
|
{{ case.next_case.get_link }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div><a href="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">View case in OHIF</a> <a target="_blank" href="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">(new tab)</a>
|
<div><a href="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">View case in OHIF</a> <a target="_blank" href="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">(new tab)</a>
|
||||||
|
|
||||||
<div class="date">
|
<div class="date">
|
||||||
@@ -7,7 +27,6 @@
|
|||||||
<div class="id">
|
<div class="id">
|
||||||
ID: {{ case.id }}
|
ID: {{ case.id }}
|
||||||
</div>
|
</div>
|
||||||
<p class="pre-whitespace"><b>Title:</b> {{ case.title }}</p>
|
|
||||||
|
|
||||||
<p class="pre-whitespace"><b>Description:</b> {{ case.description }}</p>
|
<p class="pre-whitespace"><b>Description:</b> {{ case.description }}</p>
|
||||||
|
|
||||||
@@ -176,6 +195,9 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p class="pre-whitespace"><b>Previous case:</b> {{ case.previous_case.get_link }}</p>
|
<p class="pre-whitespace"><b>Previous case:</b> {{ case.previous_case.get_link }}</p>
|
||||||
<p class="pre-whitespace"><b>Next case:</b> {{ case.next_case.get_link }}</p>
|
<p class="pre-whitespace"><b>Next case:</b> {{ case.next_case.get_link }}</p>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{% extends "atlas/base.html" %}
|
{% extends "atlas/base.html" %}
|
||||||
<!-- {% load static from static %} -->
|
<!-- {% load static from static %} -->
|
||||||
|
|
||||||
|
{% load crispy_forms_tags %}
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block js %}
|
{% block js %}
|
||||||
@@ -59,6 +60,8 @@
|
|||||||
{% include "atlas/question_link_header.html" %}
|
{% include "atlas/question_link_header.html" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>Submit Case</h2>
|
<h2>Submit Case</h2>
|
||||||
<details>
|
<details>
|
||||||
<summary>Instructions</summary>
|
<summary>Instructions</summary>
|
||||||
@@ -68,74 +71,77 @@
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
{% if form.collection %}
|
{% if form.collection %}
|
||||||
<div class="alert alert-info" role="alert">Creating a case in the collection: <a href="{% url 'atlas:collection_detail' pk=form.collection.pk %}">{{form.collection.name}}</a></div>
|
<div class="alert alert-info" role="alert">Creating a case in the collection: <a href="{% url 'atlas:collection_detail' pk=form.collection.pk %}">{{form.collection.name}}</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<form class="highlight" action="" method="post" enctype="multipart/form-data" id="atlas-form">
|
<form class="highlight" action="" method="post" enctype="multipart/form-data" id="atlas-form">
|
||||||
{% csrf_token %}
|
{% crispy form form.helper %}
|
||||||
|
|
||||||
|
{% comment %} {% crispy series_formset %} {% endcomment %}
|
||||||
|
|
||||||
|
{% comment %} {{ form }} {% endcomment %}
|
||||||
|
|
||||||
{{ form }}
|
|
||||||
<h3>Series:</h3>
|
<h3>Series:</h3>
|
||||||
Add image sets here. These can only be added once created (they can also be added to cases on creation).
|
Add image sets here. These can only be added once created (they can also be added to cases on creation).
|
||||||
<input type="button" value="Add More Series" id="add_more_series">
|
<input type="button" value="Add More Series" id="add_more_series">
|
||||||
<div id="series_formset" class="list_formset">
|
<div id="series_formset" class="list_formset">
|
||||||
<ol>
|
<ol>
|
||||||
{% for form in series_formset %}
|
{% for form in series_formset %}
|
||||||
<li class="no-error series-formset">
|
<li class="no-error series-formset">
|
||||||
{{form.non_field_errors}}
|
{{form.non_field_errors}}
|
||||||
{{form.errors}}
|
{{form.errors}}
|
||||||
{{ form }}
|
{{ form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
{{ series_formset.management_form }}
|
{{ series_formset.management_form | crispy }}
|
||||||
<h3>Differential:</h3>
|
<h3>Differential:</h3>
|
||||||
Add differential here.
|
Add differential here.
|
||||||
<input type="button" value="Add Another Differential" id="add_more_differential">
|
<input type="button" value="Add Another Differential" id="add_more_differential">
|
||||||
<div id="casedifferential_formset" class="list_formset">
|
<div id="casedifferential_formset" class="list_formset">
|
||||||
<ol>
|
<ol>
|
||||||
{% for form in casedifferential_formset %}
|
{% for form in casedifferential_formset %}
|
||||||
<li class="no-error casedifferential_formset">
|
<li class="no-error casedifferential_formset">
|
||||||
{{form.non_field_errors}}
|
{{form.non_field_errors}}
|
||||||
{{form.errors}}
|
{{form.errors}}
|
||||||
{{ form }}
|
{{ form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
{{ casedifferential_formset.management_form }}
|
{{ casedifferential_formset.management_form | crispy }}
|
||||||
<h3>Resource:</h3>
|
<h3>Resource:</h3>
|
||||||
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.
|
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.
|
||||||
<input type="button" value="Add Another Resource" id="add_more_resource">
|
<input type="button" value="Add Another Resource" id="add_more_resource">
|
||||||
<div id="caseresource_formset" class="list_formset">
|
<div id="caseresource_formset" class="list_formset">
|
||||||
<ol>
|
<ol>
|
||||||
{% for form in caseresource_formset %}
|
{% for form in caseresource_formset %}
|
||||||
<li class="no-error caseresource_formset">
|
<li class="no-error caseresource_formset">
|
||||||
{{form.non_field_errors}}
|
{{form.non_field_errors}}
|
||||||
{{form.errors}}
|
{{form.errors}}
|
||||||
{{ form }}
|
{{ form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
{{ caseresource_formset.management_form }}
|
{{ caseresource_formset.management_form | crispy}}
|
||||||
<br/>
|
<br/>
|
||||||
<input type="submit" class="submit-button" value="Submit" name="submit">
|
<input type="submit" class="submit-button" value="Submit" name="submit">
|
||||||
</form>
|
</form>
|
||||||
<div id="empty_series_form" style="display:none">
|
<div id="empty_series_form" style="display:none">
|
||||||
<li class='no_error series-formset'>
|
<li class='no_error series-formset'>
|
||||||
{{ series_formset.empty_form }}
|
{{ series_formset.empty_form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
<div id="empty_casedifferential_form" style="display:none">
|
<div id="empty_casedifferential_form" style="display:none">
|
||||||
<li class='no_error casedifferential_formset'>
|
<li class='no_error casedifferential_formset'>
|
||||||
{{ casedifferential_formset.empty_form }}
|
{{ casedifferential_formset.empty_form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
<div id="empty_caseresource_form" style="display:none">
|
<div id="empty_caseresource_form" style="display:none">
|
||||||
<li class='no_error caseresource_formset'>
|
<li class='no_error caseresource_formset'>
|
||||||
{{ caseresource_formset.empty_form }}
|
{{ caseresource_formset.empty_form | crispy}}
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
{% extends 'atlas/base.html' %}
|
||||||
|
|
||||||
|
{% load render_table from django_tables2 %}
|
||||||
|
{% block css %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<h2>My Cases</h2>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<h4>Filter</h4>
|
||||||
|
</summary>
|
||||||
|
<div id="view-filter-options">
|
||||||
|
<form action="" method="get">
|
||||||
|
{{ filter.form }}
|
||||||
|
<input class="btn btn-primary btn-sm mt-1 mb-1" type="submit" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
View my <a href='{% url "atlas:case_view" %}?author={{request.user.id}}'>cases</a>.
|
||||||
|
</details>
|
||||||
|
{% render_table table %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="exam-options"></div>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{% extends 'atlas/base.html' %}
|
{% extends 'atlas/base.html' %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<a href="{% url 'atlas:exam_create' %}">Create collection</a>
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for collection in collections %}
|
{% for collection in collections %}
|
||||||
<li><a href='{{collection.get_absolute_url}}'>{{collection.name}}</a></li>
|
<li><a href='{{collection.get_absolute_url}}'>{{collection.name}}</a></li>
|
||||||
|
|||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
{% extends 'atlas/base.html' %}
|
||||||
|
|
||||||
|
{% load render_table from django_tables2 %}
|
||||||
|
{% block css %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="container-fluid">
|
||||||
|
<h2>My Series</h2>
|
||||||
|
<details>
|
||||||
|
<summary>
|
||||||
|
<h4>Filter</h4>
|
||||||
|
</summary>
|
||||||
|
<div id="view-filter-options">
|
||||||
|
<form action="" method="get">
|
||||||
|
{{ filter.form }}
|
||||||
|
<input class="btn btn-primary btn-sm mt-1 mb-1" type="submit" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
View my <a href='{% url "atlas:case_view" %}?author={{request.user.id}}'>cases</a>.
|
||||||
|
</details>
|
||||||
|
{% render_table table %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="exam-options"></div>
|
||||||
|
{% endblock %}
|
||||||
@@ -7,10 +7,6 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
Create a new <a href='{{request.path}}create'>collection</a> / <a href="{% url 'atlas:user_collections' %}">Collections to view / take</a>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2>My Collections</h2>
|
<h2>My Collections</h2>
|
||||||
<details>
|
<details>
|
||||||
<summary>
|
<summary>
|
||||||
|
|||||||
+2
-2
@@ -1182,7 +1182,7 @@ def get_examination_id(request):
|
|||||||
class CaseView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
class CaseView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||||
model = Case
|
model = Case
|
||||||
table_class = CaseTable
|
table_class = CaseTable
|
||||||
template_name = "atlas/view.html"
|
template_name = "atlas/case_view.html"
|
||||||
|
|
||||||
filterset_class = CaseFilter
|
filterset_class = CaseFilter
|
||||||
|
|
||||||
@@ -1190,7 +1190,7 @@ class CaseView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
|||||||
class SeriesView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
class SeriesView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
||||||
model = Series
|
model = Series
|
||||||
table_class = SeriesTable
|
table_class = SeriesTable
|
||||||
template_name = "atlas/view.html"
|
template_name = "atlas/series_view.html"
|
||||||
|
|
||||||
filterset_class = SeriesFilter
|
filterset_class = SeriesFilter
|
||||||
|
|
||||||
|
|||||||
+17
-15
@@ -142,18 +142,6 @@ button a {
|
|||||||
color: inherit;
|
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 {
|
.marking-list pre {
|
||||||
display: inline;
|
display: inline;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
@@ -1114,7 +1102,7 @@ tr:has(> td > a) {
|
|||||||
#logout-form {
|
#logout-form {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
#logout-form button {
|
/* #logout-form button {
|
||||||
background: none;
|
background: none;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -1122,7 +1110,7 @@ tr:has(> td > a) {
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
color: #3282b8;
|
color: #3282b8;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
.resource-block {
|
.resource-block {
|
||||||
max-width: fit-content;
|
max-width: fit-content;
|
||||||
}
|
}
|
||||||
@@ -1317,4 +1305,18 @@ details.help-text > summary {
|
|||||||
|
|
||||||
.accordion-button {
|
.accordion-button {
|
||||||
background-color: darkgray;
|
background-color: darkgray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar .nav-link {
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar .navbar-brand {
|
||||||
|
padding-top: 1px;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,39 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
Sbas:
|
<nav class="navbar navbar-expand-lg navbar-dark submenu">
|
||||||
{% if request.user.is_authenticated %}
|
<div class="container-fluid">
|
||||||
<a href="{% url 'sbas:exam_list' %}">Exams</a> /
|
<a class="navbar-brand" href="{% url 'sbas:index' %}">SBAs</a>
|
||||||
<a href="{% url 'sbas:exam_create' %}" title="Create a new exam">Create Exam</a> /
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<a href="{% url 'sbas:question_view' %}">Questions</a> /
|
<span class="navbar-toggler-icon"></span>
|
||||||
<a href="{% url 'sbas:question_create' %}" title="Create a new question">Create Question</a>
|
</button>
|
||||||
{% if request.user.is_superuser %}
|
<div class="collapse navbar-collapse">
|
||||||
/ <a href="{% url 'sbas:user_answer_table_view' %}" title="User answers">Answers</a>
|
<ul class="navbar-nav">
|
||||||
{% endif %}
|
{% if request.user.is_authenticated %}
|
||||||
{% endif %}
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'sbas:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'sbas:question_view' %}"><i class="bi bi-question-circle"></i> Questions</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><i class="bi bi-file-earmark-plus"></i> Create</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a class="dropdown-item" href="{% url 'sbas:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
|
||||||
|
<li><a class="dropdown-item" href="{% url 'sbas:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if request.user.is_superuser %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'sbas:user_answer_table_view' %}" title="User answers">Answers</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
+75
-45
@@ -73,57 +73,87 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
<link rel="stylesheet" href="{% static 'css/anatomy.css' %}">
|
||||||
<link rel="stylesheet" href="{% static 'css/forms.css' %}">
|
<link rel="stylesheet" href="{% static 'css/forms.css' %}">
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
background-color: rgb(28, 25, 25)
|
||||||
|
}
|
||||||
|
.dropdown-item {
|
||||||
|
color: lightblue;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
{% block css %}
|
{% block css %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
||||||
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
<body hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>
|
||||||
<div class="main-nav-header">
|
<nav class="navbar navbar-expand-lg bg-body-tertiary py-0">
|
||||||
{% if request.user.is_authenticated %}
|
<div class="container-fluid">
|
||||||
<span id="logout-link" class="top-bar-link">
|
<a class="navbar-brand pt-0" href="/">Home</a>
|
||||||
<form id="logout-form" method="post" action="{% url 'logout' %}">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
{% csrf_token %}
|
<span class="navbar-toggler-icon"><i class="bi bi-text-indent-right"></i></span>
|
||||||
<button type="submit">Log out</button>
|
</button>
|
||||||
</form>
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
{% comment %} <a href="{% url 'logout' %}">Logout</a> {% endcomment %}
|
<ul class="navbar-nav ms-auto ">
|
||||||
</span>
|
{% if request.user.is_authenticated %}
|
||||||
<span id="profile-link" class=" top-bar-link">
|
<li id="atlas-link" class="nav-item">
|
||||||
<a href="{% url 'profile' %}">Profile</a>
|
<a class="nav-link active" href="{% url 'atlas:index' %}">Atlas</a>
|
||||||
</span>
|
</li>
|
||||||
<span id="rapids-link" class="top-bar-link">
|
<li class="nav-item dropdown pt-0">
|
||||||
<a href="{% url 'rapids:index' %}">Rapids</a>
|
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
</span>
|
FRCR
|
||||||
<span id="longs-link" class="top-bar-link">
|
</a>
|
||||||
<a href="{% url 'longs:index' %}">Longs</a>
|
<ul class="dropdown-menu">
|
||||||
</span>
|
<li>
|
||||||
<span id="physics-link" class="top-bar-link">
|
<a class="dropdown-item" href="{% url 'rapids:index' %}">Rapids</a>
|
||||||
<a href="{% url 'physics:index' %}">Physics</a>
|
</li>
|
||||||
</span>
|
<li>
|
||||||
<span id="anatomy-link" class="top-bar-link">
|
<a class="dropdown-item" href="{% url 'longs:index' %}">Longs</a>
|
||||||
<a href="{% url 'anatomy:index' %}">Anatomy</a>
|
</li>
|
||||||
</span>
|
<li>
|
||||||
<span id="sbas-link" class="top-bar-link">
|
<a class="dropdown-item" href="{% url 'anatomy:index' %}">Anatomy</a>
|
||||||
<a href="{% url 'sbas:index' %}">SBAs</a>
|
</li>
|
||||||
</span>
|
<li>
|
||||||
<span id="atlas-link" class="top-bar-link">
|
<a class="dropdown-item" href="{% url 'physics:index' %}">Physics</a>
|
||||||
<a href="{% url 'atlas:index' %}">Atlas</a>
|
</li>
|
||||||
</span>
|
<li>
|
||||||
{% if request.user|has_group:"cid_user_manager" %}
|
<a class="dropdown-item" href="{% url 'sbas:index' %}">SBAs</a>
|
||||||
<span id="candidate-link" class="top-bar-link">
|
</li>
|
||||||
<a href="{% url 'people' %}">People</a>
|
</ul>
|
||||||
</span>
|
</li>
|
||||||
{% endif %}
|
{% if request.user|has_group:"cid_user_manager" %}
|
||||||
{% endif %}
|
<li id="candidate-link" class="nav-item">
|
||||||
{% if request.user.is_staff %}
|
<a class="nav-link active" href="{% url 'people' %}">People</a>
|
||||||
<span id="admin-link" class="top-bar-link">
|
</li>
|
||||||
<a href="{% url 'admin:index' %}">Admin</a>
|
{% endif %}
|
||||||
</span>
|
<li id="profile-link" class=" nav-item">
|
||||||
{% endif %}
|
<a class="nav-link active" href="{% url 'profile' %}">Profile</a>
|
||||||
<span id="index-link" class="top-bar-link">
|
</li>
|
||||||
<a href="{% url 'home' %}">Home</a>
|
{% endif %}
|
||||||
</span>
|
|
||||||
</div>
|
{% if request.user.is_staff %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" href="{% url 'admin:index' %}">Admin</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if request.user.is_authenticated %}
|
||||||
|
<li id="logout-link" class="nav-item">
|
||||||
|
<form id="logout-form" method="post" action="{% url 'logout' %}">
|
||||||
|
{% csrf_token %}
|
||||||
|
<button class="nav-link btn btn-link" type="submit">Log out</button>
|
||||||
|
</form>
|
||||||
|
{% comment %} <a href="{% url 'logout' %}">Logout</a> {% endcomment %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
{% comment %} <form class="d-flex" role="search">
|
||||||
|
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
|
<button class="btn btn-outline-success" type="submit">Search</button>
|
||||||
|
</form> {% endcomment %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
<div class="content container">
|
<div class="content container">
|
||||||
{% block navigation %}
|
{% block navigation %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user