diff --git a/app/views/shared/ui-component/_loader.html.haml b/app/views/shared/ui-component/_loader.html.haml
deleted file mode 100644
index d52309bb38..0000000000
--- a/app/views/shared/ui-component/_loader.html.haml
+++ /dev/null
@@ -1,5 +0,0 @@
-.d-flex.align-items-center.flex-column
- .spinner-border{:role => "status"}
- %span.sr-only Loading...
- .spinner-text.my-2
- Loading...
\ No newline at end of file
diff --git a/app/views/submissions/_form.html.haml b/app/views/submissions/_form.html.haml
index e9e2ceb8ec..c986573498 100644
--- a/app/views/submissions/_form.html.haml
+++ b/app/views/submissions/_form.html.haml
@@ -1,70 +1,19 @@
-
-
:javascript
$(document).ready(function() {
-
- // Properly display the information for 'File Location' based on radio button
- if (jQuery("#submission_isRemote_0").is(":checked")) {
- location_toggle("upload");
- }
- if (jQuery("#submission_isRemote_1").is(":checked")) {
- location_toggle("remote");
- }
-
- // Select default 'File Location' radio button
- if (!jQuery("#submission_isRemote_0").is(":checked") && !jQuery("#submission_isRemote_1").is(":checked") && !jQuery("#submission_isRemote_2").is(":checked")) {
- jQuery("#submission_isRemote_0").attr("checked", "checked")
- }
- // Handles showing/hiding options for a particular ontology format
- jQuery("#submission_hasOntologyLanguage").change(ontologyFormatChange);
-
- // Check to see if owl is selected, show options if so
- ontologyFormatChange();
jQuery("#ontology_submission_form").validate();
});
-
- // Show/hide location inputs
- function location_toggle(input_div) {
- jQuery('.hidden_field').hide();
- jQuery('.hidden_field input').attr("disabled", true);
- jQuery('#' + input_div + " input").removeAttr("disabled");
- jQuery('#' + input_div).show();
- }
- function ontologyFormatChange(format){
- var selected = jQuery("#submission_hasOntologyLanguage option:selected");
- switch(selected.val()){
- case 'OWL':
- jQuery(".format_options").optionsOut("fast");
- jQuery("#owl_options").optionsIn("fast");
- break;
- case 'SKOS':
- jQuery(".format_options").optionsOut("fast");
- jQuery("#skos_options").optionsIn("fast");
- break;
- case 'OBO':
- jQuery(".format_options").optionsOut("fast");
- jQuery("#obo_options").optionsIn("fast");
- break;
- case 'UMLS':
- jQuery(".format_options").optionsOut("fast");
- jQuery("#umls_options").optionsIn("fast");
- break;
- default:
- jQuery(".format_options").optionsOut("fast");
+ function onMetadataChange(){
+ let frame = document.getElementById('metadata_by_ontology')
+ let properties = document.getElementById('search_metadata')
+ let required = document.getElementById('filter-required-only')
+ let selectedProperties = "all"
+ if(properties){
+ selectedProperties = Array.from(properties.selectedOptions).map(({ value }) => value).join(',')
}
+ frame.src = "?properties=" + selectedProperties + "&required=" + required.checked + "&show_sections=true"
}
-
- jQuery.fn.optionsIn = function(speed, easing, callback){
- jQuery("#format_spacing").css("margin", "1em 0");
- this.fadeIn(speed);
- };
-
- jQuery.fn.optionsOut = function(speed, easing, callback){
- this.css("display", "none");
- jQuery("#format_spacing").css("margin", "0");
- };
- unless @errors.nil?
%div.form-group.row
@@ -72,8 +21,14 @@
%strong Errors On Form
%ul
- for error in @errors
- %li
- = error
+ - if error.is_a? Array
+ %ul
+ - error[1].each do |key, message|
+ %li
+ = message
+ - else
+ %li
+ = error
%div#editMetadataDiv
%div{:style => "width: 50%;margin: 3em auto;"}
@@ -83,656 +38,25 @@
%div{:style => "text-align: center;"}
%span.asterik * fields are required
%br
- = extractable_metadatum_tooltip({ text: 'Metadata that can be extracted from the ontology' })
-
-= hidden_field :submission, :ontology, value: @ontology.id
-
-%div.card.mt-4
- %div.card-header.bg-success General
- %div.card-body
- %div.card-text
- -# Format
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_hasOntologyLanguage"}
- Format
- %span.asterik *
- %div.col-sm-8
- - ont_formats = ["OBO", "OWL", "UMLS", "SKOS"].sort
- - selected = @submission.hasOntologyLanguage ? @submission.hasOntologyLanguage : "OWL"
- -# TODO: Add/remove aria-describedby attribute for SKOS help text display
- = select "submission", "hasOntologyLanguage", options_for_select(ont_formats, selected), {required: true}, {class: "form-control"}
- %small.form-text.text-muted#helpSkosFormat
- SKOS vocabularies submitted to BioPortal must contain a minimum of one concept scheme and top concept assertion. |
- Please refer to the NCBO wiki for a more
detailed explanation |
- with examples. |
-
- %div.form-group.row
- %div.col-sm-8.offset-sm-4
- %a#collapseOWLOptions{href: "#owl-options", role: "button", data: {toggle: "collapse"}, aria: {expanded: "false", controls: "owl-options"}, |
- class: "btn btn-outline-secondary btn-sm"} Show advanced OWL options |
-
- -# Optional property overrides for OWL ontologies
- %div#owl-options.collapse
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label Customize default property settings
-
- -# Preferred name
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_prefLabelProperty"} Preferred name
- = text_field :submission, :prefLabelProperty, value: @submission.prefLabelProperty, class: "form-control form-control-sm", aria: {describedBy: "preferredNameHelpBlock"}
- %small.form-text.text-muted#preferredNameHelpBlock
- Enter a property ID, or use the default setting: |
-
http://www.w3.org/2004/02/skos/core#prefLabel. |
-
- -# Synonym
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_synonymProperty"} Synonym
- = text_field :submission, :synonymProperty, value: @submission.synonymProperty, class: "form-control form-control-sm", aria: {describedBy: "synonymHelpBlock"}
- %small.form-text.text-muted#synonymHelpBlock
- Enter a property ID, or leave blank to use the default setting: |
-
http://www.w3.org/2004/02/skos/core#altLabel. |
-
- -# Definition
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_definitionProperty"} Definition
- = text_field :submission, :definitionProperty, value: @submission.definitionProperty, class: "form-control form-control-sm", aria: {describedBy: "definitionHelpBlock"}
- %small.form-text.text-muted#definitionHelpBlock
- Enter a property ID, or leave blank to use the default setting: |
-
http://www.w3.org/2004/02/skos/core#definition. |
-
- -# Author
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_authorProperty"} Author
- = text_field :submission, :authorProperty, value: @submission.authorProperty, class: "form-control form-control-sm", aria: {describedBy: "authorHelpBlock"}
- %small.form-text.text-muted#authorHelpBlock
- Enter a property ID, or leave blank to use the default setting: |
-
http://purl.org/dc/elements/1.1/creator. |
-
- -# Obsolete classes
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label Identify obsolete classes
-
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_obsoleteProperty"} Obsolete property
- = text_field :submission, :obsoleteProperty, value: @submission.obsoleteProperty, class: "form-control form-control-sm", aria: {describedBy: "obsoleteHelpBlock"}
- %small.form-text.text-muted#obsoleteHelpBlock
- Optionally enter a property ID that indicates obsolete status for ontology classes |
- (the property value must be set to "true"). Note that by default, BioPortal checks for existence of the owl:deprecated property. |
-
- %div.form-group.row
- %div.col-sm-8.offset-sm-2
- %label{for: "submission_obsoleteParent"} Obsolete branch root
- = text_field :submission, :obsoleteParent, value: @submission.obsoleteParent, class: "form-control form-control-sm", aria: {describedBy: "obsoleteRootHelpBlock"}
- %small.form-text.text-muted#obsoleteRootHelpBlock
- Optionally enter a class ID for the root of an obsolete branch. All classes in the branch will be marked as |
- obsolete, with the exception of the root class. |
-
- -# Version
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_version"} Version
- %div.col-sm-8
- = text_field :submission, :version, value: @submission.version, class: "form-control"
-
- -# Status
- %div.form-group.row
- %label.col-sm-4.col-form-lable{for: "submission_status"}
- Status
- %span.asterik *
- %div.col-sm-8
- - selected_status = @submission.status ? @submission.status : "alpha"
- - status_options = ["alpha", "beta", "production", "retired"]
- = select :submission, :status, status_options, {selected: selected_status, required: true}, class: "form-control"
-
- -# Location
- %div#submissionLocation.form-group.row
- %label.col-sm-4.col-form-label.pt-0
- Location
- %span.asterik *
- %div.col-sm-8
- - if !@masterFileOptions
- %div.form-check
- - checked = @ontology.summaryOnly
- = radio_button(:submission, :isRemote, 3, :onclick=>"$('.hidden_field').hide();", checked: checked, aria: {describedBy: "metadataHelpBlock"}, class: "form-check-input")
- %label.form-check-label{for: "submission_isRemote_3"}
- Metadata only
- %small.form-text.text-muted#metadataHelpBlock Allow users to view and search your ontology metadata, but not its classes and properties.
- %div.form-check
- - checked = !(@submission.pullLocation.nil? || @submission.pullLocation.empty?)
- = radio_button(:submission, :isRemote, 1, :onclick=>"location_toggle('remote');", checked: checked, aria: {describedBy: "loadFromURLHelpBlock"}, class: "form-check-input")
- %label.form-check-label{for: "submission_isRemote_1"}
- Load from URL
- %small.form-text.text-muted#loadFromURLHelpBlock New versions loaded on a nightly basis.
- - display = (checked and "" or "display:none;")
- %div.hidden_field#remote{style: display}
- = text_field(:submission, :pullLocation, value: @submission.pullLocation, aria: {describedBy: "enterURLHelpBlock"}, class: "form-control")
- %small.form-text.text-muted#enterURLHelpBlock Enter a URL, including the name of your ontology source file, e.g., http://www.example.com/my_ontology.owl.
- %div.form-check
- - checked = (!@ontology.summaryOnly) && @submission.pullLocation.nil?
- = radio_button(:submission, :isRemote, 0, :onclick=>"location_toggle('upload');", checked: checked, class: "form-check-input")
- %label.form-check-label{for: "submission_isRemote_0"}
- Upload local file
- - display = (checked and "" or "display:none;")
- %div.hidden_field#upload{style: display}
- = f.file_field(:filePath, class: "mt-2")
- - else
- -# TODO: Has this section of code actually been tested?
- = radio_button :submission, :isRemote, 0, :onclick=>"location_toggle('upload');", checked: true
- Upload Local File
- %br/
- %span{:style => "font-size:11px;"} (choose a file on your local file system to upload)
- - display = (checked and "" or "display:none;")
- %div#upload{style: display}
- = f.file_field :filePath, required: true
- = f.select("masterFileName", @masterFileOptions, { include_blank: "Select primary file from zip contents", required: true}, {style: "border-color: red;"})
-
-%div.card.mt-4
- %div.card-header.bg-success Key properties
- %div.card-body
- %div.card-text
- %div.form-group.row
- %div.col-sm-4
- -# generate_attribute functions are defined in submissions_helper.rb
- = generate_attribute_label("URI")
- %div.col-sm-8
- = raw generate_attribute_input("URI")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("status")
- %div.col-sm-8
- - selected_status = @submission.status ? @submission.status : "alpha"
- - status_options = ["alpha", "beta", "production", "retired"]
- = select :submission, :status, status_options, { :selected => selected_status, :required => true}, {:class => "form-control"}
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("deprecated")
- %div.col-sm-8
- = raw generate_attribute_input("deprecated")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("version")
- %div.col-sm-8
- = raw generate_attribute_input("version")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasOntologySyntax")
- %div.col-sm-8
- = generate_attribute_input("hasOntologySyntax")
- %p
- Properties taken from
- = link_to "W3C URIs for file format", "https://www.w3.org/ns/formats/", target: "_blank"
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasFormalityLevel")
- %div.col-sm-8
- = generate_attribute_input("hasFormalityLevel")
- %p
- Properties taken from
- = link_to "DCMI KOS type vocabularies", "http://wiki.dublincore.org/index.php/NKOS_Vocabularies#KOS_Types_Vocabulary", target: "_blank"
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("isOfType")
- %div.col-sm-8
- = generate_attribute_input("isOfType")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("naturalLanguage")
- %div.col-sm-8
- = generate_attribute_input("naturalLanguage")
- %p
- Consider using a
- = link_to "Lexvo URI", "http://www.lexvo.org", target: "_blank"
- with ISO639-3 code
- %br
- e.g.: http://lexvo.org/id/iso639-3/eng
-
-%div#description-card.card.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#description'} Description
- %div#description.show{'data-parent'=>"#description-card"}
- %div.card-body
- -# Description
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_description"}
- Description
- %span.asterik *
- %div.col-sm-8
- = text_area :submission, :description, rows: 5, value: @submission.description, required: true, class: "form-control"
- -# Home page
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_homepage"} Homepage
- %div.col-sm-8
- = text_field :submission, :homepage, value: @submission.homepage, class: "form-control", aria: {describedBy: "homepageHelpBlock"}
- %small.form-text.text-muted#homepageHelpBlock Enter a URL for the main page of your ontology.
-
- -# Documentation page
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_documentation"} Documentation
- %div.col-sm-8
- = text_field :submission, :documentation, value: @submission.documentation, class: "form-control", aria: {describedBy: "docsHelpBlock"}
- %small.form-text.text-muted#docsHelpBlock Enter a URL for a page that provides ontology documentation.
-
- -# Publications page
- %div.form-group.row
- %label.col-sm-4.col-form-label{for: "submission_publication"} Publications
- %div.col-sm-8
- = text_field :submission, :publication, value: @submission.publication, class: "form-control", aria: {describedBy: "pubsHelpBlock"}
- %small.form-text.text-muted#pubsHelpBlock Enter a URL for a page that lists publications about your ontology.
+ = extractable_metadatum_tooltip({ text: 'Metadata that can be extracted from the ontology' , content: "Extractable metadatum"})
- -# Used ontology engineering tool
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("usedOntologyEngineeringTool")
- %div.col-sm-8
- = raw generate_attribute_input("usedOntologyEngineeringTool")
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-description-details'} More description details
- %div#more-description-details.collapse{'data-parent'=>"#description-card"}
- %div.card-body
- - for attr_name in ['abstract', 'notes', 'keywords', 'alternative', 'identifier']
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr_name)
- %div.col-sm-8
- = generate_attribute_input(attr_name)
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#define-usage'} Define usage
- %div#define-usage.collapse{'data-parent'=>"#description-card"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'usage' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = generate_attribute_input(attr["attribute"])
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-methodology-information'} More methodology information
- %div#more-methodology-information.collapse{'data-parent'=>"#description-card"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'methodology' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = generate_attribute_input(attr["attribute"])
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-links'} More links
- %div#more-links.collapse{'data-parent'=>"#description-card"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'links' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = generate_attribute_input(attr["attribute"])
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#ontology-images'} Ontology images
- %div#ontology-images.collapse{'data-parent'=>"#description-card"}
- %div.card-body
- -# More description details
- - for attr in @metadata.select { |m| m['display'] == 'images' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = generate_attribute_input(attr["attribute"])
+ %div.d-flex.align-items-center.justify-content-between{onchange: "onMetadataChange()"}
+ - unless @filters_disabled
+ %div.w-75.mt-3
+ - if @submission.id
+ = render MetadataSelectorComponent.new(label: 'Filter properties to show', values: submission_editable_properties , selected: nil, inline: true)
+ %div
+ = render SwitchInputComponent.new(id:"filter-required-only", name: "required-only", label: "Required only", checked: @required_only)
-%div#ontology-dates-card.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#ontology-dates'} Dates
- %div#ontology-dates.collapse.show{'data-parent'=>"#ontology-dates-card"}
- %div.card-body
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label('released')
- %div.col-sm-8
- = raw generate_attribute_input('released', default: Date.today)
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label('modificationDate')
- %div.col-sm-8
- = raw generate_attribute_input('modificationDate')
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-dates'} More dates
- %div#more-dates.collapse{'data-parent'=>"#ontology-dates-card"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'dates' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
-%div#licenses-card.card.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#licenses'} Licenses
- %div#licenses.collapse.show{'data-parent'=>"#licenses-card"}
- %div.card-body
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasLicense")
- %div.col-sm-8
- = raw generate_attribute_input("hasLicense")
- %div.form-group.row
- %div.col-sm-12
- %p
- Consider using a
- = link_to "URI to describe your License", "http://rdflicense.appspot.com", target: "_blank"
- %p
- Consider using
- = link_to "INRIA licentia", "http://licentia.inria.fr/", target: "_blank"
- to choose your license
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-licensing-info'} More licensing information
- %div#more-licensing-info.collapse{'data-parent'=>"#licenses"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'license' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = generate_attribute_input(attr["attribute"])
-
-%div#community.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#contacts-panel'} Contacts
- %div#contacts-panel.collapse.show{'data-parent'=>"#community"}
- %div.card-body
- -# Contact(s)
- %div#contacts.form-group.row
- %label.col-sm-4.col-form-label
- Contact
- %span.asterik *
- - if @submission.contact && @submission.contact.size > 0
- - @submission.contact.each_with_index do |contact, i|
- - if i == 0
- -# Contact div
- %div.col-sm-8.d-flex.align-items-center.contact
- %label Name
- = text_field :submission, :"contact[#{i}][name]", value: contact["name"], class: "form-control flex-grow-1 mx-2"
- %label Email
- = text_field :submission, :"contact[#{i}][email]", value: contact["email"], class: "form-control flex-grow-1 mx-2"
- %button.btn.btn-success.add-contact
- %i{class: "fas fa-plus fa-lg", aria: {hidden: "true"}}
- - else
- -# TODO
- -# Secondary contacts need to be offset by 2 columns, and have a delete button.
- %div.col-sm-8.d-flex.align-items-center.offset-sm-2.contact
- %label Name
- = text_field :submission, :"contact[#{i}][name]", value: contact["name"], class: "form-control flex-grow-1 mx-2"
- %label Email
- = text_field :submission, :"contact[#{i}][email]", value: contact["email"], class: "form-control flex-grow-1 mx-2"
- %button.btn.btn-success.add-contact
- %i{class: "fas fa-plus fa-lg", aria: {hidden: "true"}}
- %button.btn.btn-danger.ml-1.remove-contact
- %i{class: "fas fa-minus fa-lg", aria: {hidden: "true"}}
- - else
- -# TODO
- %div.col-sm-8.d-flex.align-items-center.contact
- %label Name:
- = text_field :submission, :"contact[0][name]", class: "form-control flex-grow-1 mx-2"
- %label Email:
- = text_field :submission, :"contact[0][email]", class: "form-control flex-grow-1 mx-2"
- %button.btn.btn-success.add-contact
- %i{class: "fas fa-plus fa-lg", aria: {hidden: "true"}}
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasContributor")
- %div.col-sm-8
- = raw generate_attribute_input("hasContributor")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasCreator")
- %div.col-sm-8
- = raw generate_attribute_input("hasCreator")
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-community-info'} More community information
- %div#more-community-info.collapse{'data-parent'=>"#community"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'community' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-people-info'} More people information
- %div#more-people-info.collapse{'data-parent'=>"#community"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'people' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
-
-%div#ontology-relations-more.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#ontology-relations'} Ontology relations
- %div#ontology-relations.collapse.show{'data-parent'=>"#ontology-relations-more"}
- %div.card-body
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("useImports")
- %div.col-sm-8
- = raw generate_attribute_input("useImports")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("hasPriorVersion")
- %div.col-sm-8
- = raw generate_attribute_input("hasPriorVersion")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("isAlignedTo")
- %div.col-sm-8
- = raw generate_attribute_input("isAlignedTo")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("ontologyRelatedTo")
- %div.col-sm-8
- = raw generate_attribute_input("ontologyRelatedTo")
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-relations'} More relations
- %div#more-relations.collapse{'data-parent'=>"#ontology-relations-more"}
- %div.card-body
- - for attr in @metadata
- - if attr["display"].eql?("relations")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
-
-%div#ontology-content-metrics.mt-4
- %div.card
- %div.card-header.bg-success
- %a.card-link{'data-toggle'=>'collapse', :href=>'#ontology-content'} Ontology content
- %div#ontology-content.collapse.show{'data-parent'=>"#ontology-content-metrics"}
- %div.card-body
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("preferredNamespacePrefix")
- %div.col-sm-8
- = raw generate_attribute_input("preferredNamespacePrefix")
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label("preferredNamespaceUri")
- %div.col-sm-8
- = raw generate_attribute_input("preferredNamespaceUri")
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-informations'} More content informations
- %div#more-informations.collapse{'data-parent'=>"#ontology-content-metrics"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'content' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
- %div.card
- %div.card-header
- %a.card-link.collapsed{'data-toggle'=>'collapse', :href=>'#more-metrics-informations'} More metrics informations
- %div#more-metrics-informations.collapse{'data-parent'=>"#ontology-content-metrics"}
- %div.card-body
- - for attr in @metadata.select { |m| m['display'] == 'metrics' }
- %div.form-group.row
- %div.col-sm-4
- = generate_attribute_label(attr["attribute"])
- %div.col-sm-8
- = raw generate_attribute_input(attr["attribute"])
+= render partial: 'form_content', locals: {id: 'metadata_by_ontology', acronym: @ontology.acronym, submissionId: @submission.submissionId}
%div.form-group.row
%div.col-12.text-center
- %label.col-form-label.font-italic.asterik * Fields marked with an asterisk are required.
+ %label.col-form-label.font-italic.asterik * Fields marked with an asterisk are required.
%div.form-group.row
%div.col-6
= submit_tag button_text, class: "btn btn-primary"
%div.col-6.text-right
= link_to "Cancel", :back, class: "btn btn-warning"
-
-:javascript
-
- $(document).ready(function() {
-
- /**
- * For Multiple select
- */
- "use strict";
- jQuery("#naturalLanguageSelect").chosen({
- search_contains: true
- });
- jQuery(".selectOntology").chosen({
- width: '100%',
- search_contains: true
- });
- $('.tooltip_link[title][title!=""]').tooltipster({
- interactive: true,
- position: "right",
- contentAsHTML: true,
- animation: 'fade',
- delay: 200,
- theme: 'tooltipster-shadow',
- trigger: 'hover'
- });
- })
-
- /**
- * To add a new input when btn clicked. Using the given attribute to get elements id
- */
- function addInput(attr, inputType)
- {
- var container = document.createElement("div");
- container.innerHTML = '
';
- document.getElementById(attr + 'Div').appendChild(container);
- }
-
- /**
- * To add a new value to selectDropdown when btn clicked
- */
- function addValueToSelect(attr)
- {
- if(jQuery('#add_' + attr).val()) {
- var newOption = jQuery('#add_' + attr).val();
- var selectedOptions = jQuery('#select_' + attr).val();
- jQuery('#select_' + attr).append(jQuery('