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
21 changes: 21 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,27 @@ en:
search_prompt: Search in %{portal_name} ...
submit_feedback: Send feedback
support: Support
cite_us: Cite Us
footer:
products: Products
ontoportal: OntoPortal
release_notes: Release Notes
api: API
sparql: SPARQL
support: support
contact_us: Contact Us
wiki: Wiki
documentation: Documentation
agreements: Legal
terms: Terms and Conditions
privacy_policy: Privacy Policy
cite_us: Cite Us
acknowledgments: Acknowledgments
about: About
about_us: About Us
projects: D2KAB
team: Team


login:
enter_email: Enter your username
Expand Down
21 changes: 21 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,27 @@ fr:
search_prompt: Rechercher dans %{portail_name} ...
submit_feedback: Envoyer un commentaire
support: Assistance
cite_us: Citez-nous
footer:
products: Produits
ontoportal: OntoPortal
release_notes: Notes de version
api: API
sparql: SPARQL
support: Assistance
contact_us: Contactez nous
wiki: Wiki
documentation: Documentation
agreements: Juridique
terms: Termes et Conditions
privacy_policy: Politique de confidentialité
cite_us: Citez-nous
acknowledgments: Remerciements
about: À propos
about_us: À propos de nous
projects: D2KAB
team: Équipe


login:
enter_email: Saisissez votre nom d'utilisateur
Expand Down
Loading