Skip to content

Instantly share code, notes, and snippets.

@cheezedigital
Created February 4, 2015 16:38
Show Gist options
  • Save cheezedigital/6541aa9aa629f0da4f57 to your computer and use it in GitHub Desktop.
Save cheezedigital/6541aa9aa629f0da4f57 to your computer and use it in GitHub Desktop.
hold yer hat
= render 'new_version_message'
.container-fluid.margin-left-0.well
= form_tag '', method: :get do
.col-md-4.margin-left-0
= label_tag :query, "Document title, number or user email"
= text_field_tag :query, params[:query], title: 'Document title, number or user email', class: 'form-control'
.col-md-1
= label_tag :interview_complete, "Status"
= select_tag :interview_complete, options_for_select(status_collection, params[:interview_complete]), class: 'form-control'
.col-md-6.margin-bottom-0
= label_tag :sort_order, "Order by"
.dashed-border.padding-bottom-38
.col-md-2.padding-top-10
= radio_button_tag :sort_field, :acquisition_title, (params[:sort_field] == 'acquisition_title' || !params[:sort_field])
= label_tag :sort_field_acquisition_title, "Name"
.col-md-3.padding-top-10
= radio_button_tag :sort_field, :document_number, (params[:sort_field] == 'document_number')
= label_tag :sort_field_document_number, "Number"
.col-md-4
= select_tag :sort_order, options_for_select(sort_order_collection, params[:sort_order]), class: 'form-control'
.col-md-1.padding-top-15
= submit_tag 'Search', class: 'btn btn-primary'
%table
%tr
- if can? :create, Document
%td.dashboard_create_btn
= button_to 'New Solicitation', account_new_solicitation_index_path, class: "btn btn-primary"
%td.dashboard_create_btn
= button_to 'New Award', account_new_award_index_path, class: "btn btn-primary"
%hr/
- if can? :read, Document
- if documents.nil? || documents.size == 0
%h5 No Documents.
- else
%table#documentTable.table.table-hover.table-striped
- filtered_documents.each_with_index do | doc, idx |
- if idx == 0
%thead
%tr
%th.dashboard_doc_awards Awards
%th.dashboard_doc_date Date
%th Type
%th.dashboard_doc_desc Description
%th.dashboard_doc_complete Status
%th.text-center{:colspan => "4"} Actions
- if doc.has_linked_awards?
= render partial: "document_row", locals: {doc: doc, idx: idx}
%tr
%td.hiddenRow{:colspan => "12"}
.accordian-body.collapse{:colspan => "12", :id => "lnAw#{idx}"}
%table#documentTable.table.table-hover.table-striped.border
- # render linked awards under the parent doc.
- doc.awards.each_with_index do | award_doc, award_idx |
= render partial: "document_row", locals: {doc: award_doc, idx: "LA#{award_idx}"}
- else
= render partial: "document_row", locals: {doc: doc, idx: idx}
%div{role: 'tabpanel'}
%ul.nav.nav-tabs{role: 'tablist'}
%li#inprogress-tab.active{'role' => 'presentation'}
= link_to 'In Progress', "#inprogress", {'role' => 'tab', 'data-toggle' => 'tab'}
%li#complete-tab{'role'=> 'presentation'}
= link_to 'Complete', "#complete", {'role' => 'tab', 'data-toggle' => 'tab'}
%div.tab-content
- [false, true].each do |status|
- classes = ["tab-pane", ("active" if status == false)]
- id = status == false ? 'inprogress' : 'complete'
%div{'role' => 'tabpanel', 'class' => classes, 'id' => id}
- sort_order = (params[:sort_order] == 'asc' ? :desc : :asc)
%table.document-table.table.table-hover.table-striped
- if grouped_documents[status].empty?
%h5 No Documents.
- else
- grouped_documents[status].each_with_index do | doc, idx |
- if idx == 0
%thead
%tr
%th
%span= link_to 'Creation date', { sort_field: :created_at, sort_order: sort_order }
%span.glyphicon.glyphicon-sort.sorter-icon
%th
%span= link_to 'Title', { sort_field: :acquisition_title, sort_order: sort_order}
%span.glyphicon.glyphicon-sort.sorter-icon
%th
%span= link_to 'Number', { sort_field: :document_number, sort_order: sort_order }
%span.glyphicon.glyphicon-sort.sorter-icon
%th
%span= link_to 'Email', { sort_field: :email, sort_order: sort_order }
%span.glyphicon.glyphicon-sort.sorter-icon
%th
%span= link_to 'Type', { sort_field: :document_type, sort_order: sort_order }
%span.glyphicon.glyphicon-sort.sorter-icon
%th{colspan: 6}
- if doc.has_linked_awards?
= render partial: "document_row", locals: {doc: doc, idx: idx}
%tr
%td.hiddenRow{:colspan => "12"}
.accordian-body.collapse{:colspan => "12", :id => "lnAw#{idx}"}
%table#documentTable.table.table-hover.table-striped.border
- # render linked awards under the parent doc.
- doc.awards.each_with_index do | award_doc, award_idx |
= render partial: "document_row", locals: {doc: award_doc, idx: "LA#{award_idx}"}
- else
= render partial: "document_row", locals: {doc: doc, idx: idx}
= will_paginate filtered_documents, renderer: BootstrapPagination::Rails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment