Sha256: c672c085484d2fefa218f9f67595dd81f392b2b2fb1bfd654e6f321db85a30ed

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

<%
  # headmin/card
  #
  # ==== Options
  # * <tt>title</tt> - Title for card
  # * <tt>description</tt> - Description for card
  # * <tt>padded</tt> - Set to true if you want to render the block content inside the card-body element
  #
  # ==== Examples
  #   Basic version.
  #   <%= render 'headmin/card' do %#>
  #      Your content
  #   <% end %#>
  #
  #   Title and description
  #   <%= render 'headmin/card', title: 'Title', description: 'Description' do %#>
  #      Your content
  #   <% end %#>

  title = local_assigns.has_key?(:title) ? title : nil
  description = local_assigns.has_key?(:description) ? description : nil
  padded = local_assigns.has_key?(:padded) ? padded : true
%>

<div class="card mb-3 shadow-sm">

  <% if padded || title || description %>
    <div class="card-body">
      <% if title.present? %>
        <h5 class="card-title"><%= title %></h5>
      <% end %>

      <% if description.present? %>
        <p class="card-text text-secondary"><%= description %></p>
      <% end %>

      <!-- Render inside body-->
      <% if padded %>
        <%= yield if block_given? %>
      <% end %>
    </div>
  <% end %>

  <!-- Render outside body-->
  <% unless padded %>
    <%= yield if block_given? %>
  <% end %>
</div>

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
headmin-0.2.7 app/views/headmin/_card.html.erb
headmin-0.2.6 app/views/headmin/_card.html.erb
headmin-0.2.5 app/views/headmin/_card.html.erb
headmin-0.2.4 app/views/headmin/_card.html.erb
headmin-0.2.3 app/views/headmin/_card.html.erb
headmin-0.2.2 app/views/headmin/_card.html.erb
headmin-0.2.1 app/views/headmin/_card.html.erb
headmin-0.2.0 app/views/headmin/_card.html.erb