This commit is contained in:
Nicolas Bally 2019-05-13 15:43:28 +02:00
parent fdc32381f8
commit 2978de6daa
8 changed files with 172 additions and 52 deletions

View File

@ -158,6 +158,70 @@ h1{
height:4px;
display:block;
}
a{
color: #428bca;
text-decoration:none;
}
.contact_page{
.contact_products_table{
img{
height:100px;
}
td{
padding:5px;
}
}
fieldset{
border:0;
padding:0;
margin:0;
}
table{
max-width:100%;
border-collapse:collapse;
td{
padding-bottom:12px;
}
}
input, textarea{
box-sizing:border-box;
padding:12px 15px;
font-size:1em;
width:100%;
border:1px solid black;
}
.error{
color:red;
}
.submit{
max-width:100%;
text-align:center;
padding:14px 0;
padding-top:0px;
}
.btn{
}
}
#footer{
margin-top:50px;
padding:20px 0;
@ -544,26 +608,38 @@ h2{
}
// formulaire demande devis
.contact_page{
}
//formulaire
#footer table {
#footer{
table {
width: 100% !important;
max-width: auto;
border-collapse: collapse;
}
#footer .submit {
.submit {
width: auto;
max-width: auto;
}
margin-top: 0px;
}
.center {
margin: 20px;
}
#footer {
margin-top: 0px;
}
// articles
.actu .description {

View File

@ -13,4 +13,7 @@ class QuestionMailer < ActionMailer::Base
end
end

View File

@ -35,6 +35,9 @@ class Contact < ActiveRecord::Base
end
self.contact_status = "En cours" if !self.contact_status?
end

View File

@ -1,3 +1,4 @@
-if contact.contact_products.count > 0
%tr.vertical_center.contact#contact{:id => contact.id}
%td

View File

@ -23,11 +23,29 @@
-if @contact.contact_products
%h3 Liste des produits demandés :
-@contact.contact_products.all.each do |cp|
.contact_product
%table
%tr
%td{:style => "padding-bottom:10px"}
=image_tag cp.d_product.icon.file.url, :style => "height:80px;"
%td
&nbsp;&nbsp;&nbsp;
=cp.qte
=cp.d_product.unit
= link_to 'Ajouter une action', new_admin_contact_action_path(:contact_id => @contact.id), :class => "btn btn-success", :style => "float:right;", :remote => true
%br
%br
%br
%h2 Interactions

View File

@ -61,6 +61,8 @@
%li= link_to "Produits", admin_d_products_path
%li= link_to "Demandes de devis", admin_d_products_path

View File

@ -145,6 +145,7 @@
});
-else
-@img_url = @img_url || "/public_medias/image_file/file/16/large_be38cbd1.jpeg"
.slide_home_wrapper.with_ratio{:style => "background-image:url('#{@img_url}');", :data => {:ratio => 0.35}}
=render :partial => "public/shared/menu_top"

View File

@ -8,19 +8,26 @@
-if @contact.raison_id == 4
-p_ids = []
%table
-if @contact.contact_products.size > 0
%h3
Ma demande concerne les produits suivants :
%table.contact_products_table.table
=f.semantic_fields_for :contact_products do |f|
%tr
%td
=f.hidden_field :d_product_id
=image_tag f.object.d_product.icon.file.url
%td
=f.input :qte, :label => "Quantité souhaitée (#{f.object.d_product.unit}) :"
=f.label :qte, "Quantité souhaitée (#{f.object.d_product.unit}) :"
%td
=f.input :qte, :label => false
-p_ids << f.object.d_product_id
%td
=link_to "supprimer ce produit", public_contact_product_path(:id => f.object.d_product_id), :method => :delete
-if p_ids.size < DProduct.where(:orderable => true).where("icon_id is not null").count.to_i
-if p_ids.size > 0 and p_ids.size < DProduct.where(:orderable => true).where("icon_id is not null").count.to_i
%h3
Demander un devis pour les produits suivants également :
#products
@ -28,9 +35,18 @@
=link_to new_public_contact_product_path(:token => d_product.id) do
=image_tag d_product.icon.file.url
-else
%h3
Demander un devis pour les produits suivants :
#products
-DProduct.where(:orderable => true).where("icon_id is not null").order(:name).each do |d_product|
=link_to new_public_contact_product_path(:token => d_product.id) do
=image_tag d_product.icon.file.url
%h3
Mes coordonnées :
%table{:style => "border-collapse:collapse;width:100%;"}
%tr