diff options
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 |
commit | 8b7c617c7ac7f752646bd48f39da97dcfbaaaab2 (patch) | |
tree | c0a931af3e3be561d3779811e70eeaf2c995f332 /ishtar_common/views.py | |
parent | 6d030c2e804b5c8f73a6e6aa9510ea23afaeeaa3 (diff) | |
download | Ishtar-8b7c617c7ac7f752646bd48f39da97dcfbaaaab2.tar.bz2 Ishtar-8b7c617c7ac7f752646bd48f39da97dcfbaaaab2.zip |
Documents: better form - improve select2 widget to manage new
Diffstat (limited to 'ishtar_common/views.py')
-rw-r--r-- | ishtar_common/views.py | 13 |
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 |