Sha256: a15847e7815a4325be01f487acae54232acebe3904222be2a3117bed39506bf5

Contents?: true

Size: 718 Bytes

Versions: 198

Compression:

Stored size: 718 Bytes

Contents

<%
url = nil
name = nil
if block.media
  url = block.media.file_url
  name = block.media.file_file_name
  name = block.media.image_file_name if name.nil?
elsif block.file
  url = block.file.url
  name = block.file_file_name
end

if editing
  if url.nil? || url.starts_with?('http://placehold.it') || url.include?('missing')  
    %><div id='block_<%= block.id %>'><p>Please upload a file.</p></div><%
  else
    %><div id='block_<%= block.id %>'><p><a href="/admin/<%= block.page_id ? "pages/#{block.page_id}" : "posts/#{block.post_id}" %>/blocks/<%= block.id %>/edit"><%= name %></a></p></div><%
  end
elsif url
  %><div id='block_<%= block.id %>'><p><a href="<%= raw file.url %>">Download File</a></p></div><%
end
%>

Version data entries

198 entries across 198 versions & 1 rubygems

Version Path
caboose-cms-0.8.5 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.8.4 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.8.3 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.8.2 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.8.1 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.85 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.84 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.83 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.82 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.81 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.80 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.79 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.78 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.77 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.76 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.75 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.74 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.73 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.72 app/views/caboose/blocks/_file.html.erb
caboose-cms-0.7.71 app/views/caboose/blocks/_file.html.erb