information page"
- }
+ }
},
"is_url" # ~~^->IsURL:FormValidator~~
],
@@ -1298,7 +1304,7 @@ class FieldDefinitions:
"field": "preservation_service",
"value": "national_library",
"message": "Enter the name(s) of the national library or libraries where the journal is archived"
- }
+ }
}
],
"asynchronous_warning": [
@@ -1324,7 +1330,7 @@ class FieldDefinitions:
"field": "preservation_service",
"value": "other",
"message": "Enter the name of another archiving policy"
- }
+ }
}
],
"asynchronous_warning": [
@@ -1423,7 +1429,7 @@ class FieldDefinitions:
"field": "deposit_policy",
"value": "other",
"message": "Enter the name of another repository policy"
- }
+ }
}
],
"asynchronous_warning": [
@@ -1510,8 +1516,8 @@ class FieldDefinitions:
],
"help": {
"long_help": ["A persistent article identifier (PID) is used to find the article no matter where it is "
- "located. The most common type of PID is the digital object identifier (DOI). ",
- "Read more about PIDs."],
+ "located. The most common type of PID is the digital object identifier (DOI). ",
+ "Read more about PIDs."],
},
"validate": [
{"required": {"message": "Select at least one option"}}
@@ -1529,7 +1535,7 @@ class FieldDefinitions:
"field": "persistent_identifiers",
"value": "other",
"message": "Enter the name of another type of identifier"
- }
+ }
}
],
"asynchronous_warning": [
@@ -1552,7 +1558,7 @@ class FieldDefinitions:
"default" : "",
"help": {
"long_help": ["An ORCID (Open Researcher and Contributor) iD is an alphanumeric code to uniquely identify "
- "authors."],
+ "authors."],
},
"contexts" : {
"public" : {
@@ -1643,7 +1649,7 @@ class FieldDefinitions:
"input": "textarea",
"help": {
"long_help": ["The selected reason for rejection, and any additional information you include, "
- "are sent to the journal contact with the rejection email."]
+ "are sent to the journal contact with the rejection email."]
},
"validate": [
{"required_if": {"field": "quick_reject", "value": "other"}}
@@ -1693,7 +1699,7 @@ class FieldDefinitions:
"help" : {
"render_error_box": False,
"short_help" : "Set the status to 'In Progress' to signal to the applicant that you have started your review."
- "Set the status to 'Completed' to alert the Editor that you have completed your review.",
+ "Set the status to 'Completed' to alert the Editor that you have completed your review.",
"update_requests_diff": False
}
},
@@ -1701,7 +1707,7 @@ class FieldDefinitions:
"help" : {
"render_error_box" : False,
"short_help" : "Revert the status to 'In Progress' to signal to the Associate Editor that further work is needed."
- "Set the status to 'Ready' to alert the Managing Editor that you have completed your review.",
+ "Set the status to 'Ready' to alert the Managing Editor that you have completed your review.",
"update_requests_diff": False
}
}
@@ -1779,7 +1785,7 @@ class FieldDefinitions:
"input": "taglist",
"validate": [
{"is_issn_list": {"message": "This is not a valid ISSN"}}, # ~~^-> IsISSN:FormValidator~~
- {"different_to": {"field": "continued_by"}}, # ~~^-> DifferetTo:FormValidator~~
+ {"different_to": {"field": "continued_by", "message": "The ISSN provided in both fields must be different. Please make sure to enter the ISSN of an older journal for the first field and the ISSN of a newer journal for the second field. They cannot be the same."}}, # ~~^-> DifferetTo:FormValidator~~
{
"not_if" : {
"fields" : [{"field" : "discontinued_date"}],
@@ -1802,7 +1808,7 @@ class FieldDefinitions:
"input": "taglist",
"validate": [
{"is_issn_list": {"message": "This is not a valid ISSN"}}, # ~~^-> IsISSN:FormValidator~~
- {"different_to": {"field": "continues"}}, # ~~^-> DifferetTo:FormValidator~~
+ {"different_to": {"field": "continues", "message": "The ISSN provided in both fields must be different. Please make sure to enter the ISSN of an older journal for the first field and the ISSN of a newer journal for the second field. They cannot be the same."}}, # ~~^-> DifferetTo:FormValidator~~
{
"not_if": {
"fields": [{"field": "discontinued_date"}],
@@ -1830,18 +1836,18 @@ class FieldDefinitions:
"validate": [
{"required_if" : {
"field" : "application_status",
- "value" : [
- constants.APPLICATION_STATUS_READY,
- constants.APPLICATION_STATUS_COMPLETED,
- constants.APPLICATION_STATUS_ACCEPTED
- ],
- "message" : "This field is required when setting the Application Status to {y}, {z} or {a}".format(
- y=constants.APPLICATION_STATUS_READY,
- z=constants.APPLICATION_STATUS_COMPLETED,
- a=constants.APPLICATION_STATUS_ACCEPTED
- )
- }
- }
+ "value" : [
+ constants.APPLICATION_STATUS_READY,
+ constants.APPLICATION_STATUS_COMPLETED,
+ constants.APPLICATION_STATUS_ACCEPTED
+ ],
+ "message" : "This field is required when setting the Application Status to {y}, {z} or {a}".format(
+ y=constants.APPLICATION_STATUS_READY,
+ z=constants.APPLICATION_STATUS_COMPLETED,
+ a=constants.APPLICATION_STATUS_ACCEPTED
+ )
+ }
+ }
],
"widgets": [
"subject_tree"
@@ -2822,6 +2828,7 @@ class DifferentToBuilder:
@staticmethod
def render(settings, html_attrs):
html_attrs["data-parsley-different-to"] = settings.get("field")
+ html_attrs["data-parsley-different-to-message"] = "" + settings.get("message") + "
"
@staticmethod
def wtforms(field, settings):
@@ -3092,7 +3099,7 @@ class MultiCheckboxBuilder(WTFormsBuilder):
@staticmethod
def match(field):
return field.get("input") == "checkbox" and \
- (len(field.get("options", [])) > 0 or field.get("options_fn") is not None)
+ (len(field.get("options", [])) > 0 or field.get("options_fn") is not None)
@staticmethod
def wtform(formulaic_context, field, wtfargs):
diff --git a/portality/static/js/application_form.js b/portality/static/js/application_form.js
index 178aef09c4..3944845669 100644
--- a/portality/static/js/application_form.js
+++ b/portality/static/js/application_form.js
@@ -844,8 +844,8 @@ window.Parsley.addValidator("optionalIf", {
});
window.Parsley.addValidator("differentTo", {
- validateString : function(value, requirement) {
- return (!value || ($("[name = " + requirement + "]")).val() !== value);
+ validateString : function(value, requirement, message) {
+ return (!value || ($("[name = " + requirement + "]")).val().toLowerCase() !== value.toLowerCase());
},
messages: {
en: 'Value of this field and %s field must be different'