From 19530df395e7d1b4a630862845d9d6f6ace4b73c Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 19 Jun 2014 19:14:51 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=99=84=E4=BB=B6=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_app_link.html.erb | 32 +++++++++++++++++++-------
app/views/bids/_attachment.html.erb | 6 +++++
app/views/bids/_homework_list.html.erb | 4 ++--
3 files changed, 32 insertions(+), 10 deletions(-)
create mode 100644 app/views/bids/_attachment.html.erb
diff --git a/app/views/bids/_app_link.html.erb b/app/views/bids/_app_link.html.erb
index 645fe94f9..d61f4ef87 100644
--- a/app/views/bids/_app_link.html.erb
+++ b/app/views/bids/_app_link.html.erb
@@ -1,8 +1,24 @@
-<% for attachment in attachments %>
- <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
- <% if attachment.is_text? %>
- <%= link_to image_tag('magnifier.png'),
- :controller => 'attachments', :action => 'show',
- :id => attachment, :filename => attachment.filename %>
- <% end %>
-<% end -%>
\ No newline at end of file
+
+
+ <% count = 0 %>
+ <% for attachment in attachments %>
+ <% if attachments.count == 1 %>
+
+ <%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
+ |
+ <% elsif attachments.count == 2 %>
+
+ <%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
+ |
+ <% else %>
+
+ <% if count == 3 %>
+ <% break %>
+ <% end %>
+ <%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
+ <% count = count +1 %>
+ |
+ <% end %>
+ <% end %>
+
+
\ No newline at end of file
diff --git a/app/views/bids/_attachment.html.erb b/app/views/bids/_attachment.html.erb
new file mode 100644
index 000000000..6bccc08f5
--- /dev/null
+++ b/app/views/bids/_attachment.html.erb
@@ -0,0 +1,6 @@
+<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
+<% if attachment.is_text? %>
+ <%= link_to image_tag('magnifier.png'),
+ :controller => 'attachments', :action => 'show',
+ :id => attachment, :filename => attachment.filename,:style => "width:50px"%>
+<% end %>
\ No newline at end of file
diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb
index b52ac6933..0a92df47d 100644
--- a/app/views/bids/_homework_list.html.erb
+++ b/app/views/bids/_homework_list.html.erb
@@ -132,8 +132,8 @@
-
- <% if is_evaluation %>
+ |
+ <% if is_evaluation || is_teacher%>
<%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
<% end %>
|