Sha256: d4fc9ebcae54bb16e165f8c85bc5db1a6f1cfaef83579fdb1ebf98350fb2fe07

Contents?: true

Size: 1.04 KB

Versions: 55

Compression:

Stored size: 1.04 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 content_tag(:div,
                           nil,
                           id: "snippets-modal",
                           class: "reveal-modal",
                           data: {
                             reveal: "data-reveal",
                             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

55 entries across 55 versions & 1 rubygems

Version Path
renalware-core-2.0.77 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.76 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.75 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.74 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.73 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.72 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.71 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.70 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.69 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.68 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.67 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.64 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.63 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.62 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.61 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.60 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.58 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.57 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.56 app/helpers/renalware/snippets_helper.rb
renalware-core-2.0.55 app/helpers/renalware/snippets_helper.rb