socialforge/app/views/welcome/_search_course.html.erb

59 lines
1.8 KiB
Plaintext
Raw Normal View History

<%
select_option = []
2015-02-09 22:07:21 +08:00
(select_option << [l('welcome.search.select.project'), 'projects']) if project_type == Project::ProjectType_project
(select_option << [l('welcome.search.select.course'), 'courses']) if project_type == Project::ProjectType_course
select_option << [l('welcome.search.select.user'), 'users']
#select_option << ['教师', 'users_teacher'],
#select_option << ['学生', 'users_student']
%>
<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{
font-size: 13px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
border-right: none;
}
form #search_type{
font-size: 13px;
color: #363739;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
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>
<%= form_tag({controller: :welcome, action: :search }, method: :get) do %>
<div class="project-search" style="float: right">
<div class='search_widget'>
2015-02-09 22:07:21 +08:00
<%= text_field_tag :q, nil, :placeholder => l('welcome.search.information'), :size => 27, style: "float:left" %>
<%= select_tag(:search_type, options_for_select(select_option), :style => "float:right" ) %>
</div>
<%#= hidden_field_tag 'project_type', project_type %>
<%= submit_tag l(:label_search), :class => "enterprise", :name => nil, :style => "float:right" %>
</div>
<% end %>