Refactor docker-compose.yml build context and add question review URL and view; create question_review.html template

This commit is contained in:
Ross
2025-10-27 09:47:35 +00:00
parent 4f72de6be9
commit 702b7b35a7
6 changed files with 29 additions and 3 deletions
+4 -2
View File
@@ -8,8 +8,10 @@ services:
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
web:
build:
context: ..
dockerfile: rad/Dockerfile
# Use the rad/ directory as the build context and the Dockerfile inside it.
# This avoids relative path issues with different docker/compose versions and buildx.
context: ./rad
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8000
#command: pip install -r requirements.txt
volumes:
@@ -0,0 +1,9 @@
{% extends 'sbas/base.html' %}
{% load partials %}
{% block content %}
Test
{% endblock %}
+5
View File
@@ -286,6 +286,11 @@ def generic_view_urls(generic_views: GenericViewBase):
generic_views.question_reviews_list,
name="question_reviews",
),
path(
"question/review/",
generic_views.question_review_start,
name="question_review_start",
),
path("question/<int:pk>/thumbnail/fail", generic_views.question_thumbnail_fail, name="series_thumbnail_fail"),
path("question/<int:pk>/thumbnail", generic_views.question_thumbnail, name="series_thumbnail"),
path(
+8 -1
View File
@@ -3007,7 +3007,7 @@ class GenericViewBase:
# Default: render the block (latest if exists, otherwise form)
if latest:
return render(request, "generic/partials/question_review_block.html", {"review": latest, "question": question, "app_name": self.app_name})
return render(request, "/generic/partials/question_review_block.html", {"review": latest, "question": question, "app_name": self.app_name})
else:
# Ensure a form is available for the template
if latest:
@@ -3031,6 +3031,13 @@ class GenericViewBase:
return render(request, "generic/partials/question_reviews_list.html", {"question": question, "reviews": reviews, "app_name": self.app_name})
def question_review_start(self, request):
return render(request, "generic/question_review_start.html", {"app_name": self.app_name})
@method_decorator(user_passes_test(lambda u: u.is_superuser))
def user_answer_delete_multiple(self, request):
print(request.POST["answer_ids"])
+2
View File
@@ -108,6 +108,7 @@ if not DEBUG:
'rad.middleware.coep.COEPMiddleware'
)
ROOT_URLCONF = "rad.urls"
#default_loaders = [
@@ -332,6 +333,7 @@ CIMAR_PASSWORD = ""
CELERY_BROKER_URL = "redis://redis:6379"
CELERY_RESULT_BACKEND = "redis://redis:6379"
try:
from .settings_local import *
except ImportError as e:
+1
View File
@@ -23,6 +23,7 @@
</a>
<ul class="dropdown-menu" aria-labelledby="sbasQuestionsDropdown">
<li><a class="dropdown-item" href="{% url 'sbas:question_view' %}"><i class="bi bi-list-ul"></i> All Questions</a></li>
<li><a class="dropdown-item" href="{% url 'sbas:question_review_start' %}"><i class="bi bi-list-ul"></i> Review Questions</a></li>
<!-- Additional items can be added here -->
</ul>
</li>