Sha256: cb9879ee2755f4a9b5a4d515aa2128e39e8c1ad90866a06a87266dc14c42146e

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 KB

Contents

<%= semantic_form_for @asset do |f| %>
  <%= f.inputs do %>
    <%= f.input :name, :label => 'Name (Alernative text)' %>
    <div class="file input required form-group" id="asset_file_input">
      <%= f.label 'File' %>
      <span class="form-wrapper">
        <%= f.attachment_field :file %>
      </span>
    </div>
    <% if @asset.file %>
    <div class="form-group">
      <%- full_url = attachment_url(@asset, :file, host: request.url) -%>
      <p><%= link_to "Copy URL", full_url, class: "btn btn-primary btn-xs copy-to-clipboard", data: { 'clipboard-text' => full_url } %></p>
      <p>
        <%= link_to attachment_url(@asset, :file) do %>
          <% if @asset.file_type == :image %>
            <%= attachment_image_tag(@asset, :file, :fit, 300, 300, alt: '') %>
          <% elsif @asset.file_type == :direct_image %>
            <%= attachment_image_tag(@asset, :file, width: 300, alt: '') %>
          <% else %>
            <%= image_tag file_type_icon(@asset), alt: '' %>
          <% end %>
        <% end %>
      </p>
    </div>
    <% end %>
  <% end %>
  <%= f.actions :submit %>
<% end %>

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
smithycms-0.8.1 app/views/smithy/assets/_form.html.erb
smithycms-0.7.3 app/views/smithy/assets/_form.html.erb
smithycms-0.7.2 app/views/smithy/assets/_form.html.erb
smithycms-0.7.1 app/views/smithy/assets/_form.html.erb
smithycms-0.7.0 app/views/smithy/assets/_form.html.erb
smithycms-0.6.10 app/views/smithy/assets/_form.html.erb
smithycms-0.6.9 app/views/smithy/assets/_form.html.erb
smithycms-0.6.7 app/views/smithy/assets/_form.html.erb
smithycms-0.6.6 app/views/smithy/assets/_form.html.erb
smithycms-0.6.5 app/views/smithy/assets/_form.html.erb
smithycms-0.6.4 app/views/smithy/assets/_form.html.erb
smithycms-0.6.3 app/views/smithy/assets/_form.html.erb
smithycms-0.6.2 app/views/smithy/assets/_form.html.erb
smithycms-0.6.1 app/views/smithy/assets/_form.html.erb
smithycms-0.6.0 app/views/smithy/assets/_form.html.erb