From a0afe6ccbf1c6ca2c732bc4e60392b7d7db176ca Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 8 Jan 2016 16:05:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=B9=B6=E7=BB=9F=E4=B8=80=E9=99=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/_activity_attach.html.erb | 19 +++++++++++++ app/views/blogs/_article.html.erb | 16 ++++++----- .../_org_course_homework.html.erb | 5 ++-- .../_org_course_message.html.erb | 3 ++ .../organizations/_org_course_news.html.erb | 3 ++ .../organizations/_org_project_issue.html.erb | 27 +----------------- .../_org_subfield_message.html.erb | 3 ++ .../organizations/_project_message.html.erb | 3 ++ app/views/projects/_project_news.html.erb | 3 ++ app/views/users/_course_homework.html.erb | 6 ++-- app/views/users/_course_message.html.erb | 4 ++- app/views/users/_course_news.html.erb | 3 ++ app/views/users/_project_issue.html.erb | 28 +------------------ app/views/users/_project_message.html.erb | 4 ++- app/views/users/_user_blog.html.erb | 3 ++ .../users/_user_homework_detail.html.erb | 5 ++-- public/stylesheets/public.css | 1 + 17 files changed, 64 insertions(+), 72 deletions(-) create mode 100644 app/views/attachments/_activity_attach.html.erb diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb new file mode 100644 index 000000000..9bd7d9d2f --- /dev/null +++ b/app/views/attachments/_activity_attach.html.erb @@ -0,0 +1,19 @@ +<% if activity.attachments.any? %> + <% activity.attachments.each do |attachment| %> +
+ + + <%= link_to_short_attachment attachment,:length=> 58, :class => 'mw400 hidden link_file_a fl newsBlue', :download => true -%> + + + ( + <%= number_to_human_size attachment.filesize %>) + + + <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, + <%= format_time(attachment.created_on) %> + +
+
+ <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 8d366a05a..0048625d8 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -67,17 +67,19 @@
-
- <% if activity.attachments.any?%> - <% options = {:author => true, :deletable => false } %> - <%= render :partial => 'blog_comments/attachments_links', :locals => {:attachments => activity.attachments, :options => options, :is_float => true} %> - <% end %> +
- +
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
diff --git a/app/views/organizations/_project_message.html.erb b/app/views/organizations/_project_message.html.erb index cac3c8dec..85cfb2921 100644 --- a/app/views/organizations/_project_message.html.erb +++ b/app/views/organizations/_project_message.html.erb @@ -39,6 +39,9 @@
+
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index fe35d2698..7336adc29 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -31,6 +31,9 @@
+
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 17d2ace69..99315d5af 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -101,10 +101,8 @@
-
- <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => activity.attachments} %> -
-
+
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 562427c43..9b2fd328d 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -43,7 +43,9 @@
- +
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
diff --git a/app/views/users/_project_issue.html.erb b/app/views/users/_project_issue.html.erb index a83258737..77d2f2fde 100644 --- a/app/views/users/_project_issue.html.erb +++ b/app/views/users/_project_issue.html.erb @@ -57,33 +57,7 @@
- <% if activity.attachments.any? %> - <% activity.attachments.each do |attachment| %> -
- - - <%= link_to_short_attachment attachment,:length=> 58, :class => 'link_file_a fl newsBlue', :download => true -%> - - <% if attachment.is_text? %> - <%= link_to image_tag('magnifier.png'), - :controller => 'attachments', - :action => 'show', - :id => attachment, - :class => 'fl', - :filename => attachment.filename %> - <% end %> - - ( - <%= number_to_human_size attachment.filesize %>) - - - <%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "c_orange" %>, - <%= format_time(attachment.created_on) %> - -
-
- <% end %> - <% end %> + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index d248eb845..87ed5a6e2 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -44,7 +44,9 @@
- +
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %> +
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index af0db004f..d2420491c 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -104,9 +104,8 @@
-
- <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %> -
+
+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => homework_common} %>
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index a25d462b6..9416fe7d9 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -167,6 +167,7 @@ h4{ font-size:14px; color:#3b3b3b;} .h70{ height:70px;} .h150{ height:150px;} .p10 {padding-left:10px; padding-right:10px;} +.mw400 {max-width: 400px;} /* Font & background Color */ a.b_grey{ background: #F5F5F5;}