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;
@ -543,27 +607,39 @@ h2{
transform: translate(180%, -15%);
}
// formulaire demande devis
.contact_page{
}
//formulaire
#footer table {
width: 100% !important;
max-width: auto;
border-collapse: collapse;
}
#footer{
table {
width: 100% !important;
max-width: auto;
border-collapse: collapse;
}
#footer .submit {
width: auto;
max-width: auto;
.submit {
width: auto;
max-width: auto;
}
margin-top: 0px;
}
.center {
margin: 20px;
}
#footer {
margin-top: 0px;
}
// articles
.actu .description {

View File

@ -11,6 +11,9 @@ class QuestionMailer < ActionMailer::Base
mail to: "info@nicolasbally.com,dmoiroud@ets-payre.fr",:reply_to => @contact.email.to_s, :subject => "[Contact site Energies 3P]"
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,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
-if contact.urgent
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:red;"}
%td{:style => "vertical-align:middle;"}
-if !contact.readed
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"}
%td
-if contact.urgent
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:red;"}
%td{:style => "vertical-align:middle;"}
-if !contact.readed
%span{:style => "display:inline-block;width:10px;height:10px;border-radius:50%;background:#00B3EC"}
%td{:style => "vertical-align:middle;"}
-if contact.provenance_id
=Category.find(contact.provenance_id).name
%td{:style => "vertical-align:middle;"}
-if contact.provenance_id
=Category.find(contact.provenance_id).name
%td
=l contact.created_at
%td
=contact.name
%td
=contact.cp
=contact.city
%td
=contact.small_comment
%td
=l contact.created_at
%td
=contact.name
%td
=contact.cp
=contact.city
%td
=contact.small_comment
%td
%td
-if contact.admin
-if contact.admin
%span{:style => "background:#{contact.admin.color};padding:5px 10px;"}
=contact.admin.username
%td.actions{:style => "width:430px;text-align:right;"}
%span{:style => "background:#{contact.admin.color};padding:5px 10px;"}
=contact.admin.username
%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
%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,29 +8,45 @@
-if @contact.raison_id == 4
-p_ids = []
%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}) :"
-p_ids << f.object.d_product_id
=link_to "supprimer ce produit", public_contact_product_path(:id => f.object.d_product_id), :method => :delete
-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.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
-DProduct.where(:orderable => true).where("icon_id is not null").where("id not in (?)", p_ids).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
-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