Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. = render 'new_version_message'
  2.  
  3. .container-fluid.margin-left-0.well
  4. = form_tag '', method: :get do
  5. .col-md-4.margin-left-0
  6. = label_tag :query, "Document title, number or user email"
  7. = text_field_tag :query, params[:query], title: 'Document title, number or user email', class: 'form-control'
  8. .col-md-1
  9. = label_tag :interview_complete, "Status"
  10. = select_tag :interview_complete, options_for_select(status_collection, params[:interview_complete]), class: 'form-control'
  11. .col-md-6.margin-bottom-0
  12. = label_tag :sort_order, "Order by"
  13. .dashed-border.padding-bottom-38
  14. .col-md-2.padding-top-10
  15. = radio_button_tag :sort_field, :acquisition_title, (params[:sort_field] == 'acquisition_title' || !params[:sort_field])
  16. = label_tag :sort_field_acquisition_title, "Name"
  17. .col-md-3.padding-top-10
  18. = radio_button_tag :sort_field, :document_number, (params[:sort_field] == 'document_number')
  19. = label_tag :sort_field_document_number, "Number"
  20. .col-md-4
  21. = select_tag :sort_order, options_for_select(sort_order_collection, params[:sort_order]), class: 'form-control'
  22. .col-md-1.padding-top-15
  23. = submit_tag 'Search', class: 'btn btn-primary'
  24.  
  25. %table
  26. %tr
  27. - if can? :create, Document
  28. %td.dashboard_create_btn
  29. = button_to 'New Solicitation', account_new_solicitation_index_path, class: "btn btn-primary"
  30. %td.dashboard_create_btn
  31. = button_to 'New Award', account_new_award_index_path, class: "btn btn-primary"
  32. %hr/
  33. - if can? :read, Document
  34. - if documents.nil? || documents.size == 0
  35. %h5 No Documents.
  36. - else
  37. %table#documentTable.table.table-hover.table-striped
  38. - filtered_documents.each_with_index do | doc, idx |
  39. - if idx == 0
  40. %thead
  41. %tr
  42. %th.dashboard_doc_awards Awards
  43. %th.dashboard_doc_date Date
  44. %th Type
  45. %th.dashboard_doc_desc Description
  46. %th.dashboard_doc_complete Status
  47. %th.text-center{:colspan => "4"} Actions
  48. - if doc.has_linked_awards?
  49. = render partial: "document_row", locals: {doc: doc, idx: idx}
  50. %tr
  51. %td.hiddenRow{:colspan => "12"}
  52. .accordian-body.collapse{:colspan => "12", :id => "lnAw#{idx}"}
  53. %table#documentTable.table.table-hover.table-striped.border
  54. - # render linked awards under the parent doc.
  55. - doc.awards.each_with_index do | award_doc, award_idx |
  56. = render partial: "document_row", locals: {doc: award_doc, idx: "LA#{award_idx}"}
  57. - else
  58. = render partial: "document_row", locals: {doc: doc, idx: idx}
  59. %div{role: 'tabpanel'}
  60. %ul.nav.nav-tabs{role: 'tablist'}
  61. %li#inprogress-tab.active{'role' => 'presentation'}
  62. = link_to 'In Progress', "#inprogress", {'role' => 'tab', 'data-toggle' => 'tab'}
  63. %li#complete-tab{'role'=> 'presentation'}
  64. = link_to 'Complete', "#complete", {'role' => 'tab', 'data-toggle' => 'tab'}
  65.  
  66. %div.tab-content
  67. - [false, true].each do |status|
  68. - classes = ["tab-pane", ("active" if status == false)]
  69. - id = status == false ? 'inprogress' : 'complete'
  70. %div{'role' => 'tabpanel', 'class' => classes, 'id' => id}
  71. - sort_order = (params[:sort_order] == 'asc' ? :desc : :asc)
  72. %table.document-table.table.table-hover.table-striped
  73. - if grouped_documents[status].empty?
  74. %h5 No Documents.
  75. - else
  76. - grouped_documents[status].each_with_index do | doc, idx |
  77.  
  78. - if idx == 0
  79. %thead
  80. %tr
  81. %th
  82. %span= link_to 'Creation date', { sort_field: :created_at, sort_order: sort_order }
  83. %span.glyphicon.glyphicon-sort.sorter-icon
  84. %th
  85. %span= link_to 'Title', { sort_field: :acquisition_title, sort_order: sort_order}
  86. %span.glyphicon.glyphicon-sort.sorter-icon
  87. %th
  88. %span= link_to 'Number', { sort_field: :document_number, sort_order: sort_order }
  89. %span.glyphicon.glyphicon-sort.sorter-icon
  90. %th
  91. %span= link_to 'Email', { sort_field: :email, sort_order: sort_order }
  92. %span.glyphicon.glyphicon-sort.sorter-icon
  93. %th
  94. %span= link_to 'Type', { sort_field: :document_type, sort_order: sort_order }
  95. %span.glyphicon.glyphicon-sort.sorter-icon
  96. %th{colspan: 6}
  97. - if doc.has_linked_awards?
  98. = render partial: "document_row", locals: {doc: doc, idx: idx}
  99. %tr
  100. %td.hiddenRow{:colspan => "12"}
  101. .accordian-body.collapse{:colspan => "12", :id => "lnAw#{idx}"}
  102. %table#documentTable.table.table-hover.table-striped.border
  103. - # render linked awards under the parent doc.
  104. - doc.awards.each_with_index do | award_doc, award_idx |
  105. = render partial: "document_row", locals: {doc: award_doc, idx: "LA#{award_idx}"}
  106. - else
  107. = render partial: "document_row", locals: {doc: doc, idx: idx}
  108.  
  109. = will_paginate filtered_documents, renderer: BootstrapPagination::Rails
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement