rename to attachment
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.db.models import F
|
from django.db.models import F
|
||||||
|
|
||||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
from .models import TopicGroup, Topic, Attachment, Etherpad, FileUpload
|
||||||
from .forms import (
|
from .forms import (
|
||||||
TopicGroupAdminForm,
|
TopicGroupAdminForm,
|
||||||
TopicAdminForm,
|
TopicAdminForm,
|
||||||
DocumentationAdminForm,
|
AttachmentAdminForm,
|
||||||
EtherpadAdminForm,
|
EtherpadAdminForm,
|
||||||
FileUploadAdminForm,
|
FileUploadAdminForm,
|
||||||
TopicInlineForm,
|
TopicInlineForm,
|
||||||
DocumentationInlineForm,
|
AttachmentInlineForm,
|
||||||
EtherpadInlineForm,
|
EtherpadInlineForm,
|
||||||
FileUploadInlineForm,
|
FileUploadInlineForm,
|
||||||
)
|
)
|
||||||
@@ -25,12 +25,12 @@ class TopicInline(admin.TabularInline):
|
|||||||
readonly_fields = ("slug",)
|
readonly_fields = ("slug",)
|
||||||
|
|
||||||
|
|
||||||
class DocumentationInline(admin.TabularInline):
|
class AttachmentInline(admin.TabularInline):
|
||||||
model = Documentation
|
model = Attachment
|
||||||
form = DocumentationInlineForm
|
form = AttachmentInlineForm
|
||||||
extra = 0
|
extra = 0
|
||||||
verbose_name = "Dokumentation"
|
verbose_name = "Anhang Ordner"
|
||||||
verbose_name_plural = "Dokumentation-Übersicht"
|
verbose_name_plural = "Anhang Ordner"
|
||||||
readonly_fields = ("slug",)
|
readonly_fields = ("slug",)
|
||||||
|
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ class TopicAdmin(admin.ModelAdmin):
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
inlines = (DocumentationInline,)
|
inlines = (AttachmentInline,)
|
||||||
|
|
||||||
list_filter = ["topic_group", "archive"]
|
list_filter = ["topic_group", "archive"]
|
||||||
list_display = ["title", "topic_group", "archive"]
|
list_display = ["title", "topic_group", "archive"]
|
||||||
@@ -152,9 +152,9 @@ class TopicAdmin(admin.ModelAdmin):
|
|||||||
super().save_model(request, obj, form, change)
|
super().save_model(request, obj, form, change)
|
||||||
|
|
||||||
|
|
||||||
class DocumentationAdmin(admin.ModelAdmin):
|
class AttachmentAdmin(admin.ModelAdmin):
|
||||||
form = DocumentationAdminForm
|
form = AttachmentAdminForm
|
||||||
model = Documentation
|
model = Attachment
|
||||||
|
|
||||||
readonly_fields = ("slug",)
|
readonly_fields = ("slug",)
|
||||||
fieldsets = (
|
fieldsets = (
|
||||||
@@ -211,12 +211,12 @@ class EtherpadAdmin(admin.ModelAdmin):
|
|||||||
model = Etherpad
|
model = Etherpad
|
||||||
|
|
||||||
list_filter = [
|
list_filter = [
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
list_display = [
|
list_display = [
|
||||||
"title",
|
"title",
|
||||||
"date",
|
"date",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
ordering = ["-date"]
|
ordering = ["-date"]
|
||||||
|
|
||||||
@@ -249,11 +249,11 @@ class FileUploadAdmin(admin.ModelAdmin):
|
|||||||
model = FileUpload
|
model = FileUpload
|
||||||
|
|
||||||
list_filter = [
|
list_filter = [
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
list_display = [
|
list_display = [
|
||||||
"title",
|
"title",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
def add_view(self, request, form_url="", extra_context=None):
|
def add_view(self, request, form_url="", extra_context=None):
|
||||||
@@ -282,6 +282,6 @@ class FileUploadAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
admin.site.register(TopicGroup, TopicGroupAdmin)
|
admin.site.register(TopicGroup, TopicGroupAdmin)
|
||||||
admin.site.register(Topic, TopicAdmin)
|
admin.site.register(Topic, TopicAdmin)
|
||||||
admin.site.register(Documentation, DocumentationAdmin)
|
admin.site.register(Attachment, AttachmentAdmin)
|
||||||
admin.site.register(Etherpad, EtherpadAdmin)
|
admin.site.register(Etherpad, EtherpadAdmin)
|
||||||
admin.site.register(FileUpload, FileUploadAdmin)
|
admin.site.register(FileUpload, FileUploadAdmin)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from django.forms.widgets import HiddenInput
|
|||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from tasks.models import Task, TaskList
|
from tasks.models import Task, TaskList
|
||||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
from .models import TopicGroup, Topic, Attachment, Etherpad, FileUpload
|
||||||
|
|
||||||
|
|
||||||
class DateInput(forms.DateInput):
|
class DateInput(forms.DateInput):
|
||||||
@@ -48,9 +48,9 @@ class TopicAdminForm(forms.ModelForm):
|
|||||||
widgets = {"description": CKEditorUploadingWidget(config_name="default")}
|
widgets = {"description": CKEditorUploadingWidget(config_name="default")}
|
||||||
|
|
||||||
|
|
||||||
class DocumentationAdminForm(forms.ModelForm):
|
class AttachmentAdminForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Documentation
|
model = Attachment
|
||||||
fields = "__all__"
|
fields = "__all__"
|
||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
@@ -73,7 +73,7 @@ class EtherpadAdminForm(forms.ModelForm):
|
|||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"date",
|
"date",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ class FileUploadAdminForm(forms.ModelForm):
|
|||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"file_field",
|
"file_field",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -103,9 +103,9 @@ class TopicInlineForm(forms.ModelForm):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DocumentationInlineForm(forms.ModelForm):
|
class AttachmentInlineForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Documentation
|
model = Attachment
|
||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"shortterm",
|
"shortterm",
|
||||||
@@ -125,7 +125,7 @@ class EtherpadInlineForm(forms.ModelForm):
|
|||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"date",
|
"date",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
@@ -189,9 +189,9 @@ class TopicUpdateForm(forms.ModelForm):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DocumentationCreateForm(forms.ModelForm):
|
class AttachmentCreateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Documentation
|
model = Attachment
|
||||||
|
|
||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
@@ -211,9 +211,9 @@ class DocumentationCreateForm(forms.ModelForm):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class DocumentationUpdateForm(forms.ModelForm):
|
class AttachmentUpdateForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Documentation
|
model = Attachment
|
||||||
|
|
||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
@@ -240,7 +240,7 @@ class EtherpadForm(forms.ModelForm):
|
|||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"date",
|
"date",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
labels = {
|
labels = {
|
||||||
@@ -250,7 +250,7 @@ class EtherpadForm(forms.ModelForm):
|
|||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"date": DateInput(format=("%Y-%m-%d")),
|
"date": DateInput(format=("%Y-%m-%d")),
|
||||||
"documentation": HiddenInput,
|
"attachment": HiddenInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ class FileUploadForm(forms.ModelForm):
|
|||||||
fields = [
|
fields = [
|
||||||
"title",
|
"title",
|
||||||
"file_field",
|
"file_field",
|
||||||
"documentation",
|
"attachment",
|
||||||
]
|
]
|
||||||
|
|
||||||
widgets = {
|
widgets = {
|
||||||
"documentation": HiddenInput,
|
"attachment": HiddenInput,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ class Topic(models.Model):
|
|||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class Documentation(models.Model):
|
class Attachment(models.Model):
|
||||||
title = models.CharField(verbose_name="Titel", max_length=128)
|
title = models.CharField(verbose_name="Titel", max_length=128)
|
||||||
|
|
||||||
shortterm = models.CharField(max_length=10, unique=True)
|
shortterm = models.CharField(max_length=10, unique=True)
|
||||||
@@ -96,8 +96,8 @@ class Documentation(models.Model):
|
|||||||
objects = models.Manager()
|
objects = models.Manager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = "Dokumentation"
|
verbose_name = "Anhang Ordner"
|
||||||
verbose_name_plural = "3. Dokumentationen"
|
verbose_name_plural = "3. Anhang Ordner"
|
||||||
|
|
||||||
constraints = [
|
constraints = [
|
||||||
UniqueConstraint(fields=["slug", "topic"], name="unique_intern_slug_topic"),
|
UniqueConstraint(fields=["slug", "topic"], name="unique_intern_slug_topic"),
|
||||||
@@ -115,7 +115,7 @@ class Documentation(models.Model):
|
|||||||
"slug": self.slug,
|
"slug": self.slug,
|
||||||
}
|
}
|
||||||
|
|
||||||
return reverse("intern:docu", kwargs=kwargs)
|
return reverse("intern:attachment", kwargs=kwargs)
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
if not self.slug:
|
if not self.slug:
|
||||||
@@ -131,7 +131,7 @@ class Etherpad(models.Model):
|
|||||||
etherpad_key = models.CharField(max_length=50, blank=True)
|
etherpad_key = models.CharField(max_length=50, blank=True)
|
||||||
date = models.DateField(verbose_name="Datum", default=date.today)
|
date = models.DateField(verbose_name="Datum", default=date.today)
|
||||||
|
|
||||||
documentation = models.ForeignKey(Documentation, on_delete=models.CASCADE)
|
attachment = models.ForeignKey(Attachment, on_delete=models.CASCADE)
|
||||||
|
|
||||||
objects = models.Manager()
|
objects = models.Manager()
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ class Etherpad(models.Model):
|
|||||||
|
|
||||||
constraints = [
|
constraints = [
|
||||||
UniqueConstraint(
|
UniqueConstraint(
|
||||||
fields=["title", "date", "documentation"], name="unique_intern_etherpad"
|
fields=["title", "date", "attachment"], name="unique_intern_etherpad"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -149,9 +149,9 @@ class Etherpad(models.Model):
|
|||||||
return (
|
return (
|
||||||
slugify(self.date)
|
slugify(self.date)
|
||||||
+ "-"
|
+ "-"
|
||||||
+ self.documentation.topic.slug
|
+ self.attachment.topic.slug
|
||||||
+ "-"
|
+ "-"
|
||||||
+ self.documentation.slug
|
+ self.attachment.slug
|
||||||
+ "-"
|
+ "-"
|
||||||
+ self.slug
|
+ self.slug
|
||||||
)
|
)
|
||||||
@@ -187,7 +187,7 @@ class FileUpload(models.Model):
|
|||||||
)
|
)
|
||||||
date = models.DateField(verbose_name="Datum", default=date.today)
|
date = models.DateField(verbose_name="Datum", default=date.today)
|
||||||
|
|
||||||
documentation = models.ForeignKey(Documentation, on_delete=models.CASCADE)
|
attachment = models.ForeignKey(Attachment, on_delete=models.CASCADE)
|
||||||
|
|
||||||
objects = models.Manager()
|
objects = models.Manager()
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ from django.urls import path
|
|||||||
from . import apps
|
from . import apps
|
||||||
from . import views
|
from . import views
|
||||||
from .views import (
|
from .views import (
|
||||||
DocumentationCreateView,
|
AttachmentCreateView,
|
||||||
DocumentationUpdateView,
|
AttachmentUpdateView,
|
||||||
EtherpadCreateView,
|
EtherpadCreateView,
|
||||||
FileUploadCreateView,
|
FileUploadCreateView,
|
||||||
TaskCreateView,
|
TaskCreateView,
|
||||||
@@ -29,16 +29,16 @@ urlpatterns = [
|
|||||||
name="topic-update",
|
name="topic-update",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"<slug:slug>/docu-create/",
|
"<slug:slug>/attachment-create/",
|
||||||
DocumentationCreateView.as_view(),
|
AttachmentCreateView.as_view(),
|
||||||
name="docu-create",
|
name="attachment-create",
|
||||||
),
|
),
|
||||||
path("<slug:slug>/create/", TaskCreateView.as_view(), name="task-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>/", views.show_attachment, name="attachment"),
|
||||||
path(
|
path(
|
||||||
"<slug:topic_slug>/<slug:slug>/update/",
|
"<slug:topic_slug>/<slug:slug>/update/",
|
||||||
DocumentationUpdateView.as_view(),
|
AttachmentUpdateView.as_view(),
|
||||||
name="docu-update",
|
name="attachment-update",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"<slug:topic_slug>/<slug:slug>/etherpad-create/",
|
"<slug:topic_slug>/<slug:slug>/etherpad-create/",
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ from documents.etherpadlib import add_ep_cookie
|
|||||||
from tasks.forms import InternTaskCreateForm
|
from tasks.forms import InternTaskCreateForm
|
||||||
from tasks.models import Task
|
from tasks.models import Task
|
||||||
from .forms import (
|
from .forms import (
|
||||||
DocumentationCreateForm,
|
AttachmentCreateForm,
|
||||||
DocumentationUpdateForm,
|
AttachmentUpdateForm,
|
||||||
EtherpadForm,
|
EtherpadForm,
|
||||||
FileUploadForm,
|
FileUploadForm,
|
||||||
TopicCreateForm,
|
TopicCreateForm,
|
||||||
TopicUpdateForm,
|
TopicUpdateForm,
|
||||||
)
|
)
|
||||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
from .models import TopicGroup, Topic, Attachment, Etherpad, FileUpload
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ def show_topic(request, slug=None):
|
|||||||
if not active_topic:
|
if not active_topic:
|
||||||
raise Http404("wrong topic")
|
raise Http404("wrong topic")
|
||||||
|
|
||||||
docu = Documentation.objects.filter(topic__slug=slug).order_by("title")
|
attachments = Attachment.objects.filter(topic__slug=slug).order_by("title")
|
||||||
|
|
||||||
tasks = None
|
tasks = None
|
||||||
if active_topic.task_list:
|
if active_topic.task_list:
|
||||||
@@ -65,7 +65,7 @@ def show_topic(request, slug=None):
|
|||||||
|
|
||||||
context = {
|
context = {
|
||||||
"active_topic": active_topic,
|
"active_topic": active_topic,
|
||||||
"docus": docu,
|
"attachments": attachments,
|
||||||
"tasks": tasks,
|
"tasks": tasks,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,12 +73,12 @@ def show_topic(request, slug=None):
|
|||||||
|
|
||||||
|
|
||||||
@authenticated_user
|
@authenticated_user
|
||||||
def show_docu(request, topic_slug=None, slug=None):
|
def show_attachment(request, topic_slug=None, slug=None):
|
||||||
active_docu = Documentation.objects.filter(
|
attachment = Attachment.objects.filter(
|
||||||
Q(topic__slug=topic_slug) & Q(slug=slug)
|
Q(topic__slug=topic_slug) & Q(slug=slug)
|
||||||
).first()
|
).first()
|
||||||
if not active_docu:
|
if not attachment:
|
||||||
raise Http404("wrong docu")
|
raise Http404("wrong attachment")
|
||||||
|
|
||||||
active_topic = Topic.objects.filter(slug=topic_slug).first()
|
active_topic = Topic.objects.filter(slug=topic_slug).first()
|
||||||
|
|
||||||
@@ -106,20 +106,20 @@ def show_docu(request, topic_slug=None, slug=None):
|
|||||||
messages.info(request, "; ".join(elem))
|
messages.info(request, "; ".join(elem))
|
||||||
|
|
||||||
initial = {
|
initial = {
|
||||||
"documentation": active_docu,
|
"attachment": attachment,
|
||||||
}
|
}
|
||||||
|
|
||||||
form_add_etherpad = EtherpadForm(initial=initial)
|
form_add_etherpad = EtherpadForm(initial=initial)
|
||||||
form_add_file = FileUploadForm(initial=initial)
|
form_add_file = FileUploadForm(initial=initial)
|
||||||
|
|
||||||
files = FileUpload.objects.filter(documentation=active_docu)
|
files = FileUpload.objects.filter(attachment=attachment)
|
||||||
|
|
||||||
docus = Etherpad.objects.filter(documentation=active_docu).order_by("-date")
|
etherpads = Etherpad.objects.filter(attachment=attachment).order_by("-date")
|
||||||
etherpads = deque([])
|
etherpad_list = deque([])
|
||||||
|
|
||||||
# list of etherpad url-link of any etherpads
|
# list of etherpad url-link of any etherpads
|
||||||
for elem in docus:
|
for elem in etherpads:
|
||||||
etherpads.append(
|
etherpad_list.append(
|
||||||
{
|
{
|
||||||
"title": elem.title,
|
"title": elem.title,
|
||||||
"date": elem.date,
|
"date": elem.date,
|
||||||
@@ -131,12 +131,12 @@ def show_docu(request, topic_slug=None, slug=None):
|
|||||||
"form_add_etherpad": form_add_etherpad,
|
"form_add_etherpad": form_add_etherpad,
|
||||||
"form_add_file": form_add_file,
|
"form_add_file": form_add_file,
|
||||||
"active_topic": active_topic,
|
"active_topic": active_topic,
|
||||||
"active_docu": active_docu,
|
"attachment": attachment,
|
||||||
"documents": etherpads,
|
"etherpads": etherpad_list,
|
||||||
"files": files,
|
"files": files,
|
||||||
}
|
}
|
||||||
|
|
||||||
response = render(request, "intern/docu.html", context)
|
response = render(request, "intern/attachment.html", context)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = add_ep_cookie(request, response)
|
response = add_ep_cookie(request, response)
|
||||||
@@ -200,10 +200,10 @@ class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
|||||||
return reverse("intern:topic", kwargs=context)
|
return reverse("intern:topic", kwargs=context)
|
||||||
|
|
||||||
|
|
||||||
class DocumentationCreateView(LoginRequiredMixin, CreateView):
|
class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
||||||
model = Documentation
|
model = Attachment
|
||||||
template_name = "intern/docu/docu_create.html"
|
template_name = "intern/attachment/attachment_create.html"
|
||||||
form_class = DocumentationCreateForm
|
form_class = AttachmentCreateForm
|
||||||
|
|
||||||
slug = None
|
slug = None
|
||||||
|
|
||||||
@@ -230,10 +230,10 @@ class DocumentationCreateView(LoginRequiredMixin, CreateView):
|
|||||||
return reverse("intern:topic", kwargs=context)
|
return reverse("intern:topic", kwargs=context)
|
||||||
|
|
||||||
|
|
||||||
class DocumentationUpdateView(LoginRequiredMixin, UpdateView):
|
class AttachmentUpdateView(LoginRequiredMixin, UpdateView):
|
||||||
model = Documentation
|
model = Attachment
|
||||||
template_name = "intern/docu/docu_update.html"
|
template_name = "intern/attachment/attachment_update.html"
|
||||||
form_class = DocumentationUpdateForm
|
form_class = AttachmentUpdateForm
|
||||||
|
|
||||||
topic_slug = None
|
topic_slug = None
|
||||||
slug = None
|
slug = None
|
||||||
@@ -248,9 +248,9 @@ class DocumentationUpdateView(LoginRequiredMixin, UpdateView):
|
|||||||
self.topic_slug = self.kwargs.get("topic_slug")
|
self.topic_slug = self.kwargs.get("topic_slug")
|
||||||
self.slug = self.kwargs.get("slug")
|
self.slug = self.kwargs.get("slug")
|
||||||
|
|
||||||
active_docu = Documentation.objects.filter(slug=self.slug).first()
|
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||||
context = {
|
context = {
|
||||||
"documentation": active_docu,
|
"attachment": attachment,
|
||||||
}
|
}
|
||||||
|
|
||||||
return context
|
return context
|
||||||
@@ -261,7 +261,7 @@ class DocumentationUpdateView(LoginRequiredMixin, UpdateView):
|
|||||||
"slug": self.slug,
|
"slug": self.slug,
|
||||||
}
|
}
|
||||||
|
|
||||||
return reverse("intern:docu", kwargs=context)
|
return reverse("intern:attachment", kwargs=context)
|
||||||
|
|
||||||
|
|
||||||
class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||||
@@ -282,9 +282,9 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
|||||||
self.topic_slug = self.kwargs.get("topic_slug")
|
self.topic_slug = self.kwargs.get("topic_slug")
|
||||||
self.slug = self.kwargs.get("slug")
|
self.slug = self.kwargs.get("slug")
|
||||||
|
|
||||||
active_docu = Documentation.objects.filter(slug=self.slug).first()
|
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||||
context = {
|
context = {
|
||||||
"documentation": active_docu,
|
"attachment": attachment,
|
||||||
}
|
}
|
||||||
|
|
||||||
return context
|
return context
|
||||||
@@ -295,7 +295,7 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
|||||||
"slug": self.slug,
|
"slug": self.slug,
|
||||||
}
|
}
|
||||||
|
|
||||||
return reverse("intern:docu", kwargs=context)
|
return reverse("intern:attachment", kwargs=context)
|
||||||
|
|
||||||
|
|
||||||
class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
||||||
@@ -317,9 +317,9 @@ class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
|||||||
self.topic_slug = self.kwargs.get("topic_slug")
|
self.topic_slug = self.kwargs.get("topic_slug")
|
||||||
self.slug = self.kwargs.get("slug")
|
self.slug = self.kwargs.get("slug")
|
||||||
|
|
||||||
active_docu = Documentation.objects.filter(slug=self.kwargs.get("slug")).first()
|
attachment = Attachment.objects.filter(slug=self.kwargs.get("slug")).first()
|
||||||
context = {
|
context = {
|
||||||
"documentation": active_docu,
|
"attachment": attachment,
|
||||||
}
|
}
|
||||||
|
|
||||||
return context
|
return context
|
||||||
@@ -330,7 +330,7 @@ class FileUploadCreateView(LoginRequiredMixin, CreateView):
|
|||||||
"slug": self.slug,
|
"slug": self.slug,
|
||||||
}
|
}
|
||||||
|
|
||||||
return reverse("intern:docu", kwargs=context)
|
return reverse("intern:attachment", kwargs=context)
|
||||||
|
|
||||||
|
|
||||||
class TaskCreateView(LoginRequiredMixin, CreateView):
|
class TaskCreateView(LoginRequiredMixin, CreateView):
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<h3>
|
<h3>
|
||||||
<a href="{% url 'intern:index' %}#{{ 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>
|
||||||
/ <a href="{% url 'intern:topic' active_topic.slug %}">{{ active_topic.title }}</a>
|
/ <a href="{% url 'intern:topic' active_topic.slug %}">{{ active_topic.title }}</a>
|
||||||
/ {{ active_docu.title }}
|
/ {{ attachment.title }}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -17,14 +17,14 @@
|
|||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<div class="grid-x grid-padding-x padding-top-1">
|
<div class="grid-x grid-padding-x padding-top-1">
|
||||||
<div class="cell large-3 medium-4 small-12">
|
<div class="cell large-3 medium-4 small-12">
|
||||||
<a class="button" href="{% url 'intern:docu-update' active_topic.slug active_docu.slug %}">Beschreibung bearbeiten</a>
|
<a class="button" href="{% url 'intern:attachment-update' active_topic.slug attachment.slug %}">Beschreibung bearbeiten</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if active_docu.description %}
|
{% if attachment.description %}
|
||||||
<div class="padding-top-1 padding-left-1 padding-right-1">
|
<div class="padding-top-1 padding-left-1 padding-right-1">
|
||||||
{{ active_docu.description|safe }}
|
{{ attachment.description|safe }}
|
||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<div class="grid-x grid-padding-x">
|
<div class="grid-x grid-padding-x">
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
Etherpad Dokumente:
|
Etherpad Dokumente:
|
||||||
<a href="{% url 'intern:etherpad-create' active_topic.slug active_docu.slug %}">
|
<a href="{% url 'intern:etherpad-create' active_topic.slug attachment.slug %}">
|
||||||
<div class="news-hero-compact">
|
<div class="news-hero-compact">
|
||||||
<div class="news-hero-compact-text">
|
<div class="news-hero-compact-text">
|
||||||
<p style="margin-bottom: 0rem;">+ neues Etherpad erstellen</p>
|
<p style="margin-bottom: 0rem;">+ neues Etherpad erstellen</p>
|
||||||
@@ -40,21 +40,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% for document in documents %}
|
{% for etherpad in etherpads %}
|
||||||
<a href="{{ document.etherpad_key }}">
|
<a href="{{ etherpad.etherpad_key }}">
|
||||||
<div class="news-hero-compact">
|
<div class="news-hero-compact">
|
||||||
<div class="news-hero-compact-text">
|
<div class="news-hero-compact-text">
|
||||||
<p style="margin-bottom: 0rem;">{{ document.title }}</p>
|
<p style="margin-bottom: 0rem;">{{ etherpad.title }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="news-hero-compact-right">
|
<div class="news-hero-compact-right">
|
||||||
<p style="margin-bottom: 0rem;">{{ document.date }}</p>
|
<p style="margin-bottom: 0rem;">{{ etherpad.date }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
Dokumente:
|
Dokumente:
|
||||||
<a href="{% url 'intern:file-create' active_topic.slug active_docu.slug %}">
|
<a href="{% url 'intern:file-create' active_topic.slug attachment.slug %}">
|
||||||
<div class="news-hero-compact">
|
<div class="news-hero-compact">
|
||||||
<div class="news-hero-compact-text">
|
<div class="news-hero-compact-text">
|
||||||
<p style="margin-bottom: 0rem;">+ neue Datei hochladen</p>
|
<p style="margin-bottom: 0rem;">+ neue Datei hochladen</p>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h2>Neue Dokumentation erstellen</h2>
|
<h2>Neuen Anhang Ordner erstellen</h2>
|
||||||
<div class="grid-x">
|
<div class="grid-x">
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
<form action="" method="post" enctype="multipart/form-data">
|
||||||
@@ -4,15 +4,15 @@
|
|||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
<div class="grid-x padding-top-1">
|
<div class="grid-x padding-top-1">
|
||||||
<div class="cell large-3 medium-4 small-12">
|
<div class="cell large-3 medium-4 small-12">
|
||||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
<a class="button" href="{% url 'intern:attachment' topic_slug slug %}">Zurück</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="cell large-3 medium-4 small-12">
|
<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>
|
<a class="button" href="{% url 'admin:intern_attachment_change' attachment.id %}">Anhang Ordner im Admin bearbeiten</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<h2>Dokumentation '{{ documentation.title }}' bearbeiten</h2>
|
<h2>Anhang Ordner '{{ attachment.title }}' bearbeiten</h2>
|
||||||
<div class="grid-x">
|
<div class="grid-x">
|
||||||
<div class="cell">
|
<div class="cell">
|
||||||
<form action="" method="post" enctype="multipart/form-data">
|
<form action="" method="post" enctype="multipart/form-data">
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
<div class="grid-x padding-top-1">
|
<div class="grid-x padding-top-1">
|
||||||
<div class="cell large-3 medium-4 small-12">
|
<div class="cell large-3 medium-4 small-12">
|
||||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
<a class="button" href="{% url 'intern:attachment' topic_slug slug %}">Zurück</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
<div class="grid-x padding-top-1">
|
<div class="grid-x padding-top-1">
|
||||||
<div class="cell large-3 medium-4 small-12">
|
<div class="cell large-3 medium-4 small-12">
|
||||||
<a class="button" href="{% url 'intern:docu' topic_slug slug %}">Zurück</a>
|
<a class="button" href="{% url 'intern:attachment' topic_slug slug %}">Zurück</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -44,12 +44,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="grid-x grid-padding-x">
|
<div class="grid-x grid-padding-x">
|
||||||
{% for docu in docus %}
|
{% for attachment in attachments %}
|
||||||
<div class="cell large-2 medium-4 small-6">
|
<div class="cell large-2 medium-4 small-6">
|
||||||
<a href="{% url 'intern:docu' active_topic.slug docu.slug %}">
|
<a href="{% url 'intern:attachment' active_topic.slug attachment.slug %}">
|
||||||
<div class="intern-topic">
|
<div class="intern-topic">
|
||||||
<div class="intern-topic-text">
|
<div class="intern-topic-text">
|
||||||
{{ docu.title }}
|
{{ attachment.title }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<div class="cell large-2 medium-4 small-6">
|
<div class="cell large-2 medium-4 small-6">
|
||||||
<a href="{% url 'intern:docu-create' active_topic.slug %}">
|
<a href="{% url 'intern:attachment-create' active_topic.slug %}">
|
||||||
<div class="intern-topic">
|
<div class="intern-topic">
|
||||||
<div class="intern-topic-text">
|
<div class="intern-topic-text">
|
||||||
+
|
+
|
||||||
|
|||||||
Reference in New Issue
Block a user