Sha256: a22269951f537b3773519e3f2237f2eb300225149c9c349031acc51a8b2ffb30

Contents?: true

Size: 1.11 KB

Versions: 18

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Renalware
  module SnippetsHelper
    # Adds to the page:
    # - the snippets modal dialog container (which will be ajax-populated)
    # - the link to invoke the snippets dialog (loading content via ajax)
    # Note that the data-target on the modal container determines which textarea is
    # populated with when a snippet is selected.
    def snippets_modal_and_link_to_open_it(target_input_for_seleted_snippet:)
      capture do
        concat tag.div(nil,
                       id: "snippets-modal",
                       class: "reveal-modal",
                       data: {
                         reveal: "data-reveal",
                         controller: "snippets",
                         "snippets-target-input" => target_input_for_seleted_snippet,
                         target: target_input_for_seleted_snippet
                       })
        concat link_to t("snippets.insert"),
                       snippets_path(format: :js),
                       class: "button alternative right insert-snippet-button",
                       remote: true
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/helpers/renalware/snippets_helper.rb
renalware-core-2.1.0 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.167 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.166 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.165 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.164 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.163 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.162 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.161 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.160 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.159 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.158 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.157 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.156 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.155 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.153 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.152 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.151 app/helpers/renalware/snippets_helper.rb