From 060759774b475c4c9385a9d35e0fcb64b56dff70 Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 27 Aug 2014 15:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E8=B5=84=E6=BA=90=E5=88=87=E6=8D=A2=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=97=B6=E5=BC=B9=E5=87=BAerror=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=88=E5=8E=9F=E5=9B=A0=EF=BC=9A1.=E6=9C=AA?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E5=88=86=E9=A1=B5=E5=AF=B9=E8=B1=A1=EF=BC=88?= =?UTF-8?q?=E4=BB=8E=E6=9F=90=E4=B8=AA=E7=B1=BB=E5=9E=8B=E5=88=87=E5=9B=9E?= =?UTF-8?q?=E5=85=A8=E9=83=A8=EF=BC=89=EF=BC=8C2.=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=BF=A1=E6=81=AF=E4=B8=A2=E5=A4=B1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 1 + app/views/files/_course_sort_by_attachtypel.html.erb | 2 +- app/views/files/_sort_by_attachtypel.html.erb | 2 +- config/locales/en.yml | 1 + config/locales/zh.yml | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 3d541fd61..4d4f78d5b 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -226,6 +226,7 @@ class FilesController < ApplicationController elsif @course @containers = [ Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] end + show_attachments @containers @attachtype = params[:type].to_i @contenttype = params[:contentType].to_s diff --git a/app/views/files/_course_sort_by_attachtypel.html.erb b/app/views/files/_course_sort_by_attachtypel.html.erb index f0f6c8270..c13d76620 100644 --- a/app/views/files/_course_sort_by_attachtypel.html.erb +++ b/app/views/files/_course_sort_by_attachtypel.html.erb @@ -37,7 +37,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>   <%= render :partial => 'attachments/course_type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/app/views/files/_sort_by_attachtypel.html.erb b/app/views/files/_sort_by_attachtypel.html.erb index d3723c340..eb7ffffec 100644 --- a/app/views/files/_sort_by_attachtypel.html.erb +++ b/app/views/files/_sort_by_attachtypel.html.erb @@ -37,7 +37,7 @@ <%= number_to_human_size(file.filesize) %> - <%= file.attachmentstype.typeName %> + <%= file.attachmentstype.nil? ? l(:lable_unknow_type):file.attachmentstype.typeName %>   <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, diff --git a/config/locales/en.yml b/config/locales/en.yml index 602e7a659..46c5360f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1807,3 +1807,4 @@ en: label_company_name: Company Name notice_account_invalid_creditentials_new: You have not to the mailbox activation + lable_unknow_type: Unknow type \ No newline at end of file diff --git a/config/locales/zh.yml b/config/locales/zh.yml index eeb2b125e..8f1bd21b0 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2114,4 +2114,5 @@ zh: lable_memos_max_length: 帖子内容最大长度为65535个字符 lable_forums_max_length: 贴吧描述最大长度为65535个字符 + lable_unknow_type: 未知类型 \ No newline at end of file