diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index 0fe44058e..f1d7e9999 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -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 + "%' "). diff --git a/app/views/layouts/base_stores.html.erb b/app/views/layouts/base_stores.html.erb index 268c3beda..9d125b251 100644 --- a/app/views/layouts/base_stores.html.erb +++ b/app/views/layouts/base_stores.html.erb @@ -42,6 +42,7 @@ + <%= render_flash_messages %>
<%= yield :top_field %>
@@ -50,7 +51,6 @@ <%= view_layouts_base_sidebar_hook_response %>
- <%= render_flash_messages %> <%= yield %> <%= call_hook :view_layouts_base_content %>
diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index a1e08d5b6..0ed270d92 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -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; - } + <% content_for :top_field do%> @@ -136,7 +40,9 @@ <%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename, :target => "_blank"} %> <%= c1.downloads %> - <%= link_to_attachment c1, {:text => "下载"}%> + + <%= link_to_attachment c1, {:text => image_tag("/images/button/download.png", width: "22px", alt: "l(:button_download)") }%> + <% end %> @@ -144,3 +50,15 @@ <% reset_cycle; end %> + \ No newline at end of file diff --git a/app/views/stores/search.html.erb b/app/views/stores/search.html.erb index 35fac9017..19bb29fbc 100644 --- a/app/views/stores/search.html.erb +++ b/app/views/stores/search.html.erb @@ -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; - } <% content_for :top_field do%>
diff --git a/public/images/button/download.png b/public/images/button/download.png new file mode 100644 index 000000000..04745e7c7 Binary files /dev/null and b/public/images/button/download.png differ diff --git a/public/images/button/download_focus.png b/public/images/button/download_focus.png new file mode 100644 index 000000000..6b8009b49 Binary files /dev/null and b/public/images/button/download_focus.png differ diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index 764939f3c..c0900cc10 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -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; } @@ -359,4 +366,102 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{ .project_acts .project_acts_right{ height: 100%; margin-left: 61%; -} \ No newline at end of file +} +/* 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; + } \ No newline at end of file