Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: changes in search, footer, summary and browse pages #398

Merged
1 change: 1 addition & 0 deletions app/assets/javascripts/bp_search.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ jQuery(document).ready(function() {
jQuery("#search_results a.additional_ont_results_link").live("click", showAdditionalOntResults);
jQuery("#search_results a.additional_cls_results_link").live("click", showAdditionalClsResults);

jQuery("#search_options").hide();
jQuery("#advanced_options").on('click', toggleAdvancedSearchOptions);

// Events to run whenever search results are updated (mainly counts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
- if ontology[:creationDate]
%span.mr-1
= render ChipButtonComponent.new(type: "clickable") do
%span.mr-1 Uploaded
%span.mr-1 Submitted
%span.browse-uploaded-date{data:{controller: 'timeago', 'timeago-datetime-value': ontology[:creationDate], 'timeago-add-suffix-value': 'true'}}
- if ontology[:contact]
%span.mx-1 by
Expand All @@ -51,7 +51,7 @@

- if ontology[:released]
- date = render DateTimeFieldComponent.new(value: ontology[:released])
%span{data:{controller:'tooltip'}, title: "Release date #{date}"}
%span{data:{controller:'tooltip'}, title: "Creation date #{date}"}
= render ChipButtonComponent.new(type: "clickable") do
= DateTime.parse(date).year rescue date

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def summary
@config_properties = properties_hash_values(category_attributes["object description properties"])
@methodology_properties = properties_hash_values(category_attributes["methodology"])
@agents_properties = properties_hash_values(category_attributes["persons and organizations"])
@dates_properties = properties_hash_values(category_attributes["dates"], custom_labels: {released: "Initially created On"})
@dates_properties = properties_hash_values(category_attributes["dates"])
@links_properties = properties_hash_values(category_attributes["links"])
@content_properties = properties_hash_values(category_attributes["content"])
@community_properties = properties_hash_values(category_attributes["community"] + [:notes])
Expand Down
10 changes: 8 additions & 2 deletions app/helpers/ontologies_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ def agent?(sub_metadata, attr)
end

def display_contact(contacts)
contacts.map { |c| "#{c.name.humanize} at #{c.email}" if c.member?(:name) && c.member?(:email) }&.join(", ")
end
contacts.map do |c|
next unless c.member?(:name) && c.member?(:email)

formatted_name = c[:name].titleize
formatted_email = c[:email].downcase
"<span class='date_creation_text'>#{formatted_name}</span> (#{formatted_email})"
end&.join(" and ")
end

def count_links(ont_acronym, page_name = 'summary', count = 0)
ont_url = "/ontologies/#{ont_acronym}"
Expand Down
9 changes: 3 additions & 6 deletions app/views/layouts/_topnav.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@
- s.item do
= link_to(t('layout.header.submit_feedback'), feedback_path(location: encode_param(request.url)), id: "submitFeedbackMenuItem", class: "pop_window")
- d.with_section do |s|
- s.header do
= t('layout.header.documentation')
- s.item do
= link_to(t('layout.header.help'), "#{$WIKI_HELP_PAGE}", target: "_blank")
= link_to(t('layout.header.documentation'), $FOOTER_LINKS[:sections][:support][:documentation] , target: "_blank")
- s.item do
= link_to(t('layout.header.release_notes'), "#{$RELEASE_NOTES}", target: "_blank")
= link_to(t('layout.header.cite_us'), $FOOTER_LINKS[:sections][:about][:cite_us], target: "_blank")
- s.item do
= link_to(t('layout.header.publications'), $PUBLICATIONS_URL, target: "_blank")

= link_to(t('layout.header.release_notes'), $FOOTER_LINKS[:sections][:products][:release_notes], target: "_blank")

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
Initial release occurred on
%span.date_creation_text= l(Date.parse(@submission_latest.released), format: :monthfull_day_year) + '.'
- if @submission_latest&.contact
For additional information, reach out
%span.date_creation_text
#{display_contact(@submission_latest.contact)}.
For additional information, contact
%span
#{display_contact(@submission_latest.contact).html_safe}.

- unless Array(@submission_latest&.naturalLanguage).empty?
- l.row do
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_submissions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- header.th do
= attr_label("modificationDate", "Modified", show_tooltip: false)
- header.th do
= attr_label("creationDate", "Uploaded", show_tooltip: false)
= attr_label("creationDate", "Submitted", show_tooltip: false)
- unless @ont_restricted
- header.th do
%div.align-middle
Expand Down
2 changes: 2 additions & 0 deletions config/bioportal_config_env.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ $FOOTER_LINKS = {
}
}

$NOT_DOWNLOADABLE = {}

$UI_THEME = ENV['UI_THEME'] || 'ontoportal'

$HOSTNAME = ENV['API_URL']
Expand Down
Loading