diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index a1410722f..9ac62f928 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -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'] diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 8e607a685..919760ee3 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -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 diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index c5ecac2c1..053de150e 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -28,7 +28,12 @@