<%= _('Manage contracts') %>

<% form_tag({}, {:id => "bsc-plugin-contracts-form"}) do %>

<%= _('Status') %>

<% BscPlugin::Contract::Status.types.each do |status| %> <%= check_box_tag('status[]', status, @status.include?(status.to_s), :id => 'status-checkbox-'+status.to_s) %> <%= content_tag('label', BscPlugin::Contract::Status.names[status], :for => 'status-checkbox-'+status.to_s) %>
<% end %>
<%= submit_button(:save, _('Filter')) %>
<%= labelled_select(_('Sort by')+' ', :sorting, :first, :last, @sorting, [['created_at asc', _('Date(newest first)')], ['created_at desc', _('Date(oldest first)')], ['client_name asc', _('Client name(A-Z)')], ['client_name desc', _('Client name(Z-A)')]], :onchange => "jQuery('#bsc-plugin-contracts-form').submit()") %>
<% if @contracts.blank? %> <%= content_tag('em', _('There are no contracts at all.'))%> <% else %> <% @contracts.each do |contract| %> <% end %>
<%= link_to(content_tag('b', contract.client_name ), :action => 'view_contract', :contract_id => contract.id) %>
<%= content_tag('i', show_date(contract.created_at)) %>
<%= pagination_links @contracts %> <% end %> <% button_bar do %> <%= button(:back, _('Go back'), :controller => 'profile_editor') %> <%= button(:new, _('Create new contract'), :action => 'new_contract')%> <% end %>
<% end %>