diff --git a/b2share/modules/schemas/validate.py b/b2share/modules/schemas/validate.py index 5cde8499f9..000dda1b66 100644 --- a/b2share/modules/schemas/validate.py +++ b/b2share/modules/schemas/validate.py @@ -54,6 +54,7 @@ # the properties which are defined must have this structure "title": {"type": "string"}, "description": {"type": "string"}, + "unit": {"type": "string"}, "type": { "enum": ["boolean", "integer", "number", "string", "array"] }, diff --git a/webui/app/css/app.css b/webui/app/css/app.css index 8cc7b8ab3c..e52be1c1c0 100644 --- a/webui/app/css/app.css +++ b/webui/app/css/app.css @@ -807,10 +807,22 @@ a.navbar-brand { color: #333; } +.schema-field { + font-weight: bold; +} + +.schema-field span:nth-child(2) { + color: grey; +} + .required.property { color: #F45D00; } +.required.property span:nth-child(2) { + color: #FF9D63; +} + /*****************************************************************************/ /* help and about pages */ diff --git a/webui/src/components/editrecord.jsx b/webui/src/components/editrecord.jsx index 2a024b6b18..f6f6de4136 100644 --- a/webui/src/components/editrecord.jsx +++ b/webui/src/components/editrecord.jsx @@ -384,8 +384,16 @@ const EditRecord = React.createClass({
{!title ? false : }
diff --git a/webui/src/components/record.jsx b/webui/src/components/record.jsx index f6543cd673..9f912afc39 100644 --- a/webui/src/components/record.jsx +++ b/webui/src/components/record.jsx @@ -445,7 +445,9 @@ const Record = React.createClass({ }
- {inner}
+ {inner} + {schema.get('unit') ? { schema.get('unit') } : false } +
); }, diff --git a/webui/src/components/schema.jsx b/webui/src/components/schema.jsx index 09cbc13446..4dc86d3254 100644 --- a/webui/src/components/schema.jsx +++ b/webui/src/components/schema.jsx @@ -37,7 +37,7 @@ export const Schema = React.createClass({ mixins: [React.addons.PureRenderMixin], renderSchema([id, schema]) { - const requiredClass = schema.get('isRequired') ? "required property":""; + const requiredClass = schema.get('isRequired') ? "required property" : ""; const type = schema.get('type'); const title = schema.get('title'); @@ -67,23 +67,21 @@ export const Schema = React.createClass({ inner = {inner} } - const leftcolumn = !id ? false : -
-

- {title} - - {title?" :: ":""} - {id} - {schema.get('isRequired') ? " (required)":false} - -

-

{schema.get('description')}

-
; - const rightcolumnsize = leftcolumn ? "col-sm-6" : "col-sm-12"; return (
  • - {leftcolumn} -
    {inner}
    +
    +

    + {title} + {schema.get('unit') ? ' (' + schema.get('unit') + ')' : false } + + {title ? " :: " : ""} + {id} + {schema.get('isRequired') ? " (required)" : false} + +

    +

    {schema.get('description')}

    +
    +
    {inner}
  • ); },