Sha256: 0c876f4212fe194c573cfca208d71fc213bd10c76262ae7a085f16581dd5be8f

Contents?: true

Size: 1.93 KB

Versions: 4

Compression:

Stored size: 1.93 KB

Contents

<h1><%= t('.listing_uploads') %></h1>

<table class="index">
	<tr>
	  <th><%= t("thumbnail") %></th>
	  <th><%= sort_link @search, :attachment_file_name, t("upload.file_name") %></th>
	  <th><%= sort_link @search, :description, t("description") %></th>
	  <th><%= sort_link @search, :attachment_file_size, t("upload.size") %></th>
	  <th><%= t("action") %></th>
	</tr>
 
  <% @uploads.each do |upload| %>
    <tr id="<%= dom_id(upload) %>">
      <td class="thumbnail">
        <% if upload.image_content? %>
          <%= link_to image_tag(upload.attachment.url(:mini)), upload.attachment.url(:large) %>
        <% end %>
      </td>
      <td><%= link_to upload.attachment_file_name, upload.attachment.url(:original) %></td>
      <td><%= upload.alt %></td>
      <td><%= upload.attachment_file_size.to_i / 1024 %> kb</td>
      <td class="actions">
        <%= link_to_with_icon('edit', t("edit"), edit_admin_upload_url(upload)) %>
        &nbsp;
        <%= link_to_delete upload, {:url => admin_upload_url(upload) }%>
      </td>
    </tr>
  <% end %>
 
</table>

<%= paginate @uploads %>


<% content_for :sidebar do %>

<div class="box">
  <h3><%= t(:search) %></h3>
  <%= search_form_for [ :admin, @search ] do |f| %>
    <p>
      <%= f.label :alt_cont, t("description") %><br />
      <%= f.text_field :alt_cont, :size => 25 %>
    </p>
    <p><%= button t("search") %></p>
  <% end %>
</div>
<% end %>

<div id="images"></div>
<br/>
<p>
  <%= link_to icon('add') + ' ' + t(".new_upload"), new_admin_upload_url, :id => "new_image_link" %>
</p>

<% content_for :head do %>
  <script type="text/javascript">
    jQuery(document).ready(function(){  
      
      jQuery('#new_image_link').click(function(event) { 
        event.preventDefault();
        jQuery(this).hide();
        jQuery.ajax({type: 'GET', url: this.href, data: ({authenticity_token: AUTH_TOKEN}), success: function(r){ jQuery('#images').html(r);} });
      });
      
    });
  </script>
<% end %>

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
spree_essentials_jn-0.6.1 app/views/spree/admin/uploads/index.html.erb
spree_essentials_jn-0.6.0 app/views/spree/admin/uploads/index.html.erb
spree_essentials-0.5.0 app/views/spree/admin/uploads/index.html.erb
spree_essentials-0.5.0.rc1 app/views/spree/admin/uploads/index.html.erb