去除隐藏项目课程内的内容, 下载文件名缩略显示鼠标移上去浮动显示所有 完整文件名

This commit is contained in:
yanxd 2014-01-14 10:24:13 +08:00
parent 54aef57287
commit 41fefd0b37
2 changed files with 3 additions and 3 deletions

View File

@ -11,11 +11,11 @@ class StoresController < ApplicationController
def index def index
# @projects_attach = project_classification(0).take(LIMIT) # @projects_attach = project_classification(0).take(LIMIT)
# @courses_attach = project_classification(1).take(LIMIT) # @courses_attach = project_classification(1).take(LIMIT)
@projects_attach = Attachment.includes(:project).where("projects.project_type=?", 0). @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1).
reorder("#{Attachment.table_name}.downloads DESC"). reorder("#{Attachment.table_name}.downloads DESC").
limit(LIMIT) limit(LIMIT)
@courses_attach = Attachment.includes(:project).where("projects.project_type=?", 1). @courses_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 1, 1).
reorder("#{Attachment.table_name}.downloads DESC"). reorder("#{Attachment.table_name}.downloads DESC").
limit(LIMIT) limit(LIMIT)
@homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'"). @homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'").

View File

@ -87,7 +87,7 @@
<tbody> <tbody>
<% k.each do |c1|%> <% k.each do |c1|%>
<tr class="<%= cycle 'odd', 'even' %>"> <tr class="<%= cycle 'odd', 'even' %>">
<td class="filename" style="width:62%;"><%= link_to c1.filename, (attachFromUrl c1) %> </td> <td class="filename" style="width:62%;"><%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename} %> </td>
<td style="width:19%;"><%= c1.downloads %> </td> <td style="width:19%;"><%= c1.downloads %> </td>
<td class="filename" style="width:19%;"><%= link_to_attachment c1, {:text => "下载"}%></td> <td class="filename" style="width:19%;"><%= link_to_attachment c1, {:text => "下载"}%></td>
</tr> </tr>