Class: Geoblacklight::WebServicesLinkComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/geoblacklight/web_services_link_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(document:) ⇒ WebServicesLinkComponent

Returns a new instance of WebServicesLinkComponent.



5
6
7
8
# File 'app/components/geoblacklight/web_services_link_component.rb', line 5

def initialize(document:)
  @document = document
  super()
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'app/components/geoblacklight/web_services_link_component.rb', line 10

def render?
  (Settings.WEBSERVICES_SHOWN & @document.references.refs.map(&:type).map(&:to_s)).any?
end


14
15
16
17
18
19
20
# File 'app/components/geoblacklight/web_services_link_component.rb', line 14

def web_services_link
  link_to "Web services",
    helpers.web_services_solr_document_path(id: @document.id),
    class: ["btn", "btn-primary", "sidebar-btn"],
    id: "web-services-button",
    data: {blacklight_modal: "trigger"}
end