Skip to content

Commit 79baed5

Browse files
committed
feat: add "Edit With" button on ontology page UI only
1 parent fbfe45c commit 79baed5

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

app/helpers/ontologies_helper.rb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,18 +680,29 @@ def count_subscriptions(ontology_id)
680680
end
681681

682682
def new_submission_button
683-
return unless @ontology.admin?(session[:user])
683+
684684
render RoundedButtonComponent.new(link: new_ontology_submission_path(@ontology.acronym), icon: 'icons/plus.svg',
685685
size: 'medium', title: t('ontologies.add_new_submission'))
686686
end
687687

688688
def ontology_edit_button
689-
return unless @ontology.admin?(session[:user])
690689
render RoundedButtonComponent.new(link: edit_ontology_submission_path(ontology_id: @ontology.acronym, id: @submission_latest.id.split('/').last), icon: 'edit.svg',
691690
size: 'medium',
692691
title: t('ontologies.edit_metadata'))
693692
end
694693

694+
# no logic yet
695+
def edit_with_button
696+
content_tag(:div, style: 'margin-left: 10px;', data: { controller: 'tooltip' }, title: t('application.edit_with_tooltip')) do
697+
render PillButtonComponent.new do
698+
content_tag(:a, class: 'd-flex align-items-center', href: 'javascript:void(0);') do
699+
(inline_svg_tag('edit.svg') +
700+
content_tag(:span, t('application.edit_with'), class: 'ml-1')).html_safe
701+
end
702+
end
703+
end
704+
end
705+
695706
def upload_ontology_button
696707
return if read_only_enabled?
697708

app/views/layouts/ontology_viewer/_header.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@
4545
= ontology_edit_button
4646
%span
4747
= submission_json_button
48+
= edit_with_button
4849
= subscribe_button(@ontology.id)

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ en:
342342
search_for_class: Please search for a class using the Jump To field above
343343
try_again: There was an error, please try again
344344
watching: Watch
345+
edit_with: Edit With
346+
edit_with_tooltip: Edit content
345347
change_requests:
346348
change_request_success_message: Your change request was successfully submitted!
347349
View the %{url} on GitHub.

config/locales/fr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ fr:
351351
search_for_class: Veuillez rechercher une classe à l'aide du champ Jump To ci-dessus
352352
try_again: Une erreur s'est produite, veuillez réessayer
353353
watching: Surveiller
354+
edit_with: Éditer avec
355+
edit_with_tooltip: Éditer le contenu
354356
change_requests:
355357
change_request_success_message: Votre demande de modification a été soumise! Voir
356358
le %{url} sur GitHub.

0 commit comments

Comments
 (0)