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;}