Skip to content

Commit

Permalink
add recommender cite url
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilelkihal committed Jan 15, 2024
1 parent 48a04df commit 7a7b6c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/components/buttons/regular_button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Buttons::RegularButtonComponent < ViewComponent::Base
renders_one :icon_left
renders_one :icon_right

def initialize(id: , value:, variant: "primary", color: "normal", href: "", size: "normal", state: "animate", type: 'button')
def initialize(id: , value:, variant: "primary", color: "normal", href: "", size: "normal", state: "animate", type: 'button', target: nil)
@id = id
@value = value
@variant = variant
Expand All @@ -11,6 +11,7 @@ def initialize(id: , value:, variant: "primary", color: "normal", href: "", size
@size = size
@state = state
@type = type
@target = target
end

def button_label
Expand All @@ -28,7 +29,7 @@ def button_elem
on_click_event = load_animation? ? "displayAnimation(this, '#{@id}-loading-animation')" : ''

if link?
link_to(@href, class: class_style, onclick: on_click_event, id: @id) do
link_to(@href, class: class_style, onclick: on_click_event, id: @id, target: @target) do
button_label
end
else
Expand Down
2 changes: 1 addition & 1 deletion app/views/recommender/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
= render Input::RadioChipComponent.new(label: result[:annotations].length.to_s+' annotations', name: 'highlighted_recommendation', value: result[:annotations], checked: result[:highlighted])

.cite-us-button
= render Buttons::RegularButtonComponent.new(id:'regular-button', value: "Cite", variant: "secondary", href: "#", size: "slim") do |btn|
= render Buttons::RegularButtonComponent.new(id:'regular-button', value: "Cite", variant: "secondary", href: "https://doi.org/10.1186/s13326-017-0128-y", size: "slim", target: '_blank', state: "regular") do |btn|
- btn.icon_left do
= inline_svg_tag "icons/cite.svg"

Expand Down

0 comments on commit 7a7b6c2

Please sign in to comment.