Skip to content

Commit

Permalink
editor: compact the presentation
Browse files Browse the repository at this point in the history
* Improves editor appearance.
* Improves js package manager: use yarn instead of npm.
* Save vertical space by putting add item in menu

Co-Authored-by: Johnny Mariéthoz <Johnny.Mariethoz@rero.ch>
  • Loading branch information
jma committed Aug 8, 2019
1 parent 764849d commit f82c502
Show file tree
Hide file tree
Showing 30 changed files with 10,391 additions and 15,825 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ recursive-include ui *.py

# added by check_manifest.py
include *.json
include ui/yarn.lock

# added by check_manifest.py
recursive-include rero_ils *.ico
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"description": "Language from which a resource is translated.",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 2,
Expand All @@ -113,7 +114,7 @@
"title": "Authors",
"description": "Author(s) of the resource. Can be either persons or organisations.",
"type": "array",
"minItems": 0,
"minItems": 1,
"items": {
"type": "object",
"required": [
Expand Down Expand Up @@ -321,6 +322,7 @@
"minItems": 1,
"items": {
"type": "string",
"description": "Subject of the resource.",
"minLength": 1
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,80 +1,95 @@
[
{
"key": "identifiers.isbn",
"title": "ISBN"
"type": "fieldset",
"items": [
{
"key": "identifiers.isbn"
}
]
},
{
"key": "title",
"htmlClass": "rero21-required"
"type": "fieldset",
"title": "Title",
"items": [
{
"key": "title"
},
{
"key": "titlesProper",
"notitle": true,
"description": "",
"items": [
{
"key": "titlesProper[]",
"title": "Proper or uniformed title"
}
]
}
]
},
{
"type": "fieldset",
"title": "Author(s)",
"title": "Authors",
"nomenu": true,
"items": [
{
"key": "authors",
"notitle": true,
"description": "",
"add": "new author",
"style": {
"add": "btn-link"
},
"type": "array",
"items": [
{
"key": "authors[].type",
"type": "radiobuttons",
"notitle": true,
"description": "",
"condition": {
"functionBody": "{var author = model.authors[arrayIndices[0]]; return author.$ref === undefined && author.name === undefined && author.date === undefined && author.qualifier === undefined;}"
},
"titleMap": [
"type": "fieldset",
"items": [
{
"value": "person",
"name": "Person"
"key": "authors[].type",
"type": "select",
"condition": {
"functionBody": "{var author = model.authors[arrayIndices[0]]; return author.$ref === undefined && author.name === undefined && author.date === undefined && author.qualifier === undefined;}"
},
"titleMap": [
{
"value": "person",
"name": "Person"
},
{
"value": "organisation",
"name": "Organisation"
}
]
},
{
"key": "authors[].$ref",
"title": "Name of Person",
"condition": {
"functionBody": "{var author = model.authors[arrayIndices[0]]; return author.type === 'person';}"
},
"type": "refAuthority"
},
{
"title": "Name of Organisation",
"key": "authors[].name",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].type === 'organisation';}"
}
},
{
"key": "authors[].date",
"title": "Date of birth - date of death",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].$ref === undefined && model.authors[arrayIndices[0]].type === 'person';}"
}
},
{
"value": "organisation",
"name": "Organisation"
"key": "authors[].qualifier",
"title": "Title and other designation associated with person",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].$ref === undefined && model.authors[arrayIndices[0]].type === 'person';}"
}
}
],
"style": {
"selected": "btn-success",
"unselected": "btn-light"
}
},
{
"key": "authors[].$ref",
"title": "Name of Person",
"condition": {
"functionBody": "{var author = model.authors[arrayIndices[0]]; return author.type === 'person';}"
},
"type": "refAuthority"
},
{
"title": "Name of Organisation",
"key": "authors[].name",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].type === 'organisation';}"
}
},
{
"key": "authors[].date",
"title": "Date of birth - date of death",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].$ref === undefined && model.authors[arrayIndices[0]].type === 'person';}"
}
},
{
"key": "authors[].qualifier",
"title": "Title and other designation associated with person",
"description": "",
"condition": {
"functionBody": "{return model.authors[arrayIndices[0]].$ref === undefined && model.authors[arrayIndices[0]].type === 'person';}"
}
]
}
]
}
Expand All @@ -83,28 +98,21 @@
{
"type": "fieldset",
"title": "Language(s) of the resource",
"nomenu": true,
"items": [
{
"key": "languages",
"notitle": true,
"description": "",
"add": "new language",
"style": {
"add": "btn-link"
},
"type": "array",
"validationMessage": {
"402": "<span class=\"text-danger\">Language value should be unique!</span>"
"uniqueItems": "Language value should be unique!"
},
"items": [
{
"type": "fieldset",
"items": [
{
"key": "languages[].language",
"notitle": true,
"description": "",
"htmlClass": "rero21-required",
"titleMap": [
{
"value": "ara",
Expand Down Expand Up @@ -164,12 +172,11 @@
},
{
"type": "fieldset",
"title": "Date of publication",
"title": "Publication Dates",
"items": [
{
"key": "publicationYear",
"notitle": true,
"type": "integer"
"type": "text"
},
{
"key": "freeFormedPublicationDate",
Expand All @@ -178,8 +185,11 @@
]
},
{
"key": "type",
"title": "Document type",
"description": "Type of the document"
"type": "fieldset",
"items": [
{
"key": "type"
}
]
}
]
]
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
[
{
"title": "Organisation",
"key": "organisation.$ref",
"type": "select",
"remoteRecordType": "organisations",
"readonly": "true"
"type": "fieldset",
"items": [
{
"title": "Organisation",
"key": "organisation.$ref",
"type": "select",
"remoteRecordType": "organisations",
"readonly": "true"
}
]
},
{
"key": "name",
"validationMessage": {
"alreadyTakenMessage": "The item type name is already taken"
},
"remoteRecordType": "item_types"
"type": "fieldset",
"items": [
{
"key": "name",
"validationMessage": {
"alreadyTakenMessage": "The item type name is already taken"
},
"remoteRecordType": "item_types"
}
]
},
{
"key": "description"
"type": "fieldset",
"items": [
{
"key": "description"
}
]
}
]
54 changes: 37 additions & 17 deletions rero_ils/modules/items/jsonschemas/form_items/item-v0.0.1.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
[
{
"key": "barcode",
"validationMessage": {
"alreadyTakenMessage": "The barcode is already taken",
"cannotBeVerifiedMessage": "The server cannot verify the barcode"
},
"remoteRecordType": "items"
"type": "fieldset",
"items": [
{
"key": "barcode",
"validationMessage": {
"alreadyTakenMessage": "The barcode is already taken",
"cannotBeVerifiedMessage": "The server cannot verify the barcode"
},
"remoteRecordType": "items"
}
]
},
{
"key": "call_number"
"type": "fieldset",
"items": [
{
"key": "call_number"
}
]
},
{
"key": "location.$ref",
"title": "Location",
"type": "select",
"remoteRecordType": "locations",
"remoteRecordFiltersByOwningLibrary": "library.pid"
"type": "fieldset",
"items": [
{
"key": "location.$ref",
"title": "Location",
"type": "select",
"remoteRecordType": "locations",
"remoteRecordFiltersByOwningLibrary": "library.pid"
}
]
},
{
"key": "item_type.$ref",
"title": "Type",
"remoteRecordType": "item_types",
"type": "select"
"type": "fieldset",
"items": [
{
"key": "item_type.$ref",
"title": "Type",
"remoteRecordType": "item_types",
"type": "select"
}
]
}
]
]
Loading

0 comments on commit f82c502

Please sign in to comment.