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-2.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1668293fe2e7bba079e644c2a56b26d4c677f9ea92092191d7b4883317b032f8 |
|
MD5 | 8e2b8e9908724167019388060f24bdd1 |
|
BLAKE2b-256 | edc5d6d855072518c118d7e04ce19a9dc82d73639389dbf0c0f895a74b595f58 |
Close
Hashes for oarepo_model_builder_ui-2.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82da98b33877dc236f0c24fac6d2e24efc4238ebc8dea6ab918b2099d6259c61 |
|
MD5 | 38e6fb6ac12f721bd84a4ff3ed8320b9 |
|
BLAKE2b-256 | 2ec5ed7a25f1a0ce49ac4edda0a4cdd3d0ae9de2af3c78dd012f0aa5b86e8136 |