BigW Consortium Gitlab

show.html.haml 2.27 KB
Newer Older
Cyril committed
1
= form_tag search_path, method: :get, class: 'form-inline' do |f|
2
  .padded
3
    = label_tag :search do
4
      %strong Looking for
5
    .input
6
      = text_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge", id: "dashboard_search"
7
      = submit_tag 'Search', class: "btn primary"
8 9
- if params[:search].present?
  %br
randx committed
10 11 12
  %h3
    Search results
    %small (#{@projects.count + @merge_requests.count + @issues.count})
13 14
  %hr
  .search_results
randx committed
15 16
    .row
      .span6
randx committed
17
        %table
randx committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
          %tr
            %th Projects
          %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
randx committed
34
        %table
randx committed
35 36 37 38 39 40 41 42 43
          %tr
            %th Merge Requests
          %tbody
            - @merge_requests.each do |merge_request|
              %tr
                %td
                  = link_to [merge_request.project, merge_request] do
                    %span.badge.badge-info ##{merge_request.id}
                    –
44
                    %strong.term= truncate merge_request.title, length: 50
randx committed
45 46 47 48 49 50 51
                    %strong.right
                      %span.label= merge_request.project.name
            - if @merge_requests.blank?
              %tr
                %td
                  %h4.nothing_here_message No Merge Requests
      .span6
randx committed
52
        %table
randx committed
53 54 55 56 57 58 59 60 61
          %tr
            %th Issues
          %tbody
            - @issues.each do |issue|
              %tr
                %td
                  = link_to [issue.project, issue] do
                    %span.badge.badge-info ##{issue.id}
                    –
62
                    %strong.term= truncate issue.title, length: 40
randx committed
63 64 65 66 67 68
                  %strong.right
                    %span.label= issue.project.name
            - if @issues.blank?
              %tr
                %td
                  %h4.nothing_here_message No Issues
69 70
  :javascript
    $(function() {
randx committed
71
      $(".search_results .term").highlight("#{params[:search]}");
72
    })