model program schema update related UI changes
@@ -362,18 +362,20 @@ class ModelProgramFileMetaData(GenericFileMetaDataMixin):
json_schema = json.dumps(json_schema, indent=4)
else:
json_schema = ''
- dom_tags.label("Model Instance Metadata Schema", fr="mi-json-schema",
- cls="control-label")
- dom_tags.span(cls="glyphicon glyphicon-info-sign text-muted", data_toggle="tooltip",
+
+ with dom_tags.fieldset(cls="fieldset-border"):
+ with dom_tags.legend("Model Instance Metadata Schema", cls="legend-border",
+ style="font-size: 14px; font-weight:bold;"):
+ dom_tags.span(cls="glyphicon glyphicon-info-sign text-muted",
+ data_toggle="tooltip",
data_placement="auto",
- data_original_title="Upload/select a JSON file containing the schema."
- " The content of the file will be shown below "
- "when you save metadata.")
+ data_original_title="Upload/select a JSON file containing "
+ "the schema. The content of the file "
+ "will be shown below when you "
+ "save metadata.")
- # give an option to upload a json file for the metadata schema
+ # give an option to upload/select a json file for the metadata schema
with dom_tags.div(cls="form-group"):
- dom_tags.input(type="file", accept=".json",
- name='mi_json_schema_file', id='mi-json-schema-file')
with dom_tags.select(cls="form-control", name='mi_json_schema_template',
style="margin-top:10px;"):
dom_tags.option("Select a schema", value="")
@@ -381,6 +383,12 @@ class ModelProgramFileMetaData(GenericFileMetaDataMixin):
for schema_template in glob.glob(template_path):
template_file_name = os.path.basename(schema_template)
dom_tags.option(template_file_name, value=schema_template)
+ dom_tags.p("OR")
+ with dom_tags.div(cls="row file-row"):
+ with dom_tags.div(cls="col-md-12"):
+ dom_tags.span("Upload a schema:")
+ dom_tags.input(type="file", accept=".json",
+ name='mi_json_schema_file', id='mi-json-schema-file')
if json_schema:
dom_tags.button("Show Model Instance Metadata JSON Schema", type="button",
@@ -395,11 +403,12 @@ class ModelProgramFileMetaData(GenericFileMetaDataMixin):
name="metadata_json_schema", rows="30", readonly="")
else:
dom_tags.div(
- "Metadata schema is missing. You can either upload a schema JSON file or "
- "select one of the existing schema JSON files. Save changes using the "
- "button below to make the uploaded/selected schema JSON file part of "
- "the model program aggregation.",
+ "Metadata schema is missing. You can either upload a schema "
+ "JSON file or select one of the existing schema JSON files. "
+ "Save changes using the button below to make the uploaded/selected "
+ "schema JSON file part of the model program aggregation.",
cls="alert alert-danger", id="div-missing-schema-message")
+
with dom_tags.div(id="mp_content_files", cls="control-group"):
with dom_tags.div(cls="controls"):
dom_tags.legend('Content Files')
