Model builder plugin for oarepo-ui
Project description
UI model builder plugin
An OARepo Model Builder plugin to generate user interface layout from model specification.
Installation
pip install oarepo-model-builder-ui
Usage
The plugin adds support for UI annotation of the model file:
title:
type: keyword
label.key: title.label
label.cs: Název
label.en: Title
help.key: title.help
hint.key: title.hint
ui:
detail: <detail component name>
edit: <edit component name>
// any other property here - not validated
The following files are generated:
<package>
+- model
+- ui.json
+- templates
+- <langcode>
+- LC_MESSAGES
+- messages.po
+- messages.mo
i18n
The po
and mo
files are standard gettext po files. The translation keys
are taken from the *.key
properties. If keys are not specified, they are
generated from the property path (for example, metadata.creator.firstName.label ).
UI layout
The UI layout is generated as a convenience for other tools, for example for oarepo-cli
.
It contains simplified layout of the model. Example:
{
"children": {
"title": {
"detail": "fulltext",
"input": "fulltext",
"help": "title.help",
"label": "title.label",
"hint": "title.hint"
},
"providers": {
"detail": "array",
"input": "array",
"help": "providers.help",
"label": "providers.label",
"hint": "providers.hint",
"child": {
"detail": "provider",
"input": "provider",
"children": {
"name": {
"detail": "keyword",
"input": "keyword",
"help": "providers/name.help",
"label": "providers/name.label",
"hint": "providers/name.hint"
}
}
}
}
}
}
Fields:
- detail: component used for rendering the detail page
- input: component used for rendering input
- help/label/hint: keys to gettext message catalogues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for oarepo-model-builder-ui-4.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34935af826ba010e4fcdabfa5742904c630a9e79edcdb8a32598f73d58b46b4e |
|
MD5 | 0586e7b4ac6f2318c59a1c44f0cf0d5c |
|
BLAKE2b-256 | f9a0b4ebbd2f11ac69be460796ffbab1c68b3cf5475141f9e85a799eb1f9171f |
Close
Hashes for oarepo_model_builder_ui-4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b35a4f8a3ba476c680a93f3023be3c01ddf1f63ce1bc5a66c4ffc80a1cbca346 |
|
MD5 | 273d2999a6a7dc9baf9613aed4e45780 |
|
BLAKE2b-256 | f1966f6b6522f2711a98d302c381f155eb3972dcbbc3822bcb2cc7414b99b972 |