Sha256: 82a6dd019727b973210f7c14c671db5fe8df30ff587f4b8b32de04491bee6c94

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

<div class="resource_info">
  <div class="value">
    <label>
      <%= render_icon @attachment.icon_css_class %>
    </label>
    <p><%= @attachment.file_name %></p>
  </div>
  <div class="value with-icon">
    <label><%= Alchemy::Attachment.human_attribute_name(:url) %></label>
    <p><%= @attachment.url %></p>
    <a data-clipboard-text="<%= @attachment.url %>" class="icon_button--right">
      <%= render_icon(:clipboard) %>
    </a>
  </div>
  <div class="value with-icon">
    <label><%= Alchemy::Attachment.human_attribute_name(:download_url) %></label>
    <p><%= @attachment.url(download: true) %></p>
    <a data-clipboard-text="<%= @attachment.url(download: true) %>" class="icon_button--right">
      <%= render_icon(:clipboard) %>
    </a>
  </div>
</div>

<% case @attachment.file_mime_type %>
<% when *Alchemy::Filetypes::IMAGE_FILE_TYPES %>
<div class="attachment_preview_container image-preview">
  <%= image_tag(@attachment.url, class: "full_width") %>
</div>
<% when *Alchemy::Filetypes::AUDIO_FILE_TYPES %>
<div class="attachment_preview_container player-preview">
  <%= audio_tag(@attachment.url, preload: "none", controls: true, class: "full_width") %>
</div>
<% when *Alchemy::Filetypes::VIDEO_FILE_TYPES %>
<div class="attachment_preview_container player-preview">
  <%= video_tag(@attachment.url, preload: "metadata", controls: true, class: "full_width") %>
</div>
<% when "application/pdf" %>
<iframe src="<%= @attachment.url %>" frameborder=0 class="full-iframe">
  Your browser does not support frames.
</iframe>
<% end %>

<script type="text/javascript">
  $(function() {
    var clipboard = new Clipboard('.icon_button--right');
    clipboard.on('success', function(e) {
      Alchemy.growl('<%= Alchemy.t("Copied to clipboard") %>');
      e.clearSelection();
    });
    Alchemy.currentDialog().dialog.on('DialogClose.Alchemy', function() {
      clipboard.destroy();
    });
  });
</script>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alchemy_cms-7.1.0.pre.b1 app/views/alchemy/admin/attachments/show.html.erb