add intern design
This commit is contained in:
@@ -156,19 +156,14 @@ class TopicCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_group"] = self.slug
|
||||
|
||||
topic_group = TopicGroup.objects.filter(slug=self.slug).first()
|
||||
context["topic_group"] = topic_group
|
||||
|
||||
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
|
||||
@@ -180,17 +175,14 @@ class TopicUpdateView(LoginRequiredMixin, UpdateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
context["topic"] = topic
|
||||
|
||||
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 = {
|
||||
@@ -210,17 +202,14 @@ class AttachmentCreateView(LoginRequiredMixin, CreateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
context["topic"]= topic
|
||||
|
||||
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 = {
|
||||
@@ -242,19 +231,15 @@ class AttachmentUpdateView(LoginRequiredMixin, UpdateView):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["topic_slug"] = self.topic_slug
|
||||
context["slug"] = self.slug
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||
context["attachment"] = attachment
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||
context = {
|
||||
"attachment": attachment,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
@@ -274,21 +259,22 @@ class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
context["topic_slug"] = self.topic_slug
|
||||
context["slug"] = self.slug
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||
context["attachment"] = attachment
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.slug).first()
|
||||
context = {
|
||||
"attachment": attachment,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
@@ -308,22 +294,19 @@ 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
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.kwargs.get("slug")).first()
|
||||
context["attachment"] = attachment
|
||||
|
||||
return context
|
||||
|
||||
def get_initial(self):
|
||||
self.topic_slug = self.kwargs.get("topic_slug")
|
||||
self.slug = self.kwargs.get("slug")
|
||||
|
||||
attachment = Attachment.objects.filter(slug=self.kwargs.get("slug")).first()
|
||||
context = {
|
||||
"attachment": attachment,
|
||||
}
|
||||
|
||||
return context
|
||||
|
||||
def get_success_url(self):
|
||||
context = {
|
||||
"topic_slug": self.topic_slug,
|
||||
@@ -348,18 +331,15 @@ class TaskCreateView(LoginRequiredMixin, CreateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["slug"] = self.slug
|
||||
|
||||
topic = Topic.objects.filter(slug=self.slug).first()
|
||||
context["topic"] = topic
|
||||
context["task_list"] = topic.task_list
|
||||
|
||||
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 = {
|
||||
|
||||
Reference in New Issue
Block a user