Sha256: c84894e800d7b9e4885bc28eb82d72468102f2af2bc33eee998def8e48253c5c
Contents?: true
Size: 1.95 KB
Versions: 1
Compression:
Stored size: 1.95 KB
Contents
<div class="file-item" id="upload_<%=tab.association.name%>_item_<%=file.id%>" data-<%=tab.association.name%>-id="<%=file.id%>"> <div class="window"> <% if file.send(tab.uploader).to_s =~ /(jpg|jpeg|png|gif)$/i %> <% url = file.send(tab.uploader).normalized.blank? ? file.send(tab.uploader).url : file.send(tab.uploader).normalized.url %> <%#= link_to image_tag(url, :style=>"width:300px; height 160px;"), url %> <%= image_tag url %> <% else %> <%#= link_to file.send(tab.uploader).url, file.send(tab.uploader).url %> <%= file.send(tab.uploader).url %> <% end %> <div class="links"> <%= link_to t("lolita.tabs.images.edit"),send(:"edit_lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:remote=>true, :class => "edit_link" %> <%= link_to t("lolita.tabs.images.delete"),send(:"lolita_#{tab.dbi.klass.model_name.singular}_upload_path", "#{tab.dbi.klass.model_name.singular}_id" => (resource.nil? || resource.new_record?) ? 0 : resource.id, :association => tab.association.name, :id=>file.id),:method=>:delete,:remote=>true,:confirm=>"Are you sure?", :class => "delete_link" %> </div> </div> <p><%= File.basename(file.send(tab.uploader).url) %></p> </div> <script> LolitaFileUploadGallery.get().add('<%= file.send(tab.uploader).preview ? file.send(tab.uploader).preview.url : '' %>', '<%= file.send(tab.uploader).url %>') <% if tab.association_type == :many ids = "#{resource_name}[#{tab.association.name.to_s.singularize}_ids][]" else ids = "#{resource_name}[#{tab.association.name.to_s.singularize}_new]" end %> <% if resource && resource.new_record? && resource.errors.any? %> $(".tabs form:first").append('<input type="hidden" class="<%=tab.association.name%>-ids" name="<%= ids %>" value="<%= file.id %>" />') <% end %> </script>
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lolita-file-upload-0.7.2 | app/views/components/lolita/configuration/tab/files/_image.html.erb |