search function
This commit is contained in:
37
app/views/home/_search_results.html.erb
Normal file
37
app/views/home/_search_results.html.erb
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
<% unless @neuigkeiten.empty? %>
|
||||
<h2>Neuigkeiten</h2>
|
||||
<% end %>
|
||||
<% @neuigkeiten.each do |neuigkeit| %>
|
||||
<ul class="unstyled linkbox-list" style="max-width:70em">
|
||||
<li>
|
||||
<%= render neuigkeit %>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% unless @fetprofiles.empty? %>
|
||||
<h2>Mitarbeiter</h2>
|
||||
<% end %>
|
||||
|
||||
<% @fetprofiles.each do |fetprofile| %>
|
||||
<ul class="unstyled linkbox-list" style="max-width:70em">
|
||||
<li>
|
||||
<%= render fetprofile %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<% unless @fetprofiles.empty? %>
|
||||
<h2>Themen</h2>
|
||||
<% end %>
|
||||
|
||||
<% @themen.each do |thema| %>
|
||||
<ul class="unstyled linkbox-list" style="max-width:70em">
|
||||
<li><%= link_to thema, {:class=>"linkbox"} do %>
|
||||
<%= render :partial=>"themen/small", :object=>thema %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
17
app/views/home/search.html.erb
Normal file
17
app/views/home/search.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="content-wrap content-column">
|
||||
<%= semantic_form_for :search,:remote=>true, :url=>search_home_index_path, :html=>{:id=>"search_form", :method=>'get'} do |f| %>
|
||||
<%= f.input :query, :input_html => { :name => 'query' } %>
|
||||
<% end %>
|
||||
<script>
|
||||
$( document ).ready(function() {
|
||||
$("#search_query").bind("keyup", function(event){
|
||||
$("#search_form").submit();
|
||||
});
|
||||
$("#search_query").value="df"
|
||||
});
|
||||
</script>
|
||||
<div id="searchresults">
|
||||
<%= render :partial=>"home/search_results" %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
1
app/views/home/search.js.erb
Normal file
1
app/views/home/search.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
$("#searchresults").html("<%=escape_javascript( render :partial=>'home/search_results' )%>")
|
||||
Reference in New Issue
Block a user