add topic_group-slug to every topic and attachment url
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from django.urls import path
|
||||
from django.urls import include, path
|
||||
|
||||
from . import apps
|
||||
from . import views
|
||||
@@ -17,43 +17,54 @@ from .views import (
|
||||
|
||||
app_name = apps.InternConfig.name
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="index"),
|
||||
attachment_urlpatterns = [
|
||||
path(
|
||||
"<slug:topic_group>/topic-create/",
|
||||
TopicCreateView.as_view(),
|
||||
name="topic-create",
|
||||
),
|
||||
path("<slug:slug>/", TopicDetailView.as_view(), name="topic"),
|
||||
path(
|
||||
"<slug:slug>/update/",
|
||||
TopicUpdateView.as_view(),
|
||||
name="topic-update",
|
||||
),
|
||||
path(
|
||||
"<slug:slug>/attachment-create/",
|
||||
AttachmentCreateView.as_view(),
|
||||
name="attachment-create",
|
||||
),
|
||||
path("<slug:slug>/create/", TaskCreateView.as_view(), name="task-create"),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/",
|
||||
"",
|
||||
AttachmentDetailView.as_view(),
|
||||
name="attachment",
|
||||
),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/update/",
|
||||
"update/",
|
||||
AttachmentUpdateView.as_view(),
|
||||
name="attachment-update",
|
||||
),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/etherpad-create/",
|
||||
"etherpad-create/",
|
||||
EtherpadCreateView.as_view(),
|
||||
name="etherpad-create",
|
||||
),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/file-create/",
|
||||
"file-create/",
|
||||
FileUploadCreateView.as_view(),
|
||||
name="file-create",
|
||||
),
|
||||
]
|
||||
|
||||
topic_urlpatterns = [
|
||||
path("", TopicDetailView.as_view(), name="topic"),
|
||||
path(
|
||||
"update/",
|
||||
TopicUpdateView.as_view(),
|
||||
name="topic-update",
|
||||
),
|
||||
path(
|
||||
"attachment-create/",
|
||||
AttachmentCreateView.as_view(),
|
||||
name="attachment-create",
|
||||
),
|
||||
path("create/", TaskCreateView.as_view(), name="task-create"),
|
||||
]
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="index"),
|
||||
path(
|
||||
"<slug:topic_group_slug>/topic-create/",
|
||||
TopicCreateView.as_view(),
|
||||
name="topic-create",
|
||||
),
|
||||
path("<slug:topic_group_slug>/<slug:slug>/", include(topic_urlpatterns)),
|
||||
path(
|
||||
"<slug:topic_group_slug>/<slug:topic_slug>/<slug:slug>/",
|
||||
include(attachment_urlpatterns),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -47,12 +47,10 @@ def index(request):
|
||||
|
||||
|
||||
class TopicCreateView(LoginRequiredMixin, CreateView):
|
||||
form_class = TopicCreateForm
|
||||
model = Topic
|
||||
success_url = reverse_lazy("intern:index")
|
||||
template_name = "intern/topic/topic_create.html"
|
||||
form_class = TopicCreateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
@@ -61,75 +59,61 @@ class TopicCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_group"] = TopicGroup.objects.get(slug=self.slug)
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
context["topic_group"] = TopicGroup.objects.get(slug=topic_group_slug)
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("topic_group")
|
||||
|
||||
|
||||
class TopicDetailView(LoginRequiredMixin, DetailView):
|
||||
model = Topic
|
||||
template_name = "intern/topic/topic_detail.html"
|
||||
|
||||
slug = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
self.slug = self.object.slug
|
||||
|
||||
active_topic = Topic.objects.get(id=self.object.id)
|
||||
attachments = Attachment.objects.filter(topic__slug=self.slug).order_by("title")
|
||||
attachments = Attachment.objects.filter(topic=self.object).order_by("title")
|
||||
|
||||
tasks = None
|
||||
if active_topic.task_list:
|
||||
if self.object.task_list:
|
||||
tasks = deque(
|
||||
Task.taskmanager.get_tasks(
|
||||
user=None,
|
||||
assigned_tasks=True,
|
||||
task_list=active_topic.task_list,
|
||||
task_list=self.object.task_list,
|
||||
completed=False,
|
||||
)
|
||||
)
|
||||
|
||||
context = {
|
||||
"active_topic": active_topic,
|
||||
"attachments": attachments,
|
||||
"tasks": tasks,
|
||||
}
|
||||
context["topic"] = self.object
|
||||
context["attachments"] = attachments
|
||||
context["tasks"] = tasks
|
||||
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
return Topic.objects.filter(Q(topic_group__slug=topic_group_slug))
|
||||
|
||||
|
||||
class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
||||
model = Topic
|
||||
template_name = "intern/topic/topic_update.html"
|
||||
form_class = TopicUpdateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
add_log_action(self.request, form, "intern", "topic", False)
|
||||
|
||||
# get new slug
|
||||
obj = form.save(commit=False)
|
||||
self.slug = obj.slug
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
context["topic"] = Topic.objects.get(slug=self.slug)
|
||||
context["topic"] = self.object
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
"topic_group_slug": self.object.topic_group.slug,
|
||||
"slug": self.object.slug,
|
||||
}
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
|
||||
@@ -139,8 +123,6 @@ class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
||||
template_name = "intern/attachment/attachment_create.html"
|
||||
form_class = AttachmentCreateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
add_log_action(self.request, form, "intern", "attachment", True)
|
||||
@@ -148,28 +130,21 @@ class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
context["topic"] = Topic.objects.get(slug=self.slug)
|
||||
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
topic_slug = self.kwargs.get("slug")
|
||||
context["topic"] = Topic.objects.get(
|
||||
Q(topic_group__slug=topic_group_slug) & Q(slug=topic_slug)
|
||||
)
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
}
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
return reverse("intern:topic", kwargs=self.kwargs)
|
||||
|
||||
|
||||
class AttachmentDetailView(LoginRequiredMixin, DetailView):
|
||||
model = Attachment
|
||||
template_name = "intern/attachment/attachment_detail.html"
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
response = super().get(request, *args, **kwargs)
|
||||
|
||||
@@ -183,67 +158,56 @@ class AttachmentDetailView(LoginRequiredMixin, DetailView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
self.topic_slug = self.object.topic.slug
|
||||
self.slug = self.object.slug
|
||||
|
||||
context["active_topic"] = Topic.objects.get(slug=self.topic_slug)
|
||||
|
||||
attachment = Attachment.objects.get(id=self.object.id)
|
||||
context["attachment"] = attachment
|
||||
|
||||
etherpads = Etherpad.objects.filter(attachment=attachment).order_by("-date")
|
||||
context["attachment"] = self.object
|
||||
etherpads = Etherpad.objects.filter(attachment=self.object).order_by("-date")
|
||||
context["etherpads"] = etherpads
|
||||
context["files"] = FileUpload.objects.filter(attachment=attachment)
|
||||
context["files"] = FileUpload.objects.filter(attachment=self.object)
|
||||
|
||||
return context
|
||||
|
||||
def get_queryset(self):
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
topic_slug = self.kwargs.get("topic_slug")
|
||||
return Attachment.objects.filter(
|
||||
Q(topic__topic_group__slug=topic_group_slug) & Q(topic__slug=topic_slug)
|
||||
)
|
||||
|
||||
|
||||
class AttachmentUpdateView(LoginRequiredMixin, UpdateView):
|
||||
form_class = AttachmentUpdateForm
|
||||
model = Attachment
|
||||
template_name = "intern/attachment/attachment_update.html"
|
||||
form_class = AttachmentUpdateForm
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
add_log_action(self.request, form, "intern", "attachment", False)
|
||||
|
||||
# get new slug
|
||||
obj = form.save(commit=False)
|
||||
self.slug = obj.slug
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic"] = Topic.objects.get(slug=self.topic_slug)
|
||||
|
||||
attachment = Attachment.objects.get(
|
||||
Q(slug=self.slug) & Q(topic__slug=self.topic_slug)
|
||||
)
|
||||
context["attachment"] = attachment
|
||||
context["attachment"] = self.object
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
def get_queryset(self):
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
topic_slug = self.kwargs.get("topic_slug")
|
||||
return Attachment.objects.filter(
|
||||
Q(topic__topic_group__slug=topic_group_slug) & Q(topic__slug=topic_slug)
|
||||
)
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
"slug": self.slug,
|
||||
"topic_group_slug": self.object.topic.topic_group.slug,
|
||||
"topic_slug": self.object.topic.slug,
|
||||
"slug": self.object.slug,
|
||||
}
|
||||
return reverse("intern:attachment", kwargs=context)
|
||||
|
||||
|
||||
class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
form_class = EtherpadForm
|
||||
model = Etherpad
|
||||
template_name = "intern/etherpad_create.html"
|
||||
form_class = EtherpadForm
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
@@ -252,35 +216,25 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_slug"] = self.topic_slug
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
topic_slug = self.kwargs.get("topic_slug")
|
||||
slug = self.kwargs.get("slug")
|
||||
attachment = Attachment.objects.get(
|
||||
Q(slug=self.slug) & Q(topic__slug=self.topic_slug)
|
||||
Q(topic__topic_group__slug=topic_group_slug)
|
||||
& Q(topic__slug=topic_slug)
|
||||
& Q(slug=slug)
|
||||
)
|
||||
context["attachment"] = attachment
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
"slug": self.slug,
|
||||
}
|
||||
return reverse("intern:attachment", kwargs=context)
|
||||
return reverse("intern:attachment", kwargs=self.kwargs)
|
||||
|
||||
|
||||
class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
||||
form_class = FileUploadForm
|
||||
model = FileUpload
|
||||
template_name = "intern/file_create.html"
|
||||
form_class = FileUploadForm
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
@@ -289,34 +243,25 @@ class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_slug"] = self.topic_slug
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic_group_slug = self.kwargs.get("topic_group_slug")
|
||||
topic_slug = self.kwargs.get("topic_slug")
|
||||
slug = self.kwargs.get("slug")
|
||||
attachment = Attachment.objects.get(
|
||||
Q(slug=self.slug) & Q(topic__slug=self.topic_slug)
|
||||
Q(topic__topic_group__slug=topic_group_slug)
|
||||
& Q(topic__slug=topic_slug)
|
||||
& Q(slug=slug)
|
||||
)
|
||||
context["attachment"] = attachment
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
"slug": self.slug,
|
||||
}
|
||||
return reverse("intern:attachment", kwargs=context)
|
||||
return reverse("intern:attachment", kwargs=self.kwargs)
|
||||
|
||||
|
||||
class TaskCreateView(LoginRequiredMixin, CreateView):
|
||||
form_class = InternTaskCreateForm
|
||||
model = Task
|
||||
template_name = "intern/task_create.html"
|
||||
form_class = InternTaskCreateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
@@ -325,19 +270,10 @@ class TaskCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic = Topic.objects.get(slug=self.slug)
|
||||
slug = self.kwargs.get("slug")
|
||||
topic = Topic.objects.get(slug=slug)
|
||||
context["topic"] = topic
|
||||
context["task_list"] = topic.task_list
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
}
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
return reverse("intern:topic", kwargs=self.kwargs)
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
<h1 class="page-title">Intern</h1>
|
||||
<div class="flex flex-col gap-y-4 max-w-prose mx-auto text-gray-700 dark:text-gray-300">
|
||||
<aside class="flex gap-2 flex-wrap align-bottom text-sm sm:text-base text-gray-600 dark:text-gray-300">
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:index' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:index' %}#{{ attachment.topic.topic_group.slug }}">{{ attachment.topic.topic_group.title }}</a>
|
||||
<span><i class="fa-solid fa-angle-right"></i></span>
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:topic' active_topic.slug %}">{{ active_topic.title }}</a>
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:topic' attachment.topic.topic_group.slug attachment.topic.slug %}">{{ attachment.topic.title }}</a>
|
||||
<span><i class="fa-solid fa-angle-right"></i></span>
|
||||
<span class="cursor-default">{{ attachment.title }}</span>
|
||||
</aside>
|
||||
@@ -29,7 +29,7 @@
|
||||
</a> -->
|
||||
</div>
|
||||
<div class="documentList rounded divide-y divide-gray-300 dark:divide-gray-600">
|
||||
<a href="{% url 'intern:etherpad-create' active_topic.slug attachment.slug %}" class="flex justify-between">
|
||||
<a href="{% url 'intern:etherpad-create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
|
||||
<h3 class="text-gray-800 dark:text-gray-200"><i class="fa-solid fa-plus fa-fw mr-1"></i>Neues Etherpad erstellen</h2>
|
||||
</a>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<section>
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">Dokumente:</h2>
|
||||
<div class="documentList rounded divide-y divide-gray-300 dark:divide-gray-600">
|
||||
<a href="{% url 'intern:file-create' active_topic.slug attachment.slug %}" class="flex justify-between">
|
||||
<a href="{% url 'intern:file-create' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="flex justify-between">
|
||||
<h3 class="text-gray-800 dark:text-gray-200"><i class="fa-solid fa-plus fa-fw mr-1"></i>Neues Dokument hochladen</h2>
|
||||
</a>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<a href="{% url 'intern:attachment-update' active_topic.slug attachment.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Beschreibung bearbeiten</a>
|
||||
<a href="{% url 'intern:attachment-update' attachment.topic.topic_group.slug attachment.topic.slug attachment.slug %}" class="btn btn-primary block place-self-end"><i class="fa-solid fa-pen-to-square mr-2"></i>Beschreibung bearbeiten</a>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
{{ form.description }}
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="topic" value="{{ topic.id }}" id="id_topic">
|
||||
<input type="hidden" name="topic" value="{{ attachment.topic.id }}" id="id_topic">
|
||||
|
||||
<input type="submit" class="block btn btn-primary" value="Bearbeiten">
|
||||
</form>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
<ul class="ml-7 w-fit" x-show="expandList" x-collapse>
|
||||
{% for topic in topic_group.list %}
|
||||
<li><a href="{% url 'intern:topic' topic.slug %}" class="w-full py-1 inline-block">{{ topic.title }}</a></li>
|
||||
<li><a href="{% url 'intern:topic' topic.topic_group.slug topic.slug %}" class="w-full py-1 inline-block">{{ topic.title }}</a></li>
|
||||
{% endfor %}
|
||||
<li class="py-1">
|
||||
<a href="{% url 'intern:topic-create' topic_group.grouper.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1 text-sm sm:hidden">
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
<ul class="ml-7 w-fit" x-show="expandList" x-collapse>
|
||||
{% for topic in archive_topic %}
|
||||
<li><a href="{% url 'intern:topic' topic.slug %}" class="w-full py-1 inline-block">{{ topic.title }}</a></li>
|
||||
<li><a href="{% url 'intern:topic' topic.topic_group.slug topic.slug %}" class="w-full py-1 inline-block">{{ topic.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="task_list" value="{{ task_list.id }}" id="id_task_list">
|
||||
<input type="hidden" name="task_list" value="{{ topic.task_list.id }}" id="id_task_list">
|
||||
|
||||
<input type="submit" class="block btn btn-primary" value="Hinzufügen">
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ active_topic.title }}{% endblock %}
|
||||
{% block title %}{{ topic.title }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Main Content -->
|
||||
@@ -8,14 +8,14 @@
|
||||
<h1 class="page-title">Intern</h1>
|
||||
<div class="flex flex-col gap-y-8 max-w-prose mx-auto text-gray-700 dark:text-gray-300">
|
||||
<aside class="flex gap-2 flex-wrap align-bottom text-sm sm:text-base text-gray-600 dark:text-gray-300">
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:index' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
<a class="underline hover:text-gray-900 dark:hover:text-gray-100" href="{% url 'intern:index' %}#{{ topic.topic_group.slug }}">{{ topic.topic_group.title }}</a>
|
||||
<span><i class="fa-solid fa-angle-right"></i></span>
|
||||
<span class="cursor-default">{{ active_topic.title }}</span>
|
||||
<span class="cursor-default">{{ topic.title }}</span>
|
||||
</aside>
|
||||
|
||||
{% if active_topic.description %}
|
||||
{% if topic.description %}
|
||||
<div class="db-page-content-left">
|
||||
{{ active_topic.description|safe }}
|
||||
{{ topic.description|safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -32,20 +32,20 @@
|
||||
|
||||
<ul class="flex flex-col gap-1 max-w-fit">
|
||||
{% for attachment in attachments %}
|
||||
<li><a href="{% url 'intern:attachment' active_topic.slug attachment.slug %}" class="py-1 inline-block">{{ attachment.title }}</a></li>
|
||||
<li><a href="{% url 'intern:attachment' topic.topic_group.slug topic.slug attachment.slug %}" class="py-1 inline-block">{{ attachment.title }}</a></li>
|
||||
{% endfor %}
|
||||
|
||||
<li class="mt-2">
|
||||
<a href="{% url 'intern:attachment-create' active_topic.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1">
|
||||
<a href="{% url 'intern:attachment-create' topic.topic_group.slug topic.slug %}" class="border border-gray-700 dark:border-gray-300 rounded px-1.5 py-1">
|
||||
<i class="fa-solid fa-plus mr-1"></i>Eintrag hinzufügen
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<section class="flex flex-col sm:flex-row justify-end gap-4">
|
||||
<a href="{% url 'intern:topic-update' active_topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-pen-to-square mr-2"></i>Thema bearbeiten</a>
|
||||
{% if active_topic.task_list %}
|
||||
<a href="{% url 'intern:task-create' active_topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
|
||||
<a href="{% url 'intern:topic-update' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-pen-to-square mr-2"></i>Thema bearbeiten</a>
|
||||
{% if topic.task_list %}
|
||||
<a href="{% url 'intern:task-create' topic.topic_group.slug topic.slug %}" class="btn btn-primary block"><i class="fa-solid fa-plus-square mr-2"></i>Task hinzufügen</a>
|
||||
{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user