-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from invenio_records_resources.services.custom_fields import TextCF | ||
from marshmallow import validate | ||
from marshmallow_utils.fields import ISOLangString | ||
|
||
RDM_NAMESPACES = { | ||
"imperial": "https://www.imperial.ac.uk", | ||
} | ||
|
||
RDM_CUSTOM_FIELDS = [ | ||
TextCF( | ||
name="imperial:contact_information", | ||
field_cls=ISOLangString, | ||
field_args={ | ||
# must be an implementation of Marshmallow.validate.Validator | ||
"validate": validate.Email(), | ||
}, | ||
multiple=False, | ||
), | ||
] | ||
|
||
RDM_CUSTOM_FIELDS_UI = [ | ||
{ | ||
"section": "Contact information", | ||
"fields": [ | ||
dict( | ||
field="imperial:contact_information", | ||
ui_widget="Input", | ||
template="contact_information.html", | ||
props=dict( | ||
label="Contact information", | ||
placeholder="[email protected]", | ||
icon="address card outline", | ||
description="Please provide an email for contact information.", | ||
# True for autocomplete dropdowns with search functionality | ||
search=False, | ||
multiple=False, # True for selecting multiple values | ||
clearable=True, | ||
), | ||
) | ||
], | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{field_value}} |