obsolete.ChilliProject/app/views/projects/search.rhtml

32 lines
1.6 KiB
Plaintext

<h2><%= l(:label_search) %></h2>
<div class="box">
<% form_tag({:action => 'search', :id => @project}, :method => :get) do %>
<p><%= text_field_tag 'token', @token, :size => 30 %>
<%= check_box_tag 'scope[]', 'issues', (@scope.include? 'issues') %> <label><%= l(:label_issue_plural) %></label>
<%= check_box_tag 'scope[]', 'news', (@scope.include? 'news') %> <label><%= l(:label_news_plural) %></label>
<%= check_box_tag 'scope[]', 'documents', (@scope.include? 'documents') %> <label><%= l(:label_document_plural) %></label></p>
<%= submit_tag l(:button_submit), :name => 'submit' %>
<% end %>
</div>
<% if @results %>
<h3><%= lwr(:label_result, @results.length) %></h3>
<ul>
<% @results.each do |e| %>
<li><p>
<% if e.is_a? Issue %>
<%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %>: <%= highlight(h(e.subject), @token) %><br />
<i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
<% elsif e.is_a? News %>
<%=l(:label_news)%>: <%= link_to highlight(h(e.title), @token), :controller => 'news', :action => 'show', :id => e %><br />
<% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
<i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
<% elsif e.is_a? Document %>
<%=l(:label_document)%>: <%= link_to highlight(h(e.title), @token), :controller => 'documents', :action => 'show', :id => e %><br />
<i><%= format_time(e.created_on) %></i>
<% end %>
</p></li>
<% end %>
</ul>
<% end %>