forked from bofh/fetsite
attachments
This commit is contained in:
@@ -21,22 +21,18 @@ end
|
||||
def store_dir
|
||||
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
def cover
|
||||
def get_cover
|
||||
manipulate! do |frame, index|
|
||||
index== 0 ? frame.convert(:jpg) : nil
|
||||
|
||||
frame if index.zero?
|
||||
end
|
||||
end
|
||||
version :thumb ,:if=>:image? do
|
||||
process :resize_to_fill => [64, 64]
|
||||
|
||||
end
|
||||
|
||||
|
||||
version :cover , :if=>:pdf? do
|
||||
process :cover
|
||||
process :resize_to_fit => [64,64]
|
||||
process :get_cover
|
||||
process :convert => :jpg
|
||||
process :resize_to_fit => [64,64]
|
||||
def full_filename(for_file)
|
||||
super.chomp(File.extname(super)) + '.jpg'
|
||||
end
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
</li>
|
||||
<li><%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
|
||||
</li>
|
||||
<li><a href="#" onclick="$('#attachmentdialog_thema_<%= small.id %>').dialog('open')">Attachments</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div></div>
|
||||
</span>
|
||||
@@ -92,3 +94,13 @@
|
||||
Error
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="attachmentdialog_thema_<%= small.id %>">
|
||||
<%= render_attachments_for(small) %>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
$( "#attachmentdialog_thema_<%= small.id %>" ).dialog({autoOpen:false});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user