2014-03-25 16:53:11 +08:00
|
|
|
<%
|
|
|
|
select_option = []
|
|
|
|
(select_option << ['项目', 'projects']) if project_type == Project::ProjectType_project
|
|
|
|
(select_option << ['课程', 'courses']) if project_type == Project::ProjectType_course
|
|
|
|
select_option << ['用户', 'users']
|
|
|
|
#select_option << ['教师', 'users_teacher'],
|
|
|
|
#select_option << ['学生', 'users_student']
|
|
|
|
%>
|
2014-03-27 10:53:45 +08:00
|
|
|
<style type="text/css">
|
|
|
|
form #q, form #search_type{
|
|
|
|
-webkit-box-sizing: border-box;
|
|
|
|
-moz-box-sizing: border-box;
|
|
|
|
box-sizing: border-box;
|
|
|
|
display: inline-block;
|
|
|
|
margin: 0px;
|
|
|
|
padding: 5px;
|
|
|
|
height: 33px;
|
|
|
|
}
|
|
|
|
form #q{
|
2014-03-31 15:36:51 +08:00
|
|
|
font-size: 13px;
|
2014-03-27 10:53:45 +08:00
|
|
|
border-top-left-radius: 5px;
|
|
|
|
border-bottom-left-radius: 5px;
|
|
|
|
border-right: none;
|
|
|
|
|
|
|
|
}
|
|
|
|
form #search_type{
|
2014-03-31 15:36:51 +08:00
|
|
|
font-size: 13px;
|
2014-03-27 10:53:45 +08:00
|
|
|
color: #363739;
|
|
|
|
border-top-right-radius: 5px;
|
|
|
|
border-bottom-right-radius: 5px;
|
2014-03-31 15:36:51 +08:00
|
|
|
border-bottom-left-radius: 0px;
|
|
|
|
border-top-left-radius: 0px;
|
2014-03-27 10:53:45 +08:00
|
|
|
border-left: 1px outset #83A9A9;
|
|
|
|
margin-left: -4px;
|
|
|
|
-webkit-appearance: none;
|
|
|
|
-moz-appearance: none;
|
|
|
|
text-indent: 0.01px;
|
|
|
|
text-overflow: '';
|
|
|
|
}
|
|
|
|
.search_widget{
|
|
|
|
display:inline-block;
|
|
|
|
border-radius: 5px;
|
|
|
|
}
|
|
|
|
.search_widget:hover{
|
|
|
|
box-shadow: 0px 0px 3px #56B4EF;
|
|
|
|
}
|
|
|
|
<%#完了把上面东西放到 .css 里%>
|
|
|
|
</style>
|
2014-03-25 16:53:11 +08:00
|
|
|
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
|
2014-03-21 15:17:14 +08:00
|
|
|
<div class="project-search" style="float: right">
|
2014-03-27 10:53:45 +08:00
|
|
|
<div class='search_widget'>
|
2014-03-25 16:53:11 +08:00
|
|
|
<%= text_field_tag :q, nil, placeholder:'请输入要搜索的关键字', :size => 27 %>
|
|
|
|
<%= select_tag(:search_type, options_for_select(select_option) ) %>
|
2014-03-27 10:53:45 +08:00
|
|
|
</div>
|
2014-03-25 16:53:11 +08:00
|
|
|
<%#= hidden_field_tag 'project_type', project_type %>
|
2014-03-21 15:17:14 +08:00
|
|
|
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil %>
|
2014-03-24 13:48:43 +08:00
|
|
|
</div>
|
2014-03-25 16:53:11 +08:00
|
|
|
<% end %>
|