<%= l(:label_questions) %>
<%= form_tag({:controller => "questions", :action => "topics"}, :method => :get, :id => "query_form") do %>
<%= hidden_field_tag('project_id', @project.to_param) if @project %>
<%= text_field_tag(:topic_search, params[:topic_search] , :autocomplete => "off", :class => "questions-search", :placeholder => l(:label_questions_search) ) %>
<%= javascript_tag "observeSearchfield('topic_search', 'forum_list', '#{ escape_javascript(autocomplete_for_topic_questions_path(:project_id => @project, :board_id => @board)) }')" %>
<% end %>
<% previous_group = false %>
<% boards = @project ? @boards : @boards.select{|b| b.topics_count > 0} %>
<% if @project %>
<% end %>
<% boards.each do |board| %>
<% if @project.blank? && (group = board.project) != previous_group %>
<% reset_cycle %>
<%= group.blank? ? 'None' : group.name %><%= link_to " \xc2\xbb", project_boards_path(:project_id => group) %>
<% previous_group = group %>
<% end %>
-
<%= link_to h(board.name), {:controller => "boards", :action => 'show', :id => board, :project_id => board.project_id}, :class => "board" %>
<%= "(#{board.topics_count})" %>
<% board.topics.sort_by{|m| [m.sticky, m.updated_on] }.reverse.first(5).each do |topic| %>
<%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => board, :id => topic } %>
<% last_update = [topic.last_reply ? topic.last_reply.updated_on : topic.created_on, topic.updated_on].max %>
<% last_author = (topic.last_reply && topic.last_reply.updated_on) ? topic.last_reply.author : topic.author %>
<%= authoring last_update, last_author, :label => :label_updated_time_by %>
<% end %>
<% end %>
<% content_for :sidebar do %>
<%= render :partial => "questions/notice" %>
<%= render :partial => "questions/tag_cloud" %>
<%= render :partial => "questions/latest_topics" %>
<%= render :partial => "questions/voted_topics" %>
<% end %>
<% content_for :header_tags do %>
<%= javascript_include_tag :questions, :plugin => 'redmine_questions' %>
<% end %>