negos_app/app/views/admin/offers/index.html.haml
2015-12-10 15:47:05 +01:00

69 lines
2.1 KiB
Plaintext

-if @need
%h1
Gestion des offres pour le besoin
%strong= @need.title
%p.alert.alert-info
Seul les offres concernant le besoin
%strong= @need.title
sont affichées sur cette page.
%br
Pour voir toutes les offres, aller dans l'onglet
%strong Gestion des offres
depuis la barre de navigation
-else
%h1
Gestion des offres
%p.alert.alert-info
Cette page affiche toutes les offres existantes.
%br
Pour créer une offre, il faut d'abord choisir un besoin. Pour cela, passer par l'onglet
%strong Gestion des besoins
puis cliquer sur le bouton
%strong= i(:gift)
en face du besoin de votre choix.
-if @offers.length < 1
Aucune offre actuellement
-else
.row
.col-md-2
= semantic_form_for :search, :html => {id: :search_form, :method => :get } do |f|
= f.inputs do
= f.inputs do
=f.input :q, :as => :search, label: "Recherche", input_html: {value: params[:q], :name => 'q' }, placeholder: "Besoin ou fournisseur"
.clear
= f.input :o, as: :order, selected: params[:o], input_html: {:name => 'o' }, label: "Ordre d'affichage", :include_blank => false , :as => :select, :collection => @orders
.clear
= f.input :r, as: :result, selected: params[:r], input_html: {:name => 'r' }, label: 'Résultats par page', :include_blank => false , :as => :select, :collection => [10,20,50,100]
.clear
.col-md-10
%table.table.admin-table.table-hover.table-striped
%thead.rows_header
%tr
%th
Besoin
%th
Fournisseur
%th
Prix négocié
%th
\% de frais
%th{:style => "width:100px"}
&nbsp;
%tbody.rows
=render @offers
.pagination.pull-right= paginate @offers
%br
%br
-if @need
=link_to "Ajouter une offre", new_admin_need_offer_path(@need),class:"btn btn-primary"
:javascript
$('#search_o').change(function(){$('#search_form').submit()})
$('#search_r').change(function(){$('#search_form').submit()})