This commit is contained in:
yanxd 2014-01-15 17:28:53 +08:00
parent b825d2b7b5
commit a5c9d9c31e
7 changed files with 125 additions and 197 deletions

View File

@ -1,3 +1,4 @@
# encoding: utf-8
# Trustie - education management software
# Copyright (C) 2013-2014
class StoresController < ApplicationController
@ -9,6 +10,7 @@ class StoresController < ApplicationController
def search
name = params[:name] ||= ''
redirect_to stores_path, :notice => '为何不写点东西?' if name.blank?
# 按文件名搜索
#result = Attachment.includes(:project).where("projects.is_public = 1 AND filename LIKE '%" << name << "%' ")
result = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE '%" + name + "%' ").

View File

@ -42,6 +42,7 @@
</tr>
</table>
</div>
<%= render_flash_messages %>
<div id="top_field">
<%= yield :top_field %>
</div>
@ -50,7 +51,6 @@
<%= view_layouts_base_sidebar_hook_response %>
</div>
<div id="store_content" style="padding-top: 0px;">
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
</div>

View File

@ -9,103 +9,7 @@
max-width: 100%;
margin: 20px auto;
}
.line_block{
display: inline-block;
width: 49%;
margin: 10px auto;
vertical-align: top;
padding: 0px 2%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}
.resource_sum{
height: auto;
}
.line_block p{
margin: 1em 0px auto;
/*background: linear-gradient(#ffffff, #e5e5e5) repeat scroll 0% 0% transparent;*/
border-bottom: 1px solid rgb(226,226,226);
border-top-left-radius : 6px;
border-top-right-radius : 6px;
box-shadow: 0px 1px 0px white, 0px, -1px 0px rgb(245,245,245);
height: 39px;
font-size: 15px;
line-height: 26px;
height: 30px;
font-size: 1.5em;
padding-left: 4%;
border-bottom: 1px solid rgb(21, 165, 200);
}
.resource_sum, .line_blo{
border: 1px solid #eeeeee;
}
.line_block table{
border: 1px solid #eeeeee;
}
.line_block table thead tr{
/*background-color: #d1d1d1;*/
text-align: center;
}
.line_block table td{
height: 2em;
}
.filename {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 247px;
}
/*.filename a:after {
content: "...";
}*/
.blueinputbar{
-o-transform-origin: 138px 46.5px;
-o-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 8px 0px;
-webkit-transform-origin: 138px 46.5px;
-webkit-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-transition-delay: 0;
-webkit-transition-duration: 0.2s;
-webkit-transition-property: background;
-webkit-transition-timing-function: cubic-bezier(0, 0, 1, 1);
align-content: stretch;
align-items: stretch;
align-self: stretch;
background: #FFFFFF;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
color: #333333;
justify-content: flex-start;
margin: 0px;
order: 0;
outline: #333333 0px;
overflow-wrap: break-word;
resize: none;
text-shadow: none;
transform-origin: 138px 46.5px;
transition: background 0.2s cubic-bezier(0, 0, 1, 1);
unicode-bidi: embed;
vertical-align: top;
word-wrap: break-word;
}
input.blueinputbar:focus {
box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 5px 0px;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
}
</style>
<% content_for :top_field do%>
@ -136,7 +40,9 @@
<tr class="<%= cycle 'odd', 'even' %>">
<td class="filename" style="width:62%;"><%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %> </td>
<td style="width:19%; text-align: center;"><%= c1.downloads %> </td>
<td class="filename" style="width:19%; text-align: center;"><%= link_to_attachment c1, {:text => "下载"}%></td>
<td class="filename download_icon" style="width:19%; text-align: center;">
<%= link_to_attachment c1, {:text => image_tag("/images/button/download.png", width: "22px", alt: "l(:button_download)") }%>
</td>
</tr>
<% end %>
</tbody>
@ -144,3 +50,15 @@
</div>
<% reset_cycle; end %>
</div>
<script type='text/javascript'>
$(document).ready(function($) {
$('.download_icon').each(function(){
$(this).mouseenter(function(event) {
$(this).find('img').attr("src", "/images/button/download_focus.png")
});
$(this).mouseleave(function(event) {
$(this).find('img').attr("src", "/images/button/download.png")
});
});
});
</script>

View File

@ -9,103 +9,6 @@
max-width: 100%;
margin: 20px auto;
}
.line_block{
display: inline-block;
width: 49%;
margin: 10px auto;
vertical-align: top;
padding: 0px 2%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}
.resource_sum{
height: auto;
}
.line_block p{
margin: 1em 0px auto;
/*background: linear-gradient(#ffffff, #e5e5e5) repeat scroll 0% 0% transparent;*/
border-bottom: 1px solid rgb(226,226,226);
border-top-left-radius : 6px;
border-top-right-radius : 6px;
box-shadow: 0px 1px 0px white, 0px, -1px 0px rgb(245,245,245);
height: 39px;
font-size: 15px;
line-height: 26px;
height: 30px;
font-size: 1.5em;
padding-left: 4%;
border-bottom: 1px solid rgb(21, 165, 200);
}
.resource_sum, .line_blo{
border: 1px solid #eeeeee;
}
.line_block table{
border: 1px solid #eeeeee;
}
.line_block table thead tr{
/*background-color: #d1d1d1;*/
text-align: center;
}
.line_block table td{
height: 2em;
}
.filename {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 247px;
}
/*.filename a:after {
content: "...";
}*/
.blueinputbar{
-o-transform-origin: 138px 46.5px;
-o-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 8px 0px;
-webkit-transform-origin: 138px 46.5px;
-webkit-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-transition-delay: 0;
-webkit-transition-duration: 0.2s;
-webkit-transition-property: background;
-webkit-transition-timing-function: cubic-bezier(0, 0, 1, 1);
align-content: stretch;
align-items: stretch;
align-self: stretch;
background: #FFFFFF;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
color: #333333;
justify-content: flex-start;
margin: 0px;
order: 0;
outline: #333333 0px;
overflow-wrap: break-word;
resize: none;
text-shadow: none;
transform-origin: 138px 46.5px;
transition: background 0.2s cubic-bezier(0, 0, 1, 1);
unicode-bidi: embed;
vertical-align: top;
word-wrap: break-word;
}
input.blueinputbar:focus {
box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 5px 0px;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
}
</style>
<% content_for :top_field do%>
<div style="margin: 10px 5%;">

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -14,6 +14,13 @@
.clear_both{
clear: both;
}
.btn_download{
display: inline-block;
background: url('images/button/download.png') no-repeat transparent;
}
.btn_download a{
background: url('images/button/download.png') no-repeat transparent;
}
* {
font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif;
}
@ -360,3 +367,101 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{
height: 100%;
margin-left: 61%;
}
/* stores 资源库
*******************************************************************************/
.line_block{
display: inline-block;
width: 49%;
margin: 10px auto;
vertical-align: top;
padding: 0px 2%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
-box-sizing: border-box;
}
.resource_sum{
height: auto;
}
.line_block p{
margin: 1em 0px auto;
/*background: linear-gradient(#ffffff, #e5e5e5) repeat scroll 0% 0% transparent;*/
border-bottom: 1px solid rgb(226,226,226);
border-top-left-radius : 6px;
border-top-right-radius : 6px;
box-shadow: 0px 1px 0px white, 0px, -1px 0px rgb(245,245,245);
height: 39px;
font-size: 15px;
line-height: 26px;
height: 30px;
font-size: 1.5em;
padding-left: 4%;
border-bottom: 1px solid rgb(21, 165, 200);
}
.resource_sum, .line_blo{
border: 1px solid #eeeeee;
}
.line_block table{
border: 1px solid #eeeeee;
}
.line_block table thead tr{
/*background-color: #d1d1d1;*/
text-align: center;
}
.line_block table td{
height: 2em;
}
.filename {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 247px;
}
/*.filename a:after {
content: "...";
}*/
.blueinputbar{
-o-transform-origin: 138px 46.5px;
-o-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
-webkit-border-radius: 3px;
-webkit-border-top-left-radius: 3px;
-webkit-border-top-right-radius: 3px;
-webkit-transform-origin: 138px 46.5px;
-webkit-transition: background 0.2s cubic-bezier(0, 0, 1, 1);
-webkit-transition-delay: 0;
-webkit-transition-duration: 0.2s;
-webkit-transition-property: background;
-webkit-transition-timing-function: cubic-bezier(0, 0, 1, 1);
align-content: stretch;
align-items: stretch;
align-self: stretch;
background: #FFFFFF;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
color: #333333;
justify-content: flex-start;
margin: 0px;
order: 0;
outline: #333333 0px;
overflow-wrap: break-word;
resize: none;
text-shadow: none;
transform-origin: 138px 46.5px;
transition: background 0.2s cubic-bezier(0, 0, 1, 1);
unicode-bidi: embed;
vertical-align: top;
word-wrap: break-word;
}
input.blueinputbar:focus {
box-shadow: rgba(0, 0, 0, 0.047) 0px 1px 3px 0px inset, rgba(82, 168, 236, 0.600) 0px 0px 5px 0px;
border-bottom: 1px solid #56B4EF;
border-left: 1px solid #56B4EF;
border-radius: 3px;
border-right: 1px solid #56B4EF;
border-top: 1px solid #56B4EF;
}