mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-20 21:10:36 +00:00
Rework corpora package
This commit is contained in:
@ -9,21 +9,22 @@ class AddCorpusFileForm(FlaskForm):
|
||||
'''
|
||||
Form to add a .vrt corpus file to the current corpus.
|
||||
'''
|
||||
address = StringField('Adress', validators=[Length(0, 255)])
|
||||
# Required fields
|
||||
author = StringField('Author', validators=[DataRequired(), Length(1, 255)])
|
||||
file = FileField('File', validators=[DataRequired()])
|
||||
title = StringField('Title', validators=[DataRequired(), Length(1, 255)])
|
||||
# Optional fields
|
||||
address = StringField('Adress', validators=[Length(0, 255)])
|
||||
booktitle = StringField('Booktitle', validators=[Length(0, 255)])
|
||||
chapter = StringField('Chapter', validators=[Length(0, 255)])
|
||||
editor = StringField('Editor', validators=[Length(0, 255)])
|
||||
file = FileField('File', validators=[DataRequired()])
|
||||
institution = StringField('Institution', validators=[Length(0, 255)])
|
||||
journal = StringField('Journal', validators=[Length(0, 255)])
|
||||
pages = StringField('Pages', validators=[Length(0, 255)])
|
||||
publisher = StringField('Publisher', validators=[Length(0, 255)])
|
||||
publishing_year = IntegerField('Publishing year',
|
||||
validators=[DataRequired()])
|
||||
publishing_year = IntegerField('Publishing year')
|
||||
school = StringField('School', validators=[Length(0, 255)])
|
||||
submit = SubmitField()
|
||||
title = StringField('Title', validators=[DataRequired(), Length(1, 255)])
|
||||
|
||||
def __init__(self, corpus, *args, **kwargs):
|
||||
super(AddCorpusFileForm, self).__init__(*args, **kwargs)
|
||||
@ -43,8 +44,11 @@ class EditCorpusFileForm(FlaskForm):
|
||||
'''
|
||||
Form to edit meta data of one corpus file.
|
||||
'''
|
||||
address = StringField('Adress', validators=[Length(0, 255)])
|
||||
# Required fields
|
||||
author = StringField('Author', validators=[DataRequired(), Length(1, 255)])
|
||||
title = StringField('Title', validators=[DataRequired(), Length(1, 255)])
|
||||
# Optional fields
|
||||
address = StringField('Adress', validators=[Length(0, 255)])
|
||||
booktitle = StringField('Booktitle', validators=[Length(0, 255)])
|
||||
chapter = StringField('Chapter', validators=[Length(0, 255)])
|
||||
editor = StringField('Editor', validators=[Length(0, 255)])
|
||||
@ -52,11 +56,9 @@ class EditCorpusFileForm(FlaskForm):
|
||||
journal = StringField('Journal', validators=[Length(0, 255)])
|
||||
pages = StringField('Pages', validators=[Length(0, 255)])
|
||||
publisher = StringField('Publisher', validators=[Length(0, 255)])
|
||||
publishing_year = IntegerField('Publishing year',
|
||||
validators=[DataRequired()])
|
||||
publishing_year = IntegerField('Publishing year')
|
||||
school = StringField('School', validators=[Length(0, 255)])
|
||||
submit = SubmitField()
|
||||
title = StringField('Title', validators=[DataRequired(), Length(1, 255)])
|
||||
|
||||
|
||||
class AddCorpusForm(FlaskForm):
|
||||
|
@ -77,6 +77,7 @@ def analyse_corpus(corpus_id):
|
||||
prefix='inspect-display-options-form')
|
||||
return render_template(
|
||||
'corpora/analyse_corpus.html.j2',
|
||||
corpus=corpus,
|
||||
corpus_id=corpus_id,
|
||||
display_options_form=display_options_form,
|
||||
query_form=query_form,
|
||||
|
Reference in New Issue
Block a user