added abstract to the upload form
- Legacy-Id: 8434
This commit is contained in:
parent
b86d5c1d09
commit
2f56de6223
|
@ -33,6 +33,7 @@ def choose_material_type(request, acronym):
|
|||
class UploadMaterialForm(forms.Form):
|
||||
title = forms.CharField(max_length=Document._meta.get_field("title").max_length)
|
||||
name = forms.CharField(max_length=Document._meta.get_field("name").max_length)
|
||||
abstract = forms.CharField(max_length=Document._meta.get_field("abstract").max_length,widget=forms.Textarea)
|
||||
state = forms.ModelChoiceField(State.objects.all(), empty_label=None)
|
||||
material = forms.FileField(label='File', help_text="PDF or text file (ASCII/UTF-8)")
|
||||
|
||||
|
@ -121,6 +122,9 @@ def edit_material(request, name=None, acronym=None, action=None, doc_type=None):
|
|||
if "title" in form.cleaned_data:
|
||||
doc.title = form.cleaned_data["title"]
|
||||
|
||||
if "abstract" in form.cleaned_data:
|
||||
doc.abstract = form.cleaned_data["abstract"]
|
||||
|
||||
doc.time = datetime.datetime.now()
|
||||
|
||||
if "material" in form.fields:
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{% block morecss %}
|
||||
{{ block.super }}
|
||||
form.upload-material td { padding-bottom: 0.6em; }
|
||||
form.upload-material #id_title, form.upload-material #id_name { width: 30em; }
|
||||
form.upload-material #id_title, form.upload-material #id_name, form.upload-material #id_abstract { width: 30em; }
|
||||
form.upload-material .submit-row td { padding-top: 1em; text-align: right; }
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in a new issue