summaryrefslogtreecommitdiff
path: root/ishtar_common/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-06-10 18:47:17 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:21 +0100
commit82fe118fde9524aa1cced20b5dc26a3abb3f040b (patch)
treec0a931af3e3be561d3779811e70eeaf2c995f332 /ishtar_common/views.py
parent649884364c945ac7fdde570d7f8291c3d37699a2 (diff)
downloadIshtar-82fe118fde9524aa1cced20b5dc26a3abb3f040b.tar.bz2
Ishtar-82fe118fde9524aa1cced20b5dc26a3abb3f040b.zip
Documents: better form - improve select2 widget to manage new
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r--ishtar_common/views.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 3e5ef48cf..64219ba66 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1928,6 +1928,9 @@ class OrganizationPersonEdit(LoginRequiredMixin, UpdateView):
# documents
+new_document_tag = new_qa_item(models.DocumentTag, forms.AddDocumentTagForm)
+autocomplete_documenttag = get_autocomplete_generic(models.DocumentTag)
+
show_document = show_item(models.Document, 'document')
get_document = get_item(models.Document, 'get_document', 'document',
search_form=forms.DocumentSelect)
@@ -1956,7 +1959,7 @@ class DocumentFormMixin(IshtarMixin, LoginRequiredMixin):
class DocumentCreateView(DocumentFormMixin, CreateView):
- page_name = _(u"Document creation")
+ page_name = _("Document creation")
def get_form_kwargs(self):
kwargs = super(DocumentCreateView, self).get_form_kwargs()
@@ -1998,12 +2001,7 @@ class DocumentSelectView(IshtarMixin, LoginRequiredMixin,
class DocumentEditView(DocumentFormMixin, UpdateView):
- page_name = _(u"Document modification")
-
- def get_context_data(self, **kwargs):
- data = super(DocumentEditView, self).get_context_data(**kwargs)
- data["extra_form_modals"] = ['author', 'person', 'organization']
- return data
+ page_name = _("Document modification")
def get_form_kwargs(self):
kwargs = super(DocumentEditView, self).get_form_kwargs()
@@ -2034,6 +2032,7 @@ class DocumentEditView(DocumentFormMixin, UpdateView):
if related_item.main_image == document:
initial[key] = True
kwargs['initial'] = initial
+ kwargs["user"] = self.request.user
return kwargs