Sha256: 07d08f4238ea71ab65e06bfbec4881394a015e010ff2dc7dc29642f3e98b48ea

Contents?: true

Size: 1.26 KB

Versions: 112

Compression:

Stored size: 1.26 KB

Contents

<p>
  Bootstrap modals are ready to use by rendering the shared partial and creating
  a trigger.
</p>

<p>The partial requires three locals:</p>

<ul>
  <li>
    <code>target</code>: this should match the <code>data-target</code> in your
    trigger
  </li>
  <li>
    <code>title</code>: this will appear in the modal's header
  </li>
  <li>
    <code>content</code>: this will appear in the modal's body. This content can
    be whatever you like – even another partial.
  </li>
</ul>

<%- snippet = capture do %>
  <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#your-target">
    Launch demo modal
  </button>

  &lt;%= render(
    "spree/admin/shared/modal",
    target: "your-target",
    title: "Your Title",
    content: "The modal's content, could be another partial"
  ) %&gt;
<%- end %>

<div class="style-guide-code half">
  <pre><code class="language-html"><%= escape_once snippet %></code></pre>
</div>

<div class="style-guide-result half">
  <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#your-target">
    Demo Modal
  </button>

  <%= render(
    "spree/admin/shared/modal",
    target: "your-target",
    title: "Your Title",
    content: "The modal's content, could be another partial"
  ) %>
</div>

Version data entries

112 entries across 112 versions & 2 rubygems

Version Path
solidus_backend-3.3.4 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.9 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.8 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.3.3 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.7 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.3.2 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.3.1 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.6 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.1.9 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.3.0 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.5 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.4 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.3 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.1.8 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.0.8 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.2 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.1 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.0 app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.2.0.alpha app/views/spree/admin/style_guide/topics/components/_modals.html.erb
solidus_backend-3.0.7 app/views/spree/admin/style_guide/topics/components/_modals.html.erb