Sha256: ff640e92e7fbebffdb5fc533d9471ed5105e0ce56b7a1e7eb10bc1469fccd039

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

<%= pb_content_tag(:div, **combined_html_options) do %>
  <%
    # convert deprecated prop values
    size = object.size
    size = "sm" if object.size == "xs"
    size = "md" if object.size == "lg"
  %>

  <% if object.unstyled %>
    <% if object.show_icon %>
      <span>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
      </span>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <span><%= object.format_time_string %></span>
      <% if object.show_timezone %>
        <span><%= object.pb_date_time.to_timezone.upcase %></span>
      <% end %>
    <% end %>

  <% elsif size == "md" %>
    <% if object.show_icon %>
      <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
      <% end %>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <%= pb_rails("body", props: { tag: "span", text: object.format_time_string, classname: "pb_time" }) %>
      <% if object.show_timezone %>
        <%= pb_rails("body", props: { color: "light", tag: "span", text: object.pb_date_time.to_timezone.upcase }) %>
      <% end %>
    <% end %>

  <% else %>
    <% if object.show_icon %>
      <%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
        <%= pb_rails("icon", props: { icon: "clock", fixed_width: true, size: "sm" }) %>
      <% end %>
    <% end %>

    <%= content_tag(:time, datetime: object.pb_date_time.to_iso) do %>
      <%= pb_rails("caption", props: { color: "light", tag: "span", text: object.format_time_string }) do %>
        <%= object.format_time_string %>
        <% if object.show_timezone %>
          <span class="pb_time_timezone">
            <%= object.pb_date_time.to_timezone.upcase %>
          </span>
        <% end %>
      <% end %>
    <% end %>
  <% end %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
playbook_ui-13.24.0.pre.alpha.play1305drycontenttag2689 app/pb_kits/playbook/pb_time/time.html.erb