Skip to content

Commit

Permalink
documents: label change for preprint
Browse files Browse the repository at this point in the history
* Renames the title of the partof field with "Contained in or submitted to
  (journal, book, proceedings)".
* Changes the title field on detailed view with "Submitted to" for preprint.
* Closes #722.

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Mar 3, 2022
1 parent 7dbe2f6 commit 23644a1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@
}
},
"publication": {
"title": "Contained in (journal, book, proceedings)",
"title": "Contained in or submitted to (journal, book, proceedings)",
"type": "object",
"required": [
"publishedIn"
Expand Down Expand Up @@ -697,7 +697,7 @@
}
},
"form": {
"hideExpression": "field.parent.model && !['coar:c_3248', 'coar:c_5794', 'coar:c_6670', 'coar:c_3e5a', 'coar:c_beb9', 'coar:c_6501', 'coar:c_998f', 'coar:c_dcae04bc'].includes(field.parent.model.documentType)",
"hideExpression": "field.parent.model && !['coar:c_3248', 'coar:c_5794', 'coar:c_6670', 'coar:c_3e5a', 'coar:c_beb9', 'coar:c_6501', 'coar:c_816b', 'coar:c_998f', 'coar:c_dcae04bc'].includes(field.parent.model.documentType)",
"templateOptions": {
"wrappers": [
"card"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@
}
},
"partOf": {
"title": "Part of (host document)",
"title": "Contained in or submitted to (journal, book, proceedings)",
"type": "array",
"minItems": 1,
"items": {
Expand All @@ -1492,7 +1492,12 @@
"numberingYear": {
"title": "Year",
"type": "string",
"minLength": 1
"minLength": 1,
"form": {
"expressionProperties": {
"templateOptions.required": "!['coar:c_816b'].includes(field.parent.parent.parent.model.documentType)"
}
}
},
"numberingVolume": {
"title": "Volume",
Expand Down Expand Up @@ -1791,8 +1796,7 @@
"numberingPages"
],
"required": [
"document",
"numberingYear"
"document"
]
},
"form": {
Expand Down
3 changes: 2 additions & 1 deletion sonar/modules/documents/templates/documents/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ <h4 class="m-0">
<!-- PART OF -->
{% if record.partOf and record.partOf | length > 0 %}
<div class="d-flex flex-row mb-3">
<div class="mr-1"><strong>{{ _('Published in') }}:</strong></div>
<!-- Type preprint (coar:c_816b): "Submitted to" other "Published in" -->
<div class="mr-1"><strong>{{ _('Published in') if record.documentType != 'coar:c_816b' else _('Submitted to') }}:</strong></div>
<div class="">
<ul class="list-unstyled mb-0">
{% for item in record.partOf %}
Expand Down
3 changes: 2 additions & 1 deletion sonar/modules/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ def part_of_format(part_of):
if part_of.get('document', {}).get('title'):
items.append(part_of['document']['title'])

items.append(part_of['numberingYear'])
if 'numberingYear' in part_of:
items.append(part_of['numberingYear'])

if 'numberingVolume' in part_of:
items.append('{label} {value}'.format(
Expand Down

0 comments on commit 23644a1

Please sign in to comment.