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; height:4px;
display:block; 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{ #footer{
margin-top:50px; margin-top:50px;
padding:20px 0; padding:20px 0;
@ -544,26 +608,38 @@ h2{
} }
// formulaire demande devis
.contact_page{
}
//formulaire //formulaire
#footer table { #footer{
width: 100% !important;
max-width: auto; table {
border-collapse: collapse; width: 100% !important;
max-width: auto;
border-collapse: collapse;
}
.submit {
width: auto;
max-width: auto;
}
margin-top: 0px;
} }
#footer .submit {
width: auto;
max-width: auto;
}
.center { .center {
margin: 20px; margin: 20px;
} }
#footer {
margin-top: 0px;
}
// articles // articles
.actu .description { .actu .description {

View File

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

View File

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

View File

@ -1,40 +1,41 @@
%tr.vertical_center.contact#contact{:id => contact.id} -if contact.contact_products.count > 0
%tr.vertical_center.contact#contact{:id => contact.id}
%td %td
-if contact.urgent -if contact.urgent
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:red;"} %span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:red;"}
%td{:style => "vertical-align:middle;"} %td{:style => "vertical-align:middle;"}
-if !contact.readed -if !contact.readed
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"} %span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"}
%td{:style => "vertical-align:middle;"} %td{:style => "vertical-align:middle;"}
-if contact.provenance_id -if contact.provenance_id
=Category.find(contact.provenance_id).name =Category.find(contact.provenance_id).name
%td %td
=l contact.created_at =l contact.created_at
%td %td
=contact.name =contact.name
%td %td
=contact.cp =contact.cp
=contact.city =contact.city
%td %td
=contact.small_comment =contact.small_comment
%td %td
-if contact.admin -if contact.admin
%span{:style => "background:#{contact.admin.color};padding:5px 10px;"} %span{:style => "background:#{contact.admin.color};padding:5px 10px;"}
=contact.admin.username =contact.admin.username
%td.actions{:style => "width:430px;text-align:right;"} %td.actions{:style => "width:430px;text-align:right;"}
= link_to ic(:"trash-o"), [:admin, contact], :confirm => 'Voulez-vous vraiment supprimer cet utilisateur ?', :method => :delete, :remote => true, :class => "btn btn-danger" = link_to ic(:"trash-o"), [:admin, contact], :confirm => 'Voulez-vous vraiment supprimer cet utilisateur ?', :method => :delete, :remote => true, :class => "btn btn-danger"
= link_to ic(:pencil)+" modifier / attribuer la fiche", edit_admin_contact_path(contact), :remote => true, :class => "btn btn-warning" = link_to ic(:pencil)+" modifier / attribuer la fiche", edit_admin_contact_path(contact), :remote => true, :class => "btn btn-warning"
= link_to ic(:eye)+ " détail de la fiche ", [:admin, contact], :class => "btn btn-primary" = link_to ic(:eye)+ " détail de la fiche ", [:admin, contact], :class => "btn btn-primary"

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 = 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 %h2 Interactions

View File

@ -61,6 +61,8 @@
%li= link_to "Produits", admin_d_products_path %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 -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}} .slide_home_wrapper.with_ratio{:style => "background-image:url('#{@img_url}');", :data => {:ratio => 0.35}}
=render :partial => "public/shared/menu_top" =render :partial => "public/shared/menu_top"

View File

@ -8,19 +8,26 @@
-if @contact.raison_id == 4 -if @contact.raison_id == 4
-p_ids = [] -p_ids = []
%table
=f.semantic_fields_for :contact_products do |f| -if @contact.contact_products.size > 0
%tr %h3
%td Ma demande concerne les produits suivants :
=f.hidden_field :d_product_id %table.contact_products_table.table
=image_tag f.object.d_product.icon.file.url =f.semantic_fields_for :contact_products do |f|
%td %tr
=f.input :qte, :label => "Quantité souhaitée (#{f.object.d_product.unit}) :" %td
-p_ids << f.object.d_product_id =f.hidden_field :d_product_id
=link_to "supprimer ce produit", public_contact_product_path(:id => f.object.d_product_id), :method => :delete =image_tag f.object.d_product.icon.file.url
%td
=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 %h3
Demander un devis pour les produits suivants également : Demander un devis pour les produits suivants également :
#products #products
@ -28,9 +35,18 @@
=link_to new_public_contact_product_path(:token => d_product.id) do =link_to new_public_contact_product_path(:token => d_product.id) do
=image_tag d_product.icon.file.url =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%;"} %table{:style => "border-collapse:collapse;width:100%;"}
%tr %tr