search function

This commit is contained in:
Andreas Stephanides
2014-02-08 16:39:56 +01:00
parent 05dbffd4f6
commit d3ac7504dc
11 changed files with 122 additions and 38 deletions

View File

@@ -0,0 +1,18 @@
<div class="media">
<span class="pull-left">
<%= image_tag fetprofile.picture.portrait.url %>
</span>
<div class="media-body">
<h2><%= fetprofile.name %></h2>
<p><%= fetprofile.fetmail %></p>
<% if false %>
<p><%= fetprofile.desc %></p>
<% end %>
</div>
</div>

View File

@@ -1,12 +1,4 @@
<div class="media">
<div class="pull-left">
<%= image_tag fetprofile.picture.portrait.url %>
</div>
<div class="media-body">
<h2><%= link_to fetprofile.name, fetprofile %></h2>
<p><%= fetprofile.fetmail %></p>
<p><%= fetprofile.desc.split(" ")[1..20].join(" ") %></p>
<p><%= fetprofile.active %> </p>
</div>
<%= link_to fetprofile, {class: :linkbox} do %>
<%= render :partial=>"fetprofiles/compact", :locals=>{:fetprofile=>fetprofile} %>
<% end %>

View 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 %>

View 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>

View File

@@ -0,0 +1 @@
$("#searchresults").html("<%=escape_javascript( render :partial=>'home/search_results' )%>")

View File

@@ -0,0 +1,25 @@
<div class="media">
<div class="pull-left" href="#">
<p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %>
</p>
</div>
<div class="media-body">
<div>
<small><%= neuigkeit.rubrik.name %></small>
<small class="pull-right"> <%= "am "+ I18n.l(neuigkeit.try(:datum).try(:to_date)) unless neuigkeit.try(:datum).try(:to_date).nil? %></small>
</div>
<h1>
<%= neuigkeit.title%>
</h1>
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%>
</div>
<% if neuigkeit.has_calentries? %>
<div class="pull-right" href="#">
<%= image_tag("/iconnavy/time.png") %>
<%= neuigkeit.calentries.first.text %>
</div>
<% end %>
</div>

View File

@@ -1,28 +1,4 @@
<%= link_to [neuigkeit.rubrik,neuigkeit], {class: :linkbox} do %>
<div class="media">
<div class="pull-left" href="#">
<p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %>
</p>
</div>
<div class="media-body">
<div>
<small><%= neuigkeit.rubrik.name %></small>
<small class="pull-right"> <%= "am "+ I18n.l(neuigkeit.try(:datum).try(:to_date)) unless neuigkeit.try(:datum).try(:to_date).nil? %></small>
</div>
<h1>
<%= neuigkeit.title%>
</h1>
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%>
</div>
<% if neuigkeit.has_calentries? %>
<div class="pull-right" href="#">
<%= image_tag("/iconnavy/time.png") %>
<%= neuigkeit.calentries.first.text %>
</div>
<% end %>
</div>
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> neuigkeit} %>
<% end %>