rename document -> etherpad
This commit is contained in:
@@ -13,8 +13,8 @@ from authentications.decorators import authenticated_user
|
||||
from documents.api import get_pad_link
|
||||
from documents.etherpadlib import add_ep_cookie
|
||||
from tasks.models import Task
|
||||
from .forms import DocumentForm, FileUploadForm
|
||||
from .models import TopicGroup, Topic, Documentation, Document, FileUpload
|
||||
from .forms import EtherpadForm, FileUploadForm
|
||||
from .models import TopicGroup, Topic, Documentation, Etherpad, FileUpload
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -76,7 +76,7 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
|
||||
if request.method == "POST":
|
||||
if "btn_etherpad" in request.POST:
|
||||
form = DocumentForm(request.POST)
|
||||
form = EtherpadForm(request.POST)
|
||||
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
@@ -101,17 +101,17 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
"documentation": active_docu,
|
||||
}
|
||||
|
||||
form_add_etherpad = DocumentForm(initial=initial)
|
||||
form_add_etherpad = EtherpadForm(initial=initial)
|
||||
form_add_file = FileUploadForm(initial=initial)
|
||||
|
||||
files = deque(FileUpload.objects.filter(documentation=active_docu))
|
||||
|
||||
docus = deque(Document.objects.filter(documentation=active_docu).order_by("-date"))
|
||||
documents = deque([])
|
||||
docus = deque(Etherpad.objects.filter(documentation=active_docu).order_by("-date"))
|
||||
etherpads = deque([])
|
||||
|
||||
# list of etherpad url-link of any documents
|
||||
# list of etherpad url-link of any etherpads
|
||||
for elem in docus:
|
||||
documents.append(
|
||||
etherpads.append(
|
||||
{
|
||||
"title": elem.title,
|
||||
"date": elem.date,
|
||||
@@ -124,7 +124,7 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
"form_add_file": form_add_file,
|
||||
"active_topic": active_topic,
|
||||
"active_docu": active_docu,
|
||||
"documents": documents,
|
||||
"documents": etherpads,
|
||||
"files": files,
|
||||
}
|
||||
|
||||
@@ -139,9 +139,9 @@ def show_docu(request, topic_slug=None, slug=None):
|
||||
|
||||
|
||||
class EtherpadCreateView(LoginRequiredMixin, CreateView):
|
||||
model = Document
|
||||
model = Etherpad
|
||||
template_name = "intern/etherpad_create.html"
|
||||
form_class = DocumentForm
|
||||
form_class = EtherpadForm
|
||||
|
||||
topic_slug = None
|
||||
slug = None
|
||||
|
||||
Reference in New Issue
Block a user