diff --git a/app/assets/stylesheets/components/switch.scss b/app/assets/stylesheets/components/switch.scss index 5a70e0fe9..b5a91db4d 100644 --- a/app/assets/stylesheets/components/switch.scss +++ b/app/assets/stylesheets/components/switch.scss @@ -5,7 +5,7 @@ justify-content: space-between; margin-bottom: 20px; } -.switch-filter p{ +.switch-filter > p, .switch-filter > div{ font-size: 16px; color: #666666; margin-bottom: 0; diff --git a/app/components/switch_input_component.rb b/app/components/switch_input_component.rb index 3b7f67781..865ee150b 100644 --- a/app/components/switch_input_component.rb +++ b/app/components/switch_input_component.rb @@ -3,7 +3,7 @@ class SwitchInputComponent < ViewComponent::Base - def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch: false) + def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch: false, style: nil) super @id = id @name = name @@ -11,6 +11,7 @@ def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch @value = value.nil? || value.empty? ? @name : value @checked = checked @boolean_switch = boolean_switch + @style = style end def boolean_switch_action diff --git a/app/components/switch_input_component/switch_input_component.html.haml b/app/components/switch_input_component/switch_input_component.html.haml index 4fe4ccbac..5989491a6 100644 --- a/app/components/switch_input_component/switch_input_component.html.haml +++ b/app/components/switch_input_component/switch_input_component.html.haml @@ -2,8 +2,7 @@ - if @boolean_switch = hidden_field_tag @name, @value - if content || !@label.empty? - %p - = content || @label + = content_tag(:div, content || @label, style: @style) %label.switch{for: check_box_id} = check_box_tag check_box_name, @value, @checked, class: '', id: check_box_id, onChange: "#{boolean_switch_action}" %span.slider \ No newline at end of file diff --git a/app/helpers/inputs_helper.rb b/app/helpers/inputs_helper.rb index a2e81eb4f..341b15178 100644 --- a/app/helpers/inputs_helper.rb +++ b/app/helpers/inputs_helper.rb @@ -18,8 +18,8 @@ def check_input(id:, name:, value:, label: '', checked: false) render ChipsComponent.new(name: name, id: id, label: label, value: value, checked: checked) end - def switch_input(id:, name:, label:, checked: false, value: '', boolean_switch: false) - render SwitchInputComponent.new(id: id, name: name, label: label, checked: checked, value: value, boolean_switch: boolean_switch) + def switch_input(id:, name:, label:, checked: false, value: '', boolean_switch: false, style: nil) + render SwitchInputComponent.new(id: id, name: name, label: label, checked: checked, value: value, boolean_switch: boolean_switch, style: style) end def url_input(name:, value:, label: nil, help: nil) diff --git a/app/helpers/submission_inputs_helper.rb b/app/helpers/submission_inputs_helper.rb index f1c446164..5e5326e78 100644 --- a/app/helpers/submission_inputs_helper.rb +++ b/app/helpers/submission_inputs_helper.rb @@ -57,6 +57,8 @@ def attribute_input(attr_key, long_text: false, label: nil, show_tooltip: true, elsif enforce_values?(attr) if attr.type?('list') generate_select_input(attr, multiple: true) + elsif attr.type?('boolean') + generate_boolean_input(attr) else generate_select_input(attr) end @@ -141,7 +143,7 @@ def ontology_visibility_input(ontology = @ontology) select_input(label: "Visibility", name: "ontology[viewingRestriction]", values: %w[public private], selected: ontology.viewingRestriction ) end content_tag(:div, class: 'upload-ontology-input-field-container') do - select_input(label: "Add or remove accounts that are allowed to view classes in this ontology using the account name", name: "ontology[acl]", values: @user_select_list, selected: ontology.acl, multiple: true) + select_input(label: "Add or remove accounts that are allowed to see this ontology in #{portal_name}.", name: "ontology[acl]", values: @user_select_list, selected: ontology.acl, multiple: true) end end end @@ -150,7 +152,7 @@ def ontology_view_of_input(ontology = @ontology) render Layout::RevealComponent.new(init_show: ontology.view?) do |c| c.button do content_tag(:span, class: 'd-flex') do - switch_input(id: 'ontology_isView', name: 'ontology[isView]', label: 'Is this ontology a view of another ontology?', checked: ontology.view?) + switch_input(id: 'ontology_isView', name: 'ontology[isView]', label: 'Is this ontology a view of another ontology?', checked: ontology.view?, style: 'font-size: 14px;') end end @@ -167,7 +169,7 @@ def contact_input(label: '', name: 'Contact', show_help: true) render NestedFormInputsComponent.new(object_name: 'contact', default_empty_row: true) do |c| c.header do - content_tag(:div, "#{name} name", class: 'w-50') + content_tag(:div, "#{name} email", class: 'w-50') + content_tag(:div, "#{name} Name", class: 'w-50') + content_tag(:div, "#{name} Email", class: 'w-50') end c.template do @@ -312,7 +314,7 @@ def generate_boolean_input(attr) value = value.to_s unless value.nil? name = attr.name content_tag(:div, class: 'd-flex') do - switch_input(id: name, name: name, label: attr_header_label(attr), checked: value.eql?('true'), value: value, boolean_switch: true) + switch_input(id: name, name: name, label: attr_header_label(attr), checked: value.eql?('true'), value: value, boolean_switch: true, style: 'font-size: 14px;') end end diff --git a/app/views/ontologies/_submission_location_form.html.haml b/app/views/ontologies/_submission_location_form.html.haml index f7ab6b8a3..a438b8098 100644 --- a/app/views/ontologies/_submission_location_form.html.haml +++ b/app/views/ontologies/_submission_location_form.html.haml @@ -4,7 +4,7 @@ %label.title{for: "metadata_only"} Metadata only (No file) .upload-ontology-desc.mb-2 - Allow users to view your ontology metadata, but not its content. + Allow users to view the metadata of your ontology (Summary) only. #metadata-only-form .location-choice diff --git a/app/views/submissions/_submission_format_form.html.haml b/app/views/submissions/_submission_format_form.html.haml index e9d199888..7c1a85a40 100644 --- a/app/views/submissions/_submission_format_form.html.haml +++ b/app/views/submissions/_submission_format_form.html.haml @@ -19,7 +19,7 @@ = attribute_form_group_container('hasOntologyLanguage') do %div{onchange: 'ontologyFormatChange(event)'} - = select_input(label: "Format", name: "submission[hasOntologyLanguage]", values: ["OBO", "OWL", "SKOS", "UMLS"], selected: @submission.hasOntologyLanguage) + = select_input(label: "Representation language", name: "submission[hasOntologyLanguage]", values: ["OBO", "OWL", "SKOS", "UMLS"], selected: @submission.hasOntologyLanguage) %div#skos_options.upload-ontology-desc{style: "display:#{skos? ? 'block': 'none'}"} 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 #{link_to 'detailed explanation', 'https://www.bioontology.org/wiki/index.php/SKOSSupport', target: "_blank" }