Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
class PhotoForm(Form):

    title = fields.TitleField(label=_('Photo Title'))
    author = fields.AuthorField(label=_('Photo Author'))
    date = fields.Date(label=_('Photo Date'), widget=date_widget)
    keywords = fields.KeywordsField(label=_('Keywords'))
    notes = fields.NotesField(label=_('Comments or Notes'))
    plupload_file = fields.FileUploadField(label=_('Files'),
                                           widget=plupload_widget)
    submit = SubmitField(label=_('Submit Photo'), widget=bootstrap_submit)

    #configuration variables
    _title = _("Submit a Photo")
    _drafting = True  # enable and disable drafting
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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'])]