应用下载功能实现
This commit is contained in:
parent
98b6493b91
commit
589a21204c
|
@ -19,6 +19,10 @@ class SoftapplicationsController < ApplicationController
|
|||
@softapplication.attachments.each do |f|
|
||||
f.image? ? @image_results << f : @image_results
|
||||
end
|
||||
@app_items = []
|
||||
@softapplication.attachments.each do |f|
|
||||
f.pack? ? @app_items << f : @app_items
|
||||
end
|
||||
@limit = 10
|
||||
@feedback_count = @jours.count
|
||||
@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)
|
||||
end
|
||||
|
||||
def pack?
|
||||
!!(self.filename =~ /\.(zip|rar|tar|gz)$/i)
|
||||
end
|
||||
|
||||
def thumbnailable?
|
||||
image?
|
||||
end
|
||||
|
|
|
@ -28,7 +28,12 @@
|
|||
<td>系统支持:<%= @softapplication.android_min_version_available %></td>
|
||||
</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>
|
||||
</tr>
|
||||
|
||||
|
|
Loading…
Reference in New Issue