class ThesisForm(Form): title = fields.TitleField(label=_('Original Thesis Title'), validators=[Required()]) subtitle = fields.TitleField(label=_('Original Thesis Subtitle'), recjson_key='title.subtitle') author = fields.AuthorField(label=_('Author'), cook_function=add_author) supervisor = fields.AuthorField(label=_('Thesis Supervisor')) abstract = fields.AbstractField(label=_('Abstract')) languages = [("en", _("English")), ("fre", _("French")), ("ger", _("German")), ("dut", _("Dutch")), ("ita", _("Italian")), ("spa", _("Spanish")), ("por", _("Portuguese")), ("gre", _("Greek")), ("slo", _("Slovak")), ("cze", _("Czech")), ("hun", _("Hungarian")), ("pol", _("Polish")), ("nor", _("Norwegian")), ("swe", _("Swedish")), ("fin", _("Finnish")), ("rus", _("Russian"))] language = fields.LanguageField(label=_("Language"), choices=languages) publisher = fields.PublisherField(label=_('Thesis Publisher')) defence_date = fields.Date(label=_('Date of Defence'), widget=date_widget) funded_choices = [("yes", _("Yes")), ("no", _("No"))] funded = fields.SelectField(label=_( "Has your thesis been funded by the CERN Doctoral Student Program?"), choices=funded_choices) file_field = fields.FileUploadField(widget=plupload_widget) submit = fields.SubmitField(label=_('Submit Thesis'), widget=bootstrap_submit) """ Form Configuration variables """ _title = _("Submit a Thesis") _drafting = True # enable and disable drafting
class PreprintForm(Form): author = fields.AuthorField(label=_('Author'), validators=[Required()]) subject_category = fields.TitleField(label=_('Subject category'), validators=[Required()]) note = fields.NotesField(label=_('Note')) institution = TextField(label=_('Institution')) languages = [("en", _("English")), \ ("fre", _("French")), \ ("ger", _("German")), \ ("dut", _("Dutch")), \ ("ita", _("Italian")), \ ("spa", _("Spanish")), \ ("por", _("Portuguese")), \ ("gre", _("Greek")), \ ("slo", _("Slovak")), \ ("cze", _("Czech")), \ ("hun", _("Hungarian")), \ ("pol", _("Polish")), \ ("nor", _("Norwegian")), \ ("swe", _("Swedish")), \ ("fin", _("Finnish")), \ ("rus", _("Russian"))] language = fields.LanguageField(label=_("Language"), choices=languages) date = fields.Date(label=_('Date'), widget=date_widget) file_field = fields.FileUploadField(label=_('File')) submit = SubmitField(label=_('Submit Preprint'), widget=bootstrap_submit) """ Form Configuration variables """ _title = _("Submit a Preprint") _drafting = True #enable and disable drafting
class PoemForm(Form): title = fields.TitleField(label=_('Poem Title'), validators=[Required()]) author = fields.AuthorField(label=_('Author'), validators=[Required()]) languages = [("en", _("English")), ("fre", _("French")), ("ger", _("German")), ("dut", _("Dutch")), ("ita", _("Italian")), ("spa", _("Spanish")), ("por", _("Portuguese")), ("gre", _("Greek")), ("slo", _("Slovak")), ("cze", _("Czech")), ("hun", _("Hungarian")), ("pol", _("Polish")), ("nor", _("Norwegian")), ("swe", _("Swedish")), ("fin", _("Finnish")), ("rus", _("Russian"))] language = fields.LanguageField(label=_('Language'), choices=languages, validators=[Required()]) year = fields.Date(label=_('Year'), validators=[Required()]) poem_text = fields.AbstractField(label='Poem Text', validators=[Required()]) submit = SubmitField(label=_('Submit Poem'), widget=bootstrap_submit) """ Form Configuration variables """ _title = _('Submit a Poem') _drafting = True # enable and disable drafting
class ArticleForm(Form): doi = fields.DOIField(label=_('DOI')) publisher = fields.PublisherField(label=_('Publisher'), validators=[Required()]) journal = fields.JournalField(label=_('Journal Title'), validators=[Required()]) issn = fields.ISSNField(label=_('ISSN')) title = fields.TitleField(label=_('Document Title')) author = fields.AuthorField(label=_('Author')) abstract = fields.AbstractField(label=_('Abstract')) pagesnum = fields.PagesNumberField(label=_('Number of Pages')) languages = [("en", _("English")), ("fre", _("French")), ("ger", _("German")), ("dut", _("Dutch")), ("ita", _("Italian")), ("spa", _("Spanish")), ("por", _("Portuguese")), ("gre", _("Greek")), ("slo", _("Slovak")), ("cze", _("Czech")), ("hun", _("Hungarian")), ("pol", _("Polish")), ("nor", _("Norwegian")), ("swe", _("Swedish")), ("fin", _("Finnish")), ("rus", _("Russian"))] language = fields.LanguageField(label=_('Language'), choices=languages) date = fields.Date(label=_('Date of Document'), widget=date_widget) keywords = fields.KeywordsField(label=_('Keywords')) notes = fields.NotesField(label=_('Notes')) plupload_file = fields.FileUploadField(widget=plupload_widget) submit = SubmitField(label=_('Submit Article'), widget=bootstrap_submit) """ Form Configuration variables """ _title = _('Submit an Article') _drafting = True # enable and disable drafting # Group fields in categories groups = [('Publisher/Journal', ['doi', 'publisher', 'journal', 'issn'], { 'description': "Publisher and Journal fields are required.", 'indication': 'required' }), ('Basic Information', ['title', 'author', 'abstract', 'pagesnum']), ('Other', ['language', 'date', 'keywords', 'notes'])]
class ArticleForm(WebDepositForm): doi = fields.DOIField(label=_('DOI'), recjson_key='publication_info.DOI') publisher = fields.PublisherField(label=_('Publisher'), validators=[Required()], recjson_key='imprint.publisher_name') journal = fields.JournalField(label=_('Journal Title'), validators=[Required()]) issn = fields.ISSNField(label=_('ISSN'), recjson_key='issn') title = fields.TitleField(label=_('Document Title'), recjson_key='title.title') authors = fields.DynamicFieldList(fields.FormField( AuthorForm, widget=ExtendedListWidget( item_widget=ListItemWidget(with_label=False), class_='inline', ), ), label='Authors', add_label='Add another author', icon='icon-user', widget_classes='', min_entries=1, recjson_key='authors') abstract = fields.AbstractField(label=_('Abstract'), recjson_key='abstract.summary', widget=ckeditor_widget) pagesnum = fields.PagesNumberField(label=_('Number of Pages')) languages = [("en", _("English")), ("fre", _("French")), ("ger", _("German")), ("dut", _("Dutch")), ("ita", _("Italian")), ("spa", _("Spanish")), ("por", _("Portuguese")), ("gre", _("Greek")), ("slo", _("Slovak")), ("cze", _("Czech")), ("hun", _("Hungarian")), ("pol", _("Polish")), ("nor", _("Norwegian")), ("swe", _("Swedish")), ("fin", _("Finnish")), ("rus", _("Russian"))] language = fields.LanguageField(label=_('Language'), choices=languages) date = fields.Date(label=_('Date of Document'), widget=date_widget, recjson_key='imprint.date') authors = fields.DynamicFieldList(fields.FormField( AuthorForm, widget=ExtendedListWidget( item_widget=ListItemWidget(with_label=False), class_='inline', ), ), label='Authors', add_label='Add another author', icon='icon-user', widget_classes='', min_entries=1, recjson_key='authors') keywords = fields.DynamicFieldList( fields.TextField(placeholder="Start typing a keyword...", autocomplete=keywords_autocomplete, widget=TagInput()), widget=TagListWidget(template="{{value}}"), icon='icon-tags', ) notes = fields.NotesField(label=_('Notes'), recjson_key='comment') plupload_file = fields.FileUploadField(widget=plupload_widget, label="") """ Form Configuration variables """ _title = _('Submit an Article') _subtitle = 'Instructions: (i) Press "Save" to save your upload for '\ 'editing later, as many times you like. (ii) Upload or remove'\ ' extra files in the bottom of the form. (iii) When ready, '\ 'press "Submit" to finalize your upload.' _drafting = True # enable and disable drafting # Group fields in categories groups = [('Publisher/Journal', ['doi', 'publisher', 'journal', 'issn'], { 'description': "Publisher and Journal fields are required.", 'indication': 'required' }), ('Basic Information', ['title', 'authors', 'abstract', 'pagesnum']), ('Other', ['language', 'date', 'keywords', 'notes'])]