diff --git a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb index 7b145bd2..65d172fa 100644 --- a/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb +++ b/vendor/built_in_modules/announcement/app/helpers/panel/announcement/back_end/bulletins_helper.rb @@ -38,20 +38,17 @@ module Panel::Announcement::BackEnd::BulletinsHelper def file_picture_preview_setting(file_path) res= "" - ext = File.extname(file_path) + ext = File.extname(file_path)[1..-1] + puts ext unless file_path.nil? case ext - when ".jpg",".jpeg",".png",".gif" - #res = '
' - #res.html_safe + when "jpg","jpeg","png","gif" {"data-content" => "#{image_tag file_path}" } + when "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx" + {"data-content" => "#{image_tag("http://#{request.host_with_port}/assets/ft-icons/#{ext}/#{ext}-48_32.png")}"} else {"data-content" => t("sys.not_previewable") } end end end - - end diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb index a1697b2a..1cd0d6f3 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb @@ -1,75 +1,76 @@ <% # encoding: utf-8 %> -