Commit 1c8008c1 authored by randx's avatar randx

Informative search results page

parent 385ca60a
...@@ -7,55 +7,66 @@ ...@@ -7,55 +7,66 @@
= submit_tag 'Search', :class => "btn btn-primary" = submit_tag 'Search', :class => "btn btn-primary"
- if params[:search].present? - if params[:search].present?
%br %br
%h3 Search results %h3
Search results
%small (#{@projects.count + @merge_requests.count + @issues.count})
%hr %hr
.search_results .search_results
- if @projects.empty? && @merge_requests.empty? .row
%h3 .span6
%small Nothing here %table.admin-table
- else %tr
- if @projects.any? %th Projects
%h4 Projects %tbody
.padded - @projects.each do |project|
- @projects.each do |project| %tr
= link_to project do %td
%h4 = link_to project do
%span.ico.project %strong.term= project.name
= project.name %small.cgray
%small last activity at
last activity at = project.last_activity_date.stamp("Aug 25, 2011")
= project.last_activity_date.stamp("Aug 25, 2011") - if @projects.blank?
- if @merge_requests.any? %tr
%h4 Merge Requests %td
.padded %h4.nothing_here_message No Projects
- @merge_requests.each do |merge_request| %br
= link_to [merge_request.project, merge_request] do %table.admin-table
%h5 %tr
Merge Request # %th Merge Requests
= merge_request.id %tbody
– - @merge_requests.each do |merge_request|
= truncate merge_request.title, :length => 50 %tr
%small %td
updated at = link_to [merge_request.project, merge_request] do
= merge_request.updated_at.stamp("Aug 25, 2011") %span.badge.badge-info ##{merge_request.id}
%strong –
%span.label= merge_request.project.name %strong.term= truncate merge_request.title, :length => 50
- if @issues.any? %strong.right
%h4 Issues %span.label= merge_request.project.name
.padded - if @merge_requests.blank?
- @issues.each do |issue| %tr
= link_to [issue.project, issue] do %td
%h5 %h4.nothing_here_message No Merge Requests
Issue # .span6
= issue.id %table.admin-table
– %tr
= truncate issue.title, :length => 50 %th Issues
%small %tbody
updated at - @issues.each do |issue|
= issue.updated_at.stamp("Aug 25, 2011") %tr
%strong %td
%span.label= issue.project.name = link_to [issue.project, issue] do
%span.badge.badge-info ##{issue.id}
–
%strong.term= truncate issue.title, :length => 40
%strong.right
%span.label= issue.project.name
- if @issues.blank?
%tr
%td
%h4.nothing_here_message No Issues
:javascript :javascript
$(function() { $(function() {
$(".search_results").highlight("#{params[:search]}"); $(".search_results .term").highlight("#{params[:search]}");
}) })
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment