class ManEdBulkEditJournalForm(Form): publisher = StringField('Publisher', [validators.Optional()]) doaj_seal = DOAJSelectField( 'Qualifies for Seal', [validators.Optional()], description='How should we change the DOAJ Seal on these journals?', choices=[("", "Leave unchanged"), ("True", "Yes"), ("False", "No")], ) country = DOAJSelectField( 'Country', [validators.Optional()], description= 'Select the country where the publisher carries out its business activities.', choices=Choices.country(), ) owner = StringField( 'Owner', [ReservedUsernames(), validators.Optional()], description='DOAJ account to which the application belongs.') platform = StringField( 'Platform, Host or Aggregator', [validators.Optional()], description= 'The name of the platform, host or aggregator of the journal content, e.g. OJS, HighWire Press, EBSCO etc.' ) contact_name = StringField('Contact Name', [validators.Optional()]) contact_email = StringField('Contact\'s email address', [ validators.Optional(), validators.Email(message='Invalid email address.') ])
class ArticleForm(Form): title = StringField("Article Title", [validators.DataRequired()]) doi = StringField("DOI", [OptionalIf("fulltext"), validators.Regexp(regex=DOI_REGEX, message=DOI_ERROR)], description="(You must provide a DOI and/or a Full-Text URL)") authors = FieldList(FormField(AuthorForm), min_entries=1) # We have to do the validation for this at a higher level abstract = TextAreaField("Abstract", [validators.Optional()]) keywords = StringField("Keywords", [validators.Optional()], description="Use a , to separate keywords") # enhanced with select2 fulltext = StringField("Full-Text URL", [OptionalIf("doi"), validators.URL()]) publication_year = DOAJSelectField("Year", [validators.Optional()], choices=YEAR_CHOICES, default=str(datetime.now().year)) publication_month = DOAJSelectField("Month", [validators.Optional()], choices=MONTH_CHOICES, default=str(datetime.now().month) ) pissn = DOAJSelectField("Journal ISSN (print version)", [ThisOrThat("eissn")], choices=[]) # choices set at construction eissn = DOAJSelectField("Journal ISSN (online version)", [ThisOrThat("pissn")], choices=[]) # choices set at construction volume = StringField("Volume Number", [validators.Optional()]) number = StringField("Issue Number", [validators.Optional()]) start = StringField("Start Page", [validators.Optional()]) end = StringField("End Page", [validators.Optional()]) def __init__(self, *args, **kwargs): super(ArticleForm, self).__init__(*args, **kwargs) try: self.pissn.choices = Choices.choices_for_article_issns(current_user) self.eissn.choices = Choices.choices_for_article_issns(current_user) except: # not logged in, and current_user is broken # probably you are loading the class from the command line pass
class ArticleForm(Form): title = StringField("Article Title", [validators.DataRequired()]) doi = StringField("DOI", [ validators.Optional(), validators.Regexp(regex=DOI_REGEX, message=DOI_ERROR) ]) authors = FieldList( FormField(AuthorForm), min_entries=3 ) # We have to do the validation for this at a higher level abstract = TextAreaField("Abstract", [validators.Optional()]) keywords = StringField( "Keywords", [validators.Optional()], description="Use a , to separate keywords") # enhanced with select2 fulltext = StringField( "Full-Text URL", [validators.Optional(), validators.URL()], description="(The URL for each article must be unique)") publication_year = DOAJSelectField("Year", [validators.Optional()], choices=YEAR_CHOICES, default=str(datetime.now().year)) publication_month = DOAJSelectField("Month", [validators.Optional()], choices=MONTH_CHOICES, default=str(datetime.now().month)) pissn = DOAJSelectField("Journal ISSN (print version)", [ThisOrThat("eissn")], choices=[]) # choices set at construction eissn = DOAJSelectField("Journal ISSN (online version)", [ThisOrThat("pissn")], choices=[]) # choices set at construction volume = StringField("Volume Number", [validators.Optional()]) number = StringField("Issue Number", [validators.Optional()]) start = StringField("Start Page", [validators.Optional()]) end = StringField("End Page", [validators.Optional()]) def __init__(self, *args, **kwargs): super(ArticleForm, self).__init__(*args, **kwargs) try: if not current_user.is_anonymous: issns = models.Journal.issns_by_owner(current_user.id) ic = [("", "Select an ISSN")] + [(i, i) for i in issns] self.pissn.choices = ic self.eissn.choices = ic except: # not logged in, and current_user is broken # probably you are loading the class from the command line pass
class Workflow(Form): """ Administrator workflow field """ application_status = DOAJSelectField( 'Application Status', # choices are late-binding as they depend on the user [validators.DataRequired()], description='Setting the status to In Progress will tell others' ' that you have started your review. Setting the status' ' to Ready will alert the Managing Editors that you have' ' completed your review.')
class JournalInformation(Form): """All the bibliographic metadata associated with a journal in the DOAJ""" title = StringField('Journal Title', [validators.DataRequired()]) url = URLField('URL', [validators.DataRequired(), URLOptionalScheme()]) alternative_title = StringField('Alternative Title', [validators.Optional()]) pissn = StringField( 'Journal ISSN (print version)', [ OptionalIf('eissn'), validators.Regexp(regex=ISSN_REGEX, message=ISSN_ERROR) ], description= 'Only provide the print ISSN if your journal has one, otherwise leave this field blank. Write the ISSN with the hyphen "-" e.g. 1234-4321.', ) eissn = StringField( 'Journal ISSN (online version)', [ OptionalIf('pissn'), validators.Regexp(regex=ISSN_REGEX, message=ISSN_ERROR) ], description= 'Cannot be the same as the P-ISSN. Write the EISSN with the hyphen "-" e.g. 1234-4321.', ) publisher = StringField('Publisher', [validators.DataRequired()]) society_institution = StringField( 'Society or Institution', [validators.Optional()], description= 'The name of the Society or Institution that the journal belongs to.', ) platform = StringField( 'Platform, Host or Aggregator', [validators.Optional()], description= 'The name of the platform, host or aggregator of the journal content, e.g. OJS, HighWire Press, EBSCO etc.' ) contact_name = StringField( 'Name of contact for this journal', [validators.DataRequired()], description='Somebody who DOAJ can contact about this journal.', ) contact_email = StringField('Contact\'s email address', [ validators.DataRequired(), validators.Email(message='Invalid email address.') ]) confirm_contact_email = StringField('Confirm contact\'s email address', [ validators.DataRequired(), validators.Email(message='Invalid email address.'), validators.EqualTo('contact_email', EMAIL_CONFIRM_ERROR) ]) country = DOAJSelectField( 'In which country is the publisher of the journal based?', [validators.DataRequired()], description= 'Select the country where the publishing company carries out its business activities. Addresses registered via a registered agent are not allowed.', choices=Choices.country(), ) processing_charges = RadioField( 'Does the journal have article processing charges (APCs)?', [validators.DataRequired()], # description = 'If "No" proceed to question below', choices=Choices.processing_charges()) processing_charges_url = URLField( 'Enter the URL where this information can be found', [validators.DataRequired(), URLOptionalScheme()], # description='This field is optional if you have selected "No" above' ) processing_charges_amount = IntegerField( 'Amount', [ OptionalIf('processing_charges', optvals=Choices.processing_charges_amount_optional()) ], ) processing_charges_currency = DOAJSelectField('Currency', [ OptionalIf('processing_charges', optvals=Choices.processing_charges_currency_optional()) ], choices=Choices.currency()) submission_charges = RadioField( 'Does the journal have article submission charges?', [validators.DataRequired()], # description = 'If "No" proceed to question below', choices=Choices.submission_charges()) submission_charges_url = URLField( 'Enter the URL where this information can be found', [validators.DataRequired(), URLOptionalScheme()], # description='This field is optional if you have selected "No" above' ) submission_charges_amount = IntegerField( 'Amount', [ OptionalIf('submission_charges', optvals=Choices.submission_charges_amount_optional()) ], ) submission_charges_currency = DOAJSelectField('Currency', [ OptionalIf('submission_charges', optvals=Choices.submission_charges_amount_optional()) ], choices=Choices.currency()) waiver_policy = RadioField( 'Does the journal have a waiver policy (for developing country authors etc)?', [validators.DataRequired()], choices=Choices.waiver_policy()) waiver_policy_url = URLField( 'Enter the URL where this information can be found', [ OptionalIf('waiver_policy', optvals=Choices.waiver_policy_url_optional()), URLOptionalScheme() ]) digital_archiving_policy = DOAJSelectMultipleField( 'What digital archiving policy does the journal use?', [ validators.DataRequired(), ExclusiveCheckbox(Choices.digital_archiving_policy_val("none")), ExtraFieldRequiredIf( 'digital_archiving_policy_library', reqval=Choices.digital_archiving_policy_val("library")), ExtraFieldRequiredIf( 'digital_archiving_policy_other', reqval=Choices.digital_archiving_policy_val("other")), ], description= "Select all that apply. Institutional archives and publishers' own online archives are not valid.", choices=Choices.digital_archiving_policy(), option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False)) digital_archiving_policy_other = StringField( 'Digital Archiving Policy (Other)', ) digital_archiving_policy_library = StringField( 'Digital Archiving Policy (Library)', ) digital_archiving_policy_url = URLField( 'Enter the URL where this information can be found', [ OptionalIf( 'digital_archiving_policy', optvals=Choices.digital_archiving_policy_url_optional()), URLOptionalScheme() ], description= 'This field is optional if you selected "No policy in place".', ) crawl_permission = RadioField( 'Does the journal allow software/spiders to automatically crawl the journal content (also known as text mining)?', [validators.DataRequired()], choices=Choices.crawl_permission()) article_identifiers = DOAJSelectMultipleField( 'Which article identifiers does the journal use?', [ validators.DataRequired(), ExtraFieldRequiredIf( 'article_identifiers_other', reqval=Choices.article_identifiers_val("other")), ExclusiveCheckbox() ], choices=Choices.article_identifiers(), option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False), ) article_identifiers_other = StringField('Article Identifiers (Other)', ) download_statistics = RadioField( 'Does the journal provide article download statistics?', [validators.DataRequired()], description='If "No" proceed to question 32.', choices=Choices.download_statistics()) download_statistics_url = StringField( 'Enter the URL where this information can be found', [validators.Optional(), URLOptionalScheme()], ) first_fulltext_oa_year = IntegerField( 'What was the first calendar year in which a complete volume of the journal provided online Open Access content to the Full Text of all articles? (Full Text may be provided as PDFs. Does not apply for new journals.)', [ validators.DataRequired(), validators.NumberRange(min=1600, max=(datetime.now().year)) ], description='Use 4 digits for the year, i.e. YYYY format.') fulltext_format = DOAJSelectMultipleField( 'Please indicate which formats of full text are available', [ validators.DataRequired(), ExtraFieldRequiredIf('fulltext_format_other', reqval=Choices.fulltext_format_val("other")) ], description='Tick all that apply.', choices=Choices.fulltext_format(), option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False)) fulltext_format_other = StringField('Fulltext Format (Other)', ) keywords = TagListField( 'Add keyword(s) that best describe the journal (comma delimited)', [ validators.DataRequired(), MaxLen(6, message='You can only enter up to {max_len} keywords.') ], description='Maximum 6. Keywords must be in English.') languages = DOAJSelectMultipleField( 'Select the language(s) that the Full Text of the articles is published in', [validators.DataRequired()], choices=Choices.language(), description="You can select multiple languages.") editorial_board_url = URLField( 'What is the URL for the Editorial Board page?', [validators.DataRequired(), URLOptionalScheme()], description= 'A journal must have an editor and an editorial board. Only in the case of Arts and Humanities journals we will accept a form of editorial review using only two editors and no editorial board. Where an editorial board is present, members must be clearly identifiable with their names and affiliation information.' ) review_process = DOAJSelectField( 'Please select the review process for papers', [validators.DataRequired()], choices=Choices.review_process(), default=Choices.review_process_default(), ) review_process_url = URLField( 'Enter the URL where this information can be found', [ OptionalIf('review_process', optvals=Choices.review_process_url_optional()), URLOptionalScheme() ], description='This field is optional if you have selected "None" above.' ) aims_scope_url = URLField("What is the URL for the journal's Aims & Scope", [validators.DataRequired(), URLOptionalScheme()]) instructions_authors_url = URLField( "What is the URL for the journal's instructions for authors?", [validators.DataRequired(), URLOptionalScheme()]) plagiarism_screening = RadioField( 'Does the journal have a policy of screening for plagiarism?', [validators.DataRequired()], description='If "No" proceed to question 43.', choices=Choices.plagiarism_screening()) plagiarism_screening_url = URLField( "Enter the URL where this information can be found", [ OptionalIf('plagiarism_screening', optvals=Choices.plagiarism_screening_url_optional()), URLOptionalScheme() ], description= "The URL should state that the journal actively checks for plagiarism and detail how this is done." ) publication_time = IntegerField( 'What is the average number of weeks between submission and publication?', [validators.DataRequired(), validators.NumberRange(min=0, max=53)]) oa_statement_url = URLField( "What is the URL for the journal's Open Access statement?", [validators.DataRequired(), URLOptionalScheme()]) license_embedded = RadioField( 'Does the journal embed or display licensing information in its articles?', [validators.DataRequired()], choices=Choices.licence_embedded(), description= 'For more information go to <a target="_blank" href="http://wiki.creativecommons.org/CC_REL">http://wiki.creativecommons.org/CC_REL</a><br><br>If "No" proceed to question 47.', ) license_embedded_url = URLField( "Please provide a URL to an example page with embedded licensing information", [ OptionalIf('license_embedded', optvals=Choices.licence_embedded_url_optional()), URLOptionalScheme() ]) license = RadioField( "Does the journal allow reuse and remixing of content in accordance with a Creative Commons license or <em>other</em> type of license with similar conditions (Select 'Other')?", [ validators.DataRequired(), ExtraFieldRequiredIf('license_other', reqval=Choices.licence_val("other")) ], choices=Choices._licence, description= 'For more information go to <a href="http://creativecommons.org/licenses/" target="_blank">http://creativecommons.org/licenses/</a>' ) license_other = StringField('License (Other)', ) license_checkbox = DOAJSelectMultipleField( 'Which of the following does the content require? (Tick all that apply.)', choices=Choices.licence_checkbox(), option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False), ) license_url = URLField( "Enter the URL on your site where your license terms are stated", [validators.Optional(), URLOptionalScheme()]) open_access = RadioField( "Does the journal allow readers to <em>read, download, copy, distribute, print, search, or link to the full texts of its articles</em> and allow readers to <em>use them for any other lawful purpose</em>?", [validators.DataRequired()], choices=Choices.open_access(), description= 'From the <a href="http://www.budapestopenaccessinitiative.org/read" target="_blank">Budapest Open Access Initiative\'s definition of Open Access</a>.', ) deposit_policy = DOAJSelectMultipleField( 'With which deposit policy directory does the journal have a registered deposit policy?', [ validators.DataRequired(), ExtraFieldRequiredIf( 'deposit_policy_other', reqval=Choices.deposit_policy_other_val("other")), ExclusiveCheckbox() ], description='Select all that apply.', choices=Choices.deposit_policy(), option_widget=widgets.CheckboxInput(), widget=widgets.ListWidget(prefix_label=False)) deposit_policy_other = StringField('Deposit Policy (Other)', ) copyright = RadioField( 'Does the journal allow the author(s) to hold the copyright without restrictions?', [validators.DataRequired()], choices=Choices.copyright()) copyright_url = URLField( 'Enter the URL where this information can be found', [ OptionalIf('copyright', optvals=Choices.copyright_url_optional()), URLOptionalScheme() ]) publishing_rights = RadioField( 'Will the journal allow the author(s) to retain publishing rights without restrictions?', [validators.DataRequired()], choices=Choices.publishing_rights()) publishing_rights_url = URLField( 'Enter the URL where this information can be found', [ OptionalIf('publishing_rights', optvals=Choices.publishing_rights_url_optional()), URLOptionalScheme() ])