2012-08-23 23:04:43 +02:00
|
|
|
= form_tag search_path, method: :get, class: 'form-inline' do |f|
|
2012-03-16 00:14:39 +01:00
|
|
|
.padded
|
2012-06-04 00:37:27 +02:00
|
|
|
= label_tag :search do
|
2012-04-14 10:20:45 +02:00
|
|
|
%strong Looking for
|
2012-03-16 00:14:39 +01:00
|
|
|
.input
|
2012-09-19 08:14:07 +02:00
|
|
|
= search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search"
|
|
|
|
= submit_tag 'Search', class: "btn primary wide"
|
2012-03-16 00:14:39 +01:00
|
|
|
- if params[:search].present?
|
|
|
|
%br
|
2012-06-26 23:05:47 +02:00
|
|
|
%h3
|
|
|
|
Search results
|
|
|
|
%small (#{@projects.count + @merge_requests.count + @issues.count})
|
2012-03-16 00:14:39 +01:00
|
|
|
%hr
|
|
|
|
.search_results
|
2012-06-26 23:05:47 +02:00
|
|
|
.row
|
|
|
|
.span6
|
2012-09-03 20:53:16 +02:00
|
|
|
%table
|
2012-09-19 08:14:07 +02:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Projects
|
2012-06-26 23:05:47 +02:00
|
|
|
%tbody
|
|
|
|
- @projects.each do |project|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= link_to project do
|
|
|
|
%strong.term= project.name
|
|
|
|
%small.cgray
|
|
|
|
last activity at
|
|
|
|
= project.last_activity_date.stamp("Aug 25, 2011")
|
|
|
|
- if @projects.blank?
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
%h4.nothing_here_message No Projects
|
|
|
|
%br
|
2012-09-03 20:53:16 +02:00
|
|
|
%table
|
2012-09-19 08:14:07 +02:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Merge Requests
|
2012-06-26 23:05:47 +02:00
|
|
|
%tbody
|
|
|
|
- @merge_requests.each do |merge_request|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= link_to [merge_request.project, merge_request] do
|
|
|
|
%span.badge.badge-info ##{merge_request.id}
|
|
|
|
–
|
2012-08-11 00:07:50 +02:00
|
|
|
%strong.term= truncate merge_request.title, length: 50
|
2012-06-26 23:05:47 +02:00
|
|
|
%strong.right
|
|
|
|
%span.label= merge_request.project.name
|
|
|
|
- if @merge_requests.blank?
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
%h4.nothing_here_message No Merge Requests
|
|
|
|
.span6
|
2012-09-03 20:53:16 +02:00
|
|
|
%table
|
2012-09-19 08:14:07 +02:00
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th Issues
|
2012-06-26 23:05:47 +02:00
|
|
|
%tbody
|
|
|
|
- @issues.each do |issue|
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
= link_to [issue.project, issue] do
|
|
|
|
%span.badge.badge-info ##{issue.id}
|
|
|
|
–
|
2012-08-11 00:07:50 +02:00
|
|
|
%strong.term= truncate issue.title, length: 40
|
2012-06-26 23:05:47 +02:00
|
|
|
%strong.right
|
|
|
|
%span.label= issue.project.name
|
|
|
|
- if @issues.blank?
|
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
%h4.nothing_here_message No Issues
|
2012-03-16 00:14:39 +01:00
|
|
|
:javascript
|
|
|
|
$(function() {
|
2012-06-26 23:05:47 +02:00
|
|
|
$(".search_results .term").highlight("#{params[:search]}");
|
2012-03-16 00:14:39 +01:00
|
|
|
})
|