exceptionHandle
yanxd 12 years ago
parent 52cffd3864
commit bacddf00d9

@ -10,11 +10,11 @@ class StoresController < ApplicationController
# 按文件名搜索 # 按文件名搜索
result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE '%" + name + "%' "). result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE '%" + name + "%' ").
reorder("created_on DESC") reorder("created_on DESC")
result = result.to_a # result = result.to_a
result.map { |res| result.map { |res|
if(res.container.nil? || if(res.container.nil? ||
(res.container.class.to_s.eql?("Project") && res.container.is_public == false) || (res.container.class.to_s=="Project" && res.container.is_public == false) ||
(res.container.class.to_s.eql?("HomeworkAttach") && res.container.bid.reward_type == 3) || (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) ||
false false
) )
result.delete(res) result.delete(res)

@ -1,21 +1,5 @@
<style type='text/css'> <style type="text/css">
.highlight {
background-color: #fff34d;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: 0px 1px 4px rgba(0,0,0,0.7);
-webkit-box-shadow: 0px 1px 4px rgba(0,0,0,0.7);
box-shadow: 0px 1px 4px rgba(0,0,0,0.7);
}
.highlight {
padding: 1px 4px;
margin: 0 -4px;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-webkit-opacity: 0.7;
opacity: 0.7;
}
</style> </style>
<% content_for :top_field do%> <% content_for :top_field do%>
<div style="margin: 10px 5%;"> <div style="margin: 10px 5%;">
@ -33,16 +17,19 @@
<tr> <tr>
<td class="r1"> <td class="r1">
<div class="cb"> <div class="cb">
<span style="color: #c03; font-size: 14px;"><%= result.filename %></span> <span style=""><%= result.filename %></span>
<span style="margin-left: 4px;"><%= link_to_attachment result, {:text => image_tag("/images/button/download.png", width: "22px", alt: "l(:button_download)", :class => 'download_icon')}%></span> <span style="margin-left: 4px;">
<%= link_to_attachment result, {:text => image_tag("/images/button/dl.png", width: "70px", alt: l(:button_download), :class => 'download_icon')}%>
</span>
</div> </div>
<%= result.description %> <%= result.description %>
<div class="c9">所属分类:<%=result_come_from result%> <div class="c9"> 所属分类:<%=result_come_from result%> </div>
<span class="gray">
下载:<%= result.downloads%>|
大小:<%= number_to_human_size(result.filesize) %>|
共享者:<a class="gray" ><%= link_to result.author%></a>|
上传时间:<%= format_time(result.created_on) %> 上传时间:<%= format_time(result.created_on) %>
</div> </span>
<span class="gray">下载:<%= result.downloads%>
| 大小:<%= number_to_human_size(result.filesize) %>
| 共享者:<a class="gray" ><%= link_to result.author%></a></span>
<div style="display: none"></div> <div style="display: none"></div>
</td> </td>
</tr> </tr>

@ -14,13 +14,23 @@
.clear_both{ .clear_both{
clear: both; clear: both;
} }
.btn_download{ .highlight {
display: inline-block; background-color: #fff34d;
background: url('images/button/download.png') no-repeat transparent; -moz-border-radius: 3px;
} -webkit-border-radius: 3px;
.btn_download a{ border-radius: 3px;
background: url('images/button/download.png') no-repeat transparent; -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.7);
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.7);
box-shadow: 0px 1px 2px rgba(0,0,0,0.7);
color: #cc0033;
/*padding: 1px 3px;*/
/*margin: 0 -4px;*/
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-webkit-opacity: 0.7;
opacity: 0.7;
} }
* { * {
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif; font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
} }
@ -421,9 +431,6 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
max-width: 100%; max-width: 100%;
margin: 20px auto; margin: 20px auto;
} }
/*.filename a:after {
content: "...";
}*/
.blueinputbar{ .blueinputbar{
-o-transform-origin: 138px 46.5px; -o-transform-origin: 138px 46.5px;
-o-transition: background 0.2s cubic-bezier(0, 0, 1, 1); -o-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
@ -469,3 +476,15 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
border-right: 1px solid #56B4EF; border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF; border-top: 1px solid #56B4EF;
} }
.r1 {
font-size:13px;
line-height: 1.7em;
overflow-wrap: break-word;
padding-bottom: 20px;
padding-left: 20px;
/*width: 50em;*/
}
.r1 .cb {
font-size: 16px;
color: #3333cc;
}
Loading…
Cancel
Save