应用下载功能实现
This commit is contained in:
parent
98b6493b91
commit
589a21204c
|
@ -19,6 +19,10 @@ class SoftapplicationsController < ApplicationController
|
||||||
@softapplication.attachments.each do |f|
|
@softapplication.attachments.each do |f|
|
||||||
f.image? ? @image_results << f : @image_results
|
f.image? ? @image_results << f : @image_results
|
||||||
end
|
end
|
||||||
|
@app_items = []
|
||||||
|
@softapplication.attachments.each do |f|
|
||||||
|
f.pack? ? @app_items << f : @app_items
|
||||||
|
end
|
||||||
@limit = 10
|
@limit = 10
|
||||||
@feedback_count = @jours.count
|
@feedback_count = @jours.count
|
||||||
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
|
||||||
|
|
|
@ -180,6 +180,10 @@ class Attachment < ActiveRecord::Base
|
||||||
!!(self.filename =~ /\.(bmp|gif|jpg|jpe|jpeg|png)$/i)
|
!!(self.filename =~ /\.(bmp|gif|jpg|jpe|jpeg|png)$/i)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pack?
|
||||||
|
!!(self.filename =~ /\.(zip|rar|tar|gz)$/i)
|
||||||
|
end
|
||||||
|
|
||||||
def thumbnailable?
|
def thumbnailable?
|
||||||
image?
|
image?
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,7 +28,12 @@
|
||||||
<td>系统支持:<%= @softapplication.android_min_version_available %></td>
|
<td>系统支持:<%= @softapplication.android_min_version_available %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>应用下载: </td>
|
<td>应用下载:
|
||||||
|
<% options = {:author => true, :deletable => @softapplication.user.eql?(User.current) } %>
|
||||||
|
<%= render :partial => 'attachments/app_link', :locals => {:attachments => @app_items, :options => options} %>
|
||||||
|
|
||||||
|
|
||||||
|
</td>
|
||||||
<td>开发人员:<%= @softapplication.application_developers %></td>
|
<td>开发人员:<%= @softapplication.application_developers %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue