Refactor docker-compose.yml build context and add question review URL and view; create question_review.html template
This commit is contained in:
@@ -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 %}
|
||||
@@ -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
@@ -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"])
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user