more bootstrap nav convresion

This commit is contained in:
Ross
2024-12-23 10:36:03 +00:00
parent 1fdb4c9159
commit 178ec034a3
21 changed files with 189 additions and 126 deletions
+1 -1
View File
@@ -417,7 +417,7 @@ class LongCreationDefault(models.Model):
# help_text="Default site to use when creating a new long")
def get_absolute_url(self):
return reverse("longs:long_create")
return reverse("longs:question_create")
class ExamQuestionDetail(models.Model):
sort_order = models.IntegerField(default=1000)
+65 -32
View File
@@ -1,33 +1,66 @@
{% extends 'base.html' %}
{% block title %}
Longs
{% endblock %}
{% block css %}
{% endblock %}
{% block js %}
{% endblock %}
{% block content %}
{% endblock %}
{% block navigation %}
Longs:
{% if request.user.is_authenticated %}
<a href="{% url 'longs:exam_list' %}">Exams</a> /
<a href="{% url 'longs:exam_create' %}" title="Create a new exam">Create Exam</a> /
<a href="{% url 'longs:long_view' %}">Cases</a> /
<a href="{% url 'longs:long_series_view' %}">Series</a> /
<a href="{% url 'longs:long_create' %}" title="Create a new long case">Create Case</a> /
<a href="{% url 'longs:long_series_create' %}" title="Create a new image series">Create Series</a>
{% endif %}
{% if request.user.is_superuser %}
/ <a href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
{% endif %}
{% comment %} </br>
Questions by:
<span id="authors-link"><a href="{% url 'longs:author_list' %}">author</a></span> {% endcomment %}
{% extends 'base.html' %}
{% block title %}
Longs
{% endblock %}
{% block css %}
{% endblock %}
{% block js %}
{% endblock %}
{% block content %}
{% endblock %}
{% block navigation %}
<nav class="navbar navbar-expand-lg navbar-dark submenu">
<div class="container-fluid">
<a class="navbar-brand" href="{% url 'longs:index' %}">Longs</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">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="navbar-nav">
{% if request.user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="{% url 'longs:exam_list' %}"><i class="bi bi-mortarboard"></i> Exams</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'longs: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 'longs:exam_create' %}" title="Create a new exam"><i class="bi bi-mortarboard"></i> Exam</a></li>
<li><a class="dropdown-item" href="{% url 'longs:question_create' %}" title="Create a new question"><i class="bi bi-question-circle"></i> Question</a></li>
<li><a class="dropdown-item" href="{% url 'longs:series_create' %}" title="Create a new image series">Create Series</a></li>
</ul>
</li>
{% if request.user.is_superuser %}
<li class="nav-item">
<a class="nav-link" href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
</li>
{% endif %}
{% endif %}
</ul>
</div>
</div>
</nav>
Longs:
{% if request.user.is_authenticated %}
<a href="{% url 'longs:exam_list' %}">Exams</a> /
<a href="{% url 'longs:exam_create' %}" title="Create a new exam">Create Exam</a> /
<a href="{% url 'longs:question_view' %}">Cases</a> /
<a href="{% url 'longs:series_view' %}">Series</a> /
<a href="{% url 'longs:question_create' %}" title="Create a new long case">Create Case</a> /
{% endif %}
{% if request.user.is_superuser %}
/ <a href="{% url 'longs:user_answer_table_view' %}" title="User answers">Answers</a>
{% endif %}
{% comment %} </br>
Questions by:
<span id="authors-link"><a href="{% url 'longs:author_list' %}">author</a></span> {% endcomment %}
{% endblock %}
@@ -318,7 +318,6 @@
{% endblock %}
{% block content %}
<h2>Series Form</h2>
<!-- <a href="{% url 'longs:long_create_defaults' %}">Edit defaults</a> -->
This form will create a image set that can be associated with a long question. If the question has already been created it can be linked below.
<form action="" method="post" enctype="multipart/form-data" id="long-form">
{% csrf_token %}
+4 -10
View File
@@ -6,11 +6,10 @@ from . import views
app_name = "longs"
urlpatterns = [
# path('', views.question_list, name='question_list'),
path("author/<int:pk>/", views.author_detail, name="author_detail"),
path("author/", views.author_list, name="author_list"),
path("question/", views.LongView.as_view(), name="long_view"),
path("series/", views.LongSeriesView.as_view(), name="long_series_view"),
path("question/", views.LongView.as_view(), name="question_view"),
path("series/", views.LongSeriesView.as_view(), name="series_view"),
path("series/<int:pk>", views.series_detail, name="series_detail"),
path(
"series/<int:pk>/order_dicom",
@@ -100,18 +99,13 @@ urlpatterns = [
path("exam/<int:exam_id>/clone", views.ExamClone.as_view(), name="exam_clone"),
path("exam/<int:pk>/update", views.ExamUpdate.as_view(), name="exam_update"),
path("exam/<int:pk>/delete", views.ExamDelete.as_view(), name="exam_delete"),
path("create/", views.LongCreate.as_view(), name="long_create"),
path("create/series", views.LongSeriesCreate.as_view(), name="long_series_create"),
path("create/", views.LongCreate.as_view(), name="question_create"),
path("create/series", views.LongSeriesCreate.as_view(), name="series_create"),
path(
"create/series/<int:pk>",
views.LongSeriesCreate.as_view(),
name="long_series_id_create",
),
path(
"create/defaults",
views.LongCreationDefaultView.as_view(),
name="long_create_defaults",
),
# path("region/create/", views.create_region, name="create_region"),
# path("region/ajax/get_region_id", views.get_region_id, name="get_region_id"),
# path("abnormality/create/", views.create_abnormality, name="create_abnormality"),
+2 -2
View File
@@ -273,12 +273,12 @@ class LongCreationDefaultView(LoginRequiredMixin, UpdateView):
class LongDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = Long
success_url = reverse_lazy("longs:long_view")
success_url = reverse_lazy("longs:question_view")
class LongSeriesDelete(RevisionMixin, AuthorOrCheckerRequiredMixin, DeleteView):
model = LongSeries
success_url = reverse_lazy("longs:long_series_view")
success_url = reverse_lazy("longs:series_view")
@login_required