add Create- and UpdateView, labels, link to tasks. change date format.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
from ckeditor_uploader.widgets import CKEditorUploadingWidget
|
||||
from django import forms
|
||||
from django.forms.widgets import HiddenInput
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from tasks.models import Task, TaskList
|
||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
||||
|
||||
|
||||
@@ -16,8 +18,15 @@ class TopicGroupAdminForm(forms.ModelForm):
|
||||
"title",
|
||||
"slug",
|
||||
"order",
|
||||
"short_description",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"short_description": _("Kurzbeschreibung"),
|
||||
}
|
||||
|
||||
|
||||
class TopicAdminForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -25,12 +34,19 @@ class TopicAdminForm(forms.ModelForm):
|
||||
fields = [
|
||||
"title",
|
||||
"slug",
|
||||
"archive",
|
||||
"description",
|
||||
"topic_group",
|
||||
"task_list",
|
||||
"archive",
|
||||
"description",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"task_list": _("Aufgabenbereich"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {"description": CKEditorUploadingWidget(config_name="default")}
|
||||
|
||||
|
||||
@@ -44,6 +60,12 @@ class DocumentationAdminForm(forms.ModelForm):
|
||||
"description",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {"description": CKEditorUploadingWidget(config_name="default")}
|
||||
|
||||
|
||||
@@ -52,8 +74,8 @@ class EtherpadAdminForm(forms.ModelForm):
|
||||
model = Etherpad
|
||||
fields = [
|
||||
"title",
|
||||
"documentation",
|
||||
"date",
|
||||
"documentation",
|
||||
]
|
||||
|
||||
|
||||
@@ -75,6 +97,11 @@ class TopicInlineForm(forms.ModelForm):
|
||||
"slug",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
}
|
||||
|
||||
|
||||
class DocumentationInlineForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -84,16 +111,26 @@ class DocumentationInlineForm(forms.ModelForm):
|
||||
"slug",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
}
|
||||
|
||||
|
||||
class EtherpadInlineForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Etherpad
|
||||
fields = [
|
||||
"title",
|
||||
"documentation",
|
||||
"date",
|
||||
"documentation",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"date": _("Datum"),
|
||||
}
|
||||
|
||||
|
||||
class FileUploadInlineForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -103,6 +140,96 @@ class FileUploadInlineForm(forms.ModelForm):
|
||||
"file_field",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
}
|
||||
|
||||
|
||||
class TopicCreateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Topic
|
||||
fields = [
|
||||
"title",
|
||||
"slug",
|
||||
"description",
|
||||
"topic_group",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"topic_group": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
class TopicUpdateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Topic
|
||||
fields = [
|
||||
"title",
|
||||
"slug",
|
||||
"description",
|
||||
"topic_group",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"topic_group": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
class DocumentationCreateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Documentation
|
||||
|
||||
fields = [
|
||||
"title",
|
||||
"slug",
|
||||
"description",
|
||||
"topic",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"topic": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
class DocumentationUpdateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Documentation
|
||||
|
||||
fields = [
|
||||
"title",
|
||||
"slug",
|
||||
"description",
|
||||
"topic",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
"description": _("Beschreibung"),
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"topic": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
class EtherpadForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -120,7 +247,8 @@ class EtherpadForm(forms.ModelForm):
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"date": DateInput(format=("%d-%m-%Y")),
|
||||
"date": DateInput(format=("%Y-%m-%d")),
|
||||
"documentation": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
@@ -132,3 +260,7 @@ class FileUploadForm(forms.ModelForm):
|
||||
"file_field",
|
||||
"documentation",
|
||||
]
|
||||
|
||||
widgets = {
|
||||
"documentation": HiddenInput,
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ class TopicGroup(models.Model):
|
||||
title = models.CharField(verbose_name="Titel", max_length=128)
|
||||
slug = models.SlugField(max_length=10, unique=True)
|
||||
|
||||
short_description = models.TextField(null=True, blank=True)
|
||||
|
||||
order = models.PositiveSmallIntegerField(
|
||||
verbose_name="Reihenfolge", unique=True, null=True, blank=True
|
||||
)
|
||||
@@ -34,7 +36,7 @@ class TopicGroup(models.Model):
|
||||
return self.title
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("intern") + "#" + self.slug
|
||||
return reverse("intern:index") + "#" + self.slug
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
@@ -68,7 +70,7 @@ class Topic(models.Model):
|
||||
return self.title
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("topic", kwargs={"slug": self.slug})
|
||||
return reverse("intern:topic", kwargs={"slug": self.slug})
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
@@ -107,7 +109,7 @@ class Documentation(models.Model):
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("docu", kwargs=kwargs)
|
||||
return reverse("intern:docu", kwargs=kwargs)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.slug:
|
||||
@@ -118,6 +120,8 @@ class Documentation(models.Model):
|
||||
|
||||
class Etherpad(models.Model):
|
||||
title = models.CharField(verbose_name="Titel", max_length=128)
|
||||
slug = models.SlugField(null=True, blank=True)
|
||||
|
||||
etherpad_key = models.CharField(max_length=50, blank=True)
|
||||
date = models.DateField(verbose_name="Datum", default=date.today)
|
||||
|
||||
@@ -143,11 +147,14 @@ class Etherpad(models.Model):
|
||||
+ "-"
|
||||
+ self.documentation.slug
|
||||
+ "-"
|
||||
+ slugify(self.title)
|
||||
+ self.slug
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
pad_name = slugify(self.__get_pad_name())
|
||||
if not self.slug:
|
||||
self.slug = slugify(self.title)
|
||||
|
||||
pad_name = self.__get_pad_name()
|
||||
|
||||
if len(pad_name) > 50:
|
||||
raise ValidationError(
|
||||
|
||||
@@ -1,13 +1,45 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import apps
|
||||
from . import views
|
||||
from .views import EtherpadCreateView, FileUploadCreateView
|
||||
from .views import (
|
||||
DocumentationCreateView,
|
||||
DocumentationUpdateView,
|
||||
EtherpadCreateView,
|
||||
FileUploadCreateView,
|
||||
TaskCreateView,
|
||||
TopicCreateView,
|
||||
TopicUpdateView,
|
||||
)
|
||||
|
||||
|
||||
app_name = apps.InternConfig.name
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="intern"),
|
||||
path("", views.index, name="index"),
|
||||
path(
|
||||
"<slug:topic_group>/topic-create/",
|
||||
TopicCreateView.as_view(),
|
||||
name="topic-create",
|
||||
),
|
||||
path("<slug:slug>/", views.show_topic, name="topic"),
|
||||
path(
|
||||
"<slug:slug>/update/",
|
||||
TopicUpdateView.as_view(),
|
||||
name="topic-update",
|
||||
),
|
||||
path(
|
||||
"<slug:slug>/docu-create/",
|
||||
DocumentationCreateView.as_view(),
|
||||
name="docu-create",
|
||||
),
|
||||
path("<slug:slug>/create/", TaskCreateView.as_view(), name="task-create"),
|
||||
path("<slug:topic_slug>/<slug:slug>/", views.show_docu, name="docu"),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/update/",
|
||||
DocumentationUpdateView.as_view(),
|
||||
name="docu-update",
|
||||
),
|
||||
path(
|
||||
"<slug:topic_slug>/<slug:slug>/etherpad-create/",
|
||||
EtherpadCreateView.as_view(),
|
||||
|
||||
@@ -6,14 +6,22 @@ from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.db.models import F, Q
|
||||
from django.http import HttpResponseRedirect, Http404
|
||||
from django.shortcuts import render
|
||||
from django.views.generic.edit import CreateView
|
||||
from django.urls import reverse
|
||||
from django.views.generic.edit import CreateView, UpdateView
|
||||
from django.urls import reverse_lazy, reverse
|
||||
|
||||
from authentications.decorators import authenticated_user
|
||||
from documents.api import get_pad_link
|
||||
from documents.etherpadlib import add_ep_cookie
|
||||
from tasks.forms import InternTaskCreateForm
|
||||
from tasks.models import Task
|
||||
from .forms import EtherpadForm, FileUploadForm
|
||||
from .forms import (
|
||||
DocumentationCreateForm,
|
||||
DocumentationUpdateForm,
|
||||
EtherpadForm,
|
||||
FileUploadForm,
|
||||
TopicCreateForm,
|
||||
TopicUpdateForm,
|
||||
)
|
||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -21,15 +29,15 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
@authenticated_user
|
||||
def index(request):
|
||||
topic = deque(
|
||||
Topic.objects.filter(archive=False).order_by(
|
||||
topic = Topic.objects.filter(archive=False).order_by(
|
||||
F("topic_group__order").asc(nulls_last=True), "topic_group", "title"
|
||||
)
|
||||
)
|
||||
archive_topic = deque(Topic.objects.filter(archive=True))
|
||||
empty_topic_groups = TopicGroup.objects.filter(topic=None)
|
||||
archive_topic = Topic.objects.filter(archive=True)
|
||||
|
||||
context = {
|
||||
"topic": topic,
|
||||
"empty_topic_groups": empty_topic_groups,
|
||||
"archive_topic": archive_topic,
|
||||
}
|
||||
|
||||
@@ -42,7 +50,7 @@ def show_topic(request, slug=None):
|
||||
if not active_topic:
|
||||
raise Http404("wrong topic")
|
||||
|
||||
docu = deque(Documentation.objects.filter(topic__slug=slug).order_by("title"))
|
||||
docu = Documentation.objects.filter(topic__slug=slug).order_by("title")
|
||||
|
||||
tasks = None
|
||||
if active_topic.task_list:
|
||||
@@ -104,9 +112,9 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
form_add_etherpad = EtherpadForm(initial=initial)
|
||||
form_add_file = FileUploadForm(initial=initial)
|
||||
|
||||
files = deque(FileUpload.objects.filter(documentation=active_docu))
|
||||
files = FileUpload.objects.filter(documentation=active_docu)
|
||||
|
||||
docus = deque(Etherpad.objects.filter(documentation=active_docu).order_by("-date"))
|
||||
docus = Etherpad.objects.filter(documentation=active_docu).order_by("-date")
|
||||
etherpads = deque([])
|
||||
|
||||
# list of etherpad url-link of any etherpads
|
||||
@@ -138,6 +146,124 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
return response
|
||||
|
||||
|
||||
class TopicCreateView(LoginRequiredMixin, CreateView):
|
||||
model = Topic
|
||||
success_url = reverse_lazy("intern:index")
|
||||
template_name = "intern/topic/topic_create.html"
|
||||
form_class = TopicCreateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_group"] = self.slug
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("topic_group")
|
||||
topic_group = TopicGroup.objects.filter(slug=self.slug).first()
|
||||
|
||||
context = {
|
||||
"topic_group": topic_group,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
||||
model = Topic
|
||||
template_name = "intern/topic/topic_update.html"
|
||||
form_class = TopicUpdateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
|
||||
context = {
|
||||
"topic": topic,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
|
||||
|
||||
class DocumentationCreateView(LoginRequiredMixin, CreateView):
|
||||
model = Documentation
|
||||
template_name = "intern/docu/docu_create.html"
|
||||
form_class = DocumentationCreateForm
|
||||
|
||||
slug = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
|
||||
context = {
|
||||
"topic": topic,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
|
||||
|
||||
class DocumentationUpdateView(LoginRequiredMixin, UpdateView):
|
||||
model = Documentation
|
||||
template_name = "intern/docu/docu_update.html"
|
||||
form_class = DocumentationUpdateForm
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_slug"] = self.topic_slug
|
||||
context["slug"] = self.slug
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
active_docu = Documentation.objects.filter(slug=self.slug).first()
|
||||
context = {
|
||||
"documentation": active_docu,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("intern:docu", kwargs=context)
|
||||
|
||||
|
||||
class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
model = Etherpad
|
||||
template_name = "intern/etherpad_create.html"
|
||||
@@ -156,7 +282,7 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
active_docu = Documentation.objects.filter(slug=self.kwargs.get("slug")).first()
|
||||
active_docu = Documentation.objects.filter(slug=self.slug).first()
|
||||
context = {
|
||||
"documentation": active_docu,
|
||||
}
|
||||
@@ -169,7 +295,7 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("docu", kwargs=context)
|
||||
return reverse("intern:docu", kwargs=context)
|
||||
|
||||
|
||||
class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
||||
@@ -204,4 +330,40 @@ class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("docu", kwargs=context)
|
||||
return reverse("intern:docu", kwargs=context)
|
||||
|
||||
|
||||
class TaskCreateView(LoginRequiredMixin, CreateView):
|
||||
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
|
||||
# add_log_action(self.request, form, True)
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.slug = self.kwargs.get("slug")
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
|
||||
context = {
|
||||
"topic": topic,
|
||||
"task_list": topic.task_list,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"slug": self.slug,
|
||||
}
|
||||
|
||||
return reverse("intern:topic", kwargs=context)
|
||||
|
||||
@@ -22,6 +22,24 @@ class DocumentInlineForm(forms.ModelForm):
|
||||
"date",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel"),
|
||||
"slug": _("Permalink"),
|
||||
}
|
||||
|
||||
|
||||
class TaskListAdminForm(forms.ModelForm):
|
||||
users = forms.ModelMultipleChoiceField(
|
||||
label="Benutzer",
|
||||
help_text="Es können nur die Benutzer ausgewählt werden, die sich auf der Homepage angemeldet haben.",
|
||||
queryset=User.objects.all().order_by("username"),
|
||||
widget=FilteredSelectMultiple("User", is_stacked=False),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = TaskList
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class TaskAdminForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -56,6 +74,7 @@ class TaskCreateForm(forms.ModelForm):
|
||||
"task_list",
|
||||
"due_date",
|
||||
"assigned_to",
|
||||
"note",
|
||||
]
|
||||
|
||||
labels = {
|
||||
@@ -67,16 +86,23 @@ class TaskCreateForm(forms.ModelForm):
|
||||
|
||||
widgets = {
|
||||
"due_date": DateInput(
|
||||
format=("%d-%m-%Y"),
|
||||
format=("%Y-%m-%d"),
|
||||
)
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
if "user" in kwargs:
|
||||
user = kwargs.pop("user")
|
||||
else:
|
||||
user = None
|
||||
|
||||
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||
self.fields["assigned_to"].empty_label = "Alle"
|
||||
self.fields["assigned_to"].queryset = self.fields[
|
||||
"assigned_to"
|
||||
].queryset.order_by("username")
|
||||
qs = self.fields["assigned_to"].queryset
|
||||
self.fields["assigned_to"].queryset = qs.order_by("username")
|
||||
|
||||
if user:
|
||||
self.fields["task_list"].queryset = TaskList.objects.filter(users=user)
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
@@ -84,10 +110,7 @@ class TaskCreateForm(forms.ModelForm):
|
||||
|
||||
if assigned_to:
|
||||
task_list = TaskList.objects.get(id=cleaned_data["task_list"].id)
|
||||
for elem in task_list.users.all():
|
||||
if assigned_to == elem:
|
||||
break
|
||||
else:
|
||||
if not task_list.users.filter(username=assigned_to.username):
|
||||
raise ValidationError(
|
||||
_(
|
||||
f"User '{assigned_to}' gibt es nicht in der User-Liste der Task-Gruppe '{task_list}'."
|
||||
@@ -97,7 +120,7 @@ class TaskCreateForm(forms.ModelForm):
|
||||
return cleaned_data
|
||||
|
||||
|
||||
class TaskUpdateForm(forms.ModelForm):
|
||||
class TaskUpdateForm(TaskCreateForm):
|
||||
class Meta:
|
||||
model = Task
|
||||
|
||||
@@ -106,6 +129,7 @@ class TaskUpdateForm(forms.ModelForm):
|
||||
"due_date",
|
||||
"priority",
|
||||
"note",
|
||||
"task_list",
|
||||
]
|
||||
|
||||
labels = {
|
||||
@@ -115,32 +139,13 @@ class TaskUpdateForm(forms.ModelForm):
|
||||
|
||||
widgets = {
|
||||
"due_date": DateInput(
|
||||
format=("%d-%m-%Y"),
|
||||
)
|
||||
format=("%Y-%m-%d"),
|
||||
),
|
||||
"task_list": HiddenInput,
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||
self.fields["assigned_to"].empty_label = "Alle"
|
||||
self.fields["assigned_to"].queryset = self.fields[
|
||||
"assigned_to"
|
||||
].queryset.order_by("username")
|
||||
|
||||
|
||||
class TaskListAdminForm(forms.ModelForm):
|
||||
users = forms.ModelMultipleChoiceField(
|
||||
label="Benutzer",
|
||||
help_text="Es können nur die Benutzer ausgewählt werden, die sich auf der Homepage angemeldet haben.",
|
||||
queryset=User.objects.all().order_by("username"),
|
||||
widget=FilteredSelectMultiple("User", is_stacked=False),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = TaskList
|
||||
fields = "__all__"
|
||||
|
||||
|
||||
class DocumentForm(forms.ModelForm):
|
||||
class DocumentCreateForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Document
|
||||
|
||||
@@ -155,4 +160,35 @@ class DocumentForm(forms.ModelForm):
|
||||
"date": _("Datum"),
|
||||
}
|
||||
|
||||
widgets = {"date": DateInput(format=("%d-%m-%Y")), "task": HiddenInput}
|
||||
widgets = {
|
||||
"date": DateInput(format=("%d-%m-%Y")),
|
||||
"task": HiddenInput,
|
||||
}
|
||||
|
||||
|
||||
class InternTaskCreateForm(TaskCreateForm):
|
||||
# form for creating a task from intern page.
|
||||
class Meta:
|
||||
model = Task
|
||||
|
||||
fields = [
|
||||
"title",
|
||||
"task_list",
|
||||
"due_date",
|
||||
"assigned_to",
|
||||
"note",
|
||||
]
|
||||
|
||||
labels = {
|
||||
"title": _("Titel des Tasks"),
|
||||
"task_list": _("Task-Gruppe"),
|
||||
"due_date": _("Fälligkeitsdatum"),
|
||||
"assigned_to": _("Zuweisen an"),
|
||||
}
|
||||
|
||||
widgets = {
|
||||
"due_date": DateInput(
|
||||
format=("%d-%m-%Y"),
|
||||
),
|
||||
"task_list": HiddenInput,
|
||||
}
|
||||
|
||||
@@ -29,18 +29,16 @@ class TaskList(models.Model):
|
||||
return self.name
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("tasks")
|
||||
return reverse("tasks:index")
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
def clean(self):
|
||||
if not self.slug:
|
||||
self.slug = slugify(self.name)
|
||||
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
||||
class Task(models.Model):
|
||||
title = models.CharField(verbose_name="Titel", max_length=128)
|
||||
slug = models.SlugField(unique=True, null=True, blank=True)
|
||||
slug = models.SlugField(null=True, blank=True)
|
||||
|
||||
task_list = models.ForeignKey(
|
||||
TaskList, verbose_name="Aufgabenbereich", on_delete=models.CASCADE, null=True
|
||||
@@ -82,12 +80,13 @@ class Task(models.Model):
|
||||
return self.title
|
||||
|
||||
def get_absolute_url(self):
|
||||
return reverse("task-detail", kwargs={"pk": self.id})
|
||||
return reverse("tasks:task-detail", kwargs={"pk": self.id})
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
def clean(self):
|
||||
if not self.slug:
|
||||
self.slug = slugify(self.title)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.completed and not self.completed_date:
|
||||
self.completed_date = timezone.now().date()
|
||||
|
||||
@@ -99,7 +98,7 @@ class Task(models.Model):
|
||||
|
||||
class Document(models.Model):
|
||||
title = models.CharField(verbose_name="Titel", max_length=128)
|
||||
slug = models.SlugField(unique=True, null=True, blank=True)
|
||||
slug = models.SlugField(null=True, blank=True)
|
||||
|
||||
etherpad_key = models.CharField(max_length=50, blank=True)
|
||||
date = models.DateField(verbose_name="Datum", default=date.today)
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import apps
|
||||
from . import views
|
||||
from .views import TaskCreate, TaskDetail, TaskUpdate, DocumentCreate
|
||||
|
||||
|
||||
app_name = apps.TasksConfig.name
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="tasks"),
|
||||
path("", views.index, name="index"),
|
||||
path("task-create/", TaskCreate.as_view(), name="task-create"),
|
||||
path("<int:pk>/docu-create/", DocumentCreate.as_view(), name="docu-create"),
|
||||
path("<int:pk>/update/", TaskUpdate.as_view(), name="task-update"),
|
||||
|
||||
@@ -15,8 +15,8 @@ from django.utils import timezone
|
||||
from authentications.decorators import authenticated_user
|
||||
from documents.api import get_pad_link
|
||||
from documents.etherpadlib import add_ep_cookie
|
||||
|
||||
from .forms import DocumentForm, TaskCreateForm, TaskUpdateForm
|
||||
from intern.models import Topic
|
||||
from .forms import DocumentCreateForm, TaskCreateForm, TaskUpdateForm
|
||||
from .models import Document, Task, TaskList
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -54,15 +54,13 @@ def index(request):
|
||||
else:
|
||||
show_all_tasks = False
|
||||
|
||||
tasks = deque(
|
||||
Task.taskmanager.get_tasks(
|
||||
tasks = Task.taskmanager.get_tasks(
|
||||
user=request.user.id,
|
||||
completed=current_action,
|
||||
task_list=tasklist,
|
||||
all_tasks=show_all_tasks,
|
||||
)
|
||||
)
|
||||
tasklists = deque(TaskList.objects.all())
|
||||
tasklists = TaskList.objects.all()
|
||||
|
||||
context = {
|
||||
"tasks": tasks,
|
||||
@@ -98,21 +96,33 @@ def add_log_action(request, form, add=True):
|
||||
|
||||
class TaskCreate(LoginRequiredMixin, CreateView):
|
||||
model = Task
|
||||
success_url = reverse_lazy("tasks")
|
||||
success_url = reverse_lazy("tasks:index")
|
||||
template_name = "tasks/task_create.html"
|
||||
form_class = TaskCreateForm
|
||||
|
||||
user = None
|
||||
|
||||
def form_valid(self, form):
|
||||
form.instance.created_by = self.request.user
|
||||
add_log_action(self.request, form, True)
|
||||
return super().form_valid(form)
|
||||
|
||||
def get_initial(self):
|
||||
self.user = self.request.user
|
||||
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super().get_form_kwargs()
|
||||
kwargs["user"] = self.request.user
|
||||
return kwargs
|
||||
|
||||
|
||||
class TaskUpdate(LoginRequiredMixin, UpdateView):
|
||||
model = Task
|
||||
template_name = "tasks/task_update.html"
|
||||
form_class = TaskUpdateForm
|
||||
|
||||
pk = None
|
||||
|
||||
def form_valid(self, form):
|
||||
add_log_action(self.request, form, False)
|
||||
return super().form_valid(form)
|
||||
@@ -121,12 +131,12 @@ class TaskUpdate(LoginRequiredMixin, UpdateView):
|
||||
kwargs = {
|
||||
"pk": self.kwargs.get("pk"),
|
||||
}
|
||||
return reverse("task-detail", kwargs=kwargs)
|
||||
return reverse("tasks:task-detail", kwargs=kwargs)
|
||||
|
||||
|
||||
class TaskDetail(LoginRequiredMixin, DetailView):
|
||||
model = Task
|
||||
success_url = reverse_lazy("tasks")
|
||||
success_url = reverse_lazy("tasks:index")
|
||||
template_name = "tasks/task_detail.html"
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
@@ -142,9 +152,8 @@ class TaskDetail(LoginRequiredMixin, DetailView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
docus = deque(
|
||||
Document.objects.filter(task__id=self.object.id).order_by("-date")
|
||||
)
|
||||
docus = Document.objects.filter(task__id=self.object.id).order_by("-date")
|
||||
|
||||
documents = deque([])
|
||||
|
||||
# list of etherpad url-link of any documents
|
||||
@@ -158,13 +167,15 @@ class TaskDetail(LoginRequiredMixin, DetailView):
|
||||
)
|
||||
context["documents"] = documents
|
||||
|
||||
context["topic"] = Topic.objects.filter(task_list=self.object.task_list).first()
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class DocumentCreate(LoginRequiredMixin, CreateView):
|
||||
model = Document
|
||||
template_name = "tasks/docu_create.html"
|
||||
form_class = DocumentForm
|
||||
form_class = DocumentCreateForm
|
||||
|
||||
task_id = None
|
||||
|
||||
@@ -186,4 +197,4 @@ class DocumentCreate(LoginRequiredMixin, CreateView):
|
||||
kwargs = {
|
||||
"pk": self.task_id,
|
||||
}
|
||||
return reverse("task-detail", kwargs=kwargs)
|
||||
return reverse("tasks:task-detail", kwargs=kwargs)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell padding-top-1">
|
||||
<h3>
|
||||
<a href="{% url 'intern' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
/ <a href="{% url 'topic' active_topic.slug %}">{{ active_topic.title }}</a>
|
||||
<a href="{% url 'intern:index' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
/ <a href="{% url 'intern:topic' active_topic.slug %}">{{ active_topic.title }}</a>
|
||||
/ {{ active_docu.title }}
|
||||
</h3>
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="grid-x grid-padding-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'admin:intern_documentation_change' active_docu.id %}">Beschreibung bearbeiten</a>
|
||||
<a class="button" href="{% url 'intern:docu-update' active_topic.slug active_docu.slug %}">Beschreibung bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell">
|
||||
Etherpad Dokumente:
|
||||
<a href="{% url 'etherpad-create' active_topic.slug active_docu.slug %}">
|
||||
<a href="{% url 'intern:etherpad-create' active_topic.slug active_docu.slug %}">
|
||||
<div class="news-hero-compact">
|
||||
<div class="news-hero-compact-text">
|
||||
<p style="margin-bottom: 0rem;">+ neues Etherpad erstellen</p>
|
||||
@@ -54,7 +54,7 @@
|
||||
{% endfor %}
|
||||
|
||||
Dokumente:
|
||||
<a href="{% url 'file-create' active_topic.slug active_docu.slug %}">
|
||||
<a href="{% url 'intern:file-create' active_topic.slug active_docu.slug %}">
|
||||
<div class="news-hero-compact">
|
||||
<div class="news-hero-compact-text">
|
||||
<p style="margin-bottom: 0rem;">+ neue Datei hochladen</p>
|
||||
@@ -78,5 +78,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
23
fet2020/templates/intern/docu/docu_create.html
Normal file
23
fet2020/templates/intern/docu/docu_create.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:topic' slug %}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<h2>Neue Dokumentation erstellen</h2>
|
||||
<div class="grid-x">
|
||||
<div class="cell">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" class="button" name="btn_input" value="Hinzufügen">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
fet2020/templates/intern/docu/docu_update.html
Normal file
26
fet2020/templates/intern/docu/docu_update.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'admin:intern_documentation_change' documentation.id %}">Dokumentation im Admin bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<h2>Dokumentation '{{ documentation.title }}' bearbeiten</h2>
|
||||
<div class="grid-x">
|
||||
<div class="cell">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" class="button" name="btn_input" value="Bearbeiten">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1 padding-left-1 padding-right-1">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'docu' topic_slug slug %}">Zurück</a>
|
||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -20,5 +20,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1 padding-left-1 padding-right-1">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'docu' topic_slug slug %}">Zurück</a>
|
||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -20,5 +20,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
{% if request.user.is_authenticated %}
|
||||
@@ -16,10 +16,14 @@
|
||||
<h3>{{ topic.grouper.title }}<a class="headerlink" id="{{ topic.list.0.topic_group.slug }}" href="#{{ topic.list.0.topic_group.slug }}" title="Permalink to {{ topic.grouper }}" style="color: lightgrey;"> #</a></h3>
|
||||
</div>
|
||||
|
||||
{% if topic.grouper.short_description %}
|
||||
{{ topic.grouper.short_description }}
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
{% for tp in topic.list %}
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'topic' tp.slug %}">
|
||||
<a href="{% url 'intern:topic' tp.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
{{ tp.title }}
|
||||
@@ -29,7 +33,25 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'admin:intern_topic_add' %}">
|
||||
<a href="{% url 'intern:topic-create' topic.list.0.topic_group.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
+
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% for topic_group in empty_topic_groups %}
|
||||
<div class="internheader">
|
||||
<h3>{{ topic_group.title }}<a class="headerlink" id="{{ topic_group.slug }}" href="#{{ topic_group.slug }}" title="Permalink to {{ topic_group.title }}" style="color: lightgrey;"> #</a></h3>
|
||||
</div>
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'intern:topic-create' topic_group.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
+
|
||||
@@ -48,7 +70,7 @@
|
||||
<div class="grid-x grid-padding-x">
|
||||
{% for tp in archive_topic %}
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'topic' tp.slug %}">
|
||||
<a href="{% url 'intern:topic' tp.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
{{ tp.title }}
|
||||
@@ -59,7 +81,5 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
23
fet2020/templates/intern/task_create.html
Normal file
23
fet2020/templates/intern/task_create.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends 'layout.html' %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:topic' slug %}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<h2>Neuen Task hinzufügen</h2>
|
||||
<div class="grid-x">
|
||||
<div class="cell">
|
||||
<form action="" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" class="button" name="btn_input" value="Hinzufügen">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -1,11 +1,11 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x grid-padding-x">
|
||||
<div class="cell padding-top-1">
|
||||
<h3>
|
||||
<a href="{% url 'intern' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
<a href="{% url 'intern:index' %}#{{ active_topic.topic_group.slug }}">{{ active_topic.topic_group.title }}</a>
|
||||
/ {{ active_topic.title }}
|
||||
</h3>
|
||||
</div>
|
||||
@@ -14,11 +14,13 @@
|
||||
<div class="intern-hero">
|
||||
<div class="grid-x padding-top-1 padding-left-1 padding-right-1">
|
||||
<div class="cell large-3 medium-4 small-10">
|
||||
<a class="button" href="{% url 'admin:intern_topic_change' active_topic.id %}">Thema bearbeiten</a>
|
||||
<a class="button" href="{% url 'intern:topic-update' active_topic.slug %}">Thema bearbeiten</a>
|
||||
</div>
|
||||
{% if active_topic.task_list %}
|
||||
<div class="cell large-3 medium-4 small-10">
|
||||
<a class="button" href="{% url 'task-create' %}">neuen Task hinzufügen</a>
|
||||
<a class="button" href="{% url 'intern:task-create' active_topic.slug %}">neuen Task hinzufügen</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if active_topic.description %}
|
||||
@@ -34,18 +36,17 @@
|
||||
|
||||
{% for task in tasks %}
|
||||
<div class="cell">
|
||||
<a href="{% url 'task-detail' task.id %}">{{ task }}</a>
|
||||
<a href="{% url 'tasks:task-detail' task.id %}">{{ task }}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-x grid-padding-x">
|
||||
{% for docu in docus %}
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'docu' active_topic.slug docu.slug %}">
|
||||
<a href="{% url 'intern:docu' active_topic.slug docu.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
{{ docu.title }}
|
||||
@@ -56,7 +57,7 @@
|
||||
{% endfor %}
|
||||
|
||||
<div class="cell large-2 medium-4 small-6">
|
||||
<a href="{% url 'admin:intern_documentation_add' %}">
|
||||
<a href="{% url 'intern:docu-create' active_topic.slug %}">
|
||||
<div class="intern-topic">
|
||||
<div class="intern-topic-text">
|
||||
+
|
||||
@@ -64,10 +65,7 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
23
fet2020/templates/intern/topic/topic_create.html
Normal file
23
fet2020/templates/intern/topic/topic_create.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:index' %}">Zurück</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<h2>Neues Thema erstellen</h2>
|
||||
<div class="grid-x">
|
||||
<div class="cell">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" class="button" name="btn_input" value="Hinzufügen">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
fet2020/templates/intern/topic/topic_update.html
Normal file
26
fet2020/templates/intern/topic/topic_update.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "layout.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:topic' slug %}">Zurück</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'admin:intern_topic_change' topic.id %}">Thema im Admin bearbeiten</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<h2>Thema '{{ topic.title }}' bearbeiten</h2>
|
||||
<div class="grid-x">
|
||||
<div class="cell">
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<input type="submit" class="button" name="btn_input" value="Bearbeiten">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -53,8 +53,8 @@
|
||||
</a>
|
||||
</li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="{% url 'admin:index' %}">Admin</a></li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="{% url 'tasks' %}">Tasks</a></li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="{% url 'intern' %}">Intern</a></li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="{% url 'tasks:index' %}">Tasks</a></li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="{% url 'intern:index' %}">Intern</a></li>
|
||||
<li><a class="button header-intern-btn header-intern-link" href="https://legacy.fet.at/home/intern">Legacy Intern</a></li>
|
||||
{% endif %}
|
||||
<li><a class="button header-btn header-link" href="{% url 'posts:posts.index' %}">News</a></li>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'task-create' %}">neuen Task hinzufügen</a>
|
||||
<a class="button" href="{% url 'tasks:task-create' %}">neuen Task hinzufügen</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="grid-x">
|
||||
<div class="cell medium-3 large-3 small-10">
|
||||
<input type="checkbox" name="checkbox" value="{{ task.id }}" {% if task.completed %} checked {% endif %}>
|
||||
<a href="{% url 'task-detail' task.id %}">{{ task.title }}</a>
|
||||
<a href="{% url 'tasks:task-detail' task.id %}">{{ task.title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="cell medium-3 large-3 small-10">
|
||||
@@ -90,5 +90,4 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'tasks' %}">Zurück</a>
|
||||
<a class="button" href="{% url 'tasks:index' %}">Zurück</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'admin:tasks_tasklist_add' %}">Task-Gruppe erstellen</a>
|
||||
@@ -23,5 +23,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'tasks' %}">Zurück</a>
|
||||
<a class="button" href="{% url 'tasks:index' %}">Zurück</a>
|
||||
</div>
|
||||
{% if topic %}
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'intern:topic' topic.slug %}">Zu {{ topic.title }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'tasks:task-update' task.id %}">Task bearbeiten</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'task-update' task.id %}">Task bearbeiten</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'docu-create' task.id %}">Etherpad hinzufügen</a>
|
||||
<a class="button" href="{% url 'tasks:docu-create' task.id %}">Etherpad hinzufügen</a>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -44,5 +49,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends 'layout.html' %}
|
||||
{% block content %}
|
||||
|
||||
{% block content %}
|
||||
<div class="grid-container">
|
||||
<div class="grid-x padding-top-1">
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'task-detail' task.id %}">Zurück</a>
|
||||
<a class="button" href="{% url 'tasks:task-detail' task.id %}">Zurück</a>
|
||||
</div>
|
||||
<div class="cell large-3 medium-4 small-12">
|
||||
<a class="button" href="{% url 'admin:tasks_task_change' task.id %}">Task im Admin bearbeiten</a>
|
||||
@@ -23,5 +23,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user