diff --git a/app/assets/javascripts/public.js.coffee b/app/assets/javascripts/public.js.coffee index fce4b39..f86154f 100755 --- a/app/assets/javascripts/public.js.coffee +++ b/app/assets/javascripts/public.js.coffee @@ -238,6 +238,13 @@ $("document").ready -> resize = -> + $(".with_ratio").each -> + ratio = parseFloat($(this).data("ratio")) + height = $(this).width()*ratio + + $(this).css("height",height+"px") + + $(".customer_message_list .height_frame").css "height" : $(".customer_message_show").height()+"px" min_height = 0 diff --git a/app/controllers/public/product_orders_controller.rb b/app/controllers/public/product_orders_controller.rb index 6032d5b..6b1c762 100755 --- a/app/controllers/public/product_orders_controller.rb +++ b/app/controllers/public/product_orders_controller.rb @@ -136,7 +136,7 @@ class Public::ProductOrdersController < ApplicationController @product_order = ProductOrder.find(session[:product_order_id]) @product_order.archive_now if !@product_order.product_order_payment_type_ok_id? - @product_order.product_order_payment_type_ok_id = 10 + @product_order.product_order_payment_type_ok_id = 2 end @product_order.force_payment = true @@ -170,18 +170,21 @@ class Public::ProductOrdersController < ApplicationController if @product_order.update_attributes(params.require(:product_order).permit!) - + if @product_order.product_order_payment_type_ok_id == 3 redirect_to paid_by_ogone_public_product_orders_path() else - if @product_order.product_order_payment_type_ok_id == 10 - @product_order_payment = ProductOrderPayment.create(:product_order_payment_type_id => @product_order.product_order_payment_type_ok_id) - @product_order.product_order_payments << @product_order_payment - @product_order.product_order_payment_ok = @product_order_payment + if [10, 1, 2, 4].include?(@product_order.product_order_payment_type_ok_id) + + @product_order_payment = ProductOrderPayment.create(:product_order_payment_type_id => @product_order.product_order_payment_type_ok_id) + + @product_order.product_order_payments << @product_order_payment + + @product_order.product_order_payment_ok = @product_order_payment + end - - + @product_order.completed_finish = true diff --git a/app/models/product.rb b/app/models/product.rb index d5e955d..7a71011 100755 --- a/app/models/product.rb +++ b/app/models/product.rb @@ -124,7 +124,7 @@ class Product < ActiveRecord::Base def tva - 0.0 + 0.20 end def price_ttc diff --git a/app/models/product_order.rb b/app/models/product_order.rb index 1c511d9..7d57ef0 100755 --- a/app/models/product_order.rb +++ b/app/models/product_order.rb @@ -198,7 +198,7 @@ class ProductOrder < ActiveRecord::Base def generate_bl_number - if !self.bl_number and self.product_order_payment_type_ok_id == 10 + if !self.bl_number and ([1,2,4,10].include?(self.product_order_payment_type_ok_id)) self.bl_year = self.updated_at.year diff --git a/app/views/admin/product_orders/_index_block.html.haml b/app/views/admin/product_orders/_index_block.html.haml index c68149f..91404ee 100755 --- a/app/views/admin/product_orders/_index_block.html.haml +++ b/app/views/admin/product_orders/_index_block.html.haml @@ -1,6 +1,7 @@ %table.table#product_orders %tr %th ID + %th Date %th Nom %th Pays d'exp. diff --git a/app/views/admin/product_orders/_product_order.html.haml b/app/views/admin/product_orders/_product_order.html.haml index a1f2023..126539d 100755 --- a/app/views/admin/product_orders/_product_order.html.haml +++ b/app/views/admin/product_orders/_product_order.html.haml @@ -1,6 +1,8 @@ %tr#product_order_row.product_order_row{:id => product_order.id, :class => ("success" if product_order)} %td =product_order.id + %td + =l product_order.created_at %td -if product_order.particular_bill =product_order.particular_bill.name diff --git a/app/views/admin/reseauxes/_form.html.haml b/app/views/admin/reseauxes/_form.html.haml index b3e0f31..f78a845 100755 --- a/app/views/admin/reseauxes/_form.html.haml +++ b/app/views/admin/reseauxes/_form.html.haml @@ -9,7 +9,7 @@ =f.inputs do =f.input :name, :label => "Nom du réseau : " - + =f.input :description, :label => "A propos : ", :input_html => {:class => "redactor_textarea"} -if !@reseaux.parent =f.input :chef_reseau, :label => "Chef réseau : ", :collection => Customer.where(:chef_reseau => true).pluck(Arel.sql("CONCAT(`firstname`, ' ', `name`)"), :id) @@ -18,3 +18,16 @@ .actions= f.submit "Sauvegarder", :class => "btn btn-primary" + + +:javascript + $(".redactor_textarea").redactor({ + + }); + +:css + .redactor-editor{ + padding: 24px 32px; + + border: 1px solid rgba(0, 0, 0, 0.07); + } \ No newline at end of file diff --git a/app/views/layouts/public.html.haml b/app/views/layouts/public.html.haml index ee8c85d..526d201 100755 --- a/app/views/layouts/public.html.haml +++ b/app/views/layouts/public.html.haml @@ -43,7 +43,7 @@ -if @reseaux_layout =link_to image_tag("/logo-mb.png", :id => "logo-mb"), "/" -if @reseaux_layout - .reseaux_top{:style => "background-image:url('"+(@reseaux.background_image_file.file.large.url if @reseaux.background_image_file).to_s+"');"} + .reseaux_top.with_ratio{:data => {:ratio => "0.2"},:style => "background-image:url('"+(@reseaux.background_image_file.file.large.url if @reseaux.background_image_file).to_s+"');"} =link_to "" do =image_tag @reseaux.logo_image_file.file.large.url, :class => "logo_reseaux" if @reseaux.logo_image_file diff --git a/app/views/layouts/vouisstar.html.haml b/app/views/layouts/vouisstar.html.haml index aa024a4..686c40a 100644 --- a/app/views/layouts/vouisstar.html.haml +++ b/app/views/layouts/vouisstar.html.haml @@ -64,18 +64,20 @@ .columns{ width:50%; float:left; - + box-sizing:border-box; + padding:0 10px; .inner{ background:rgba(255,255,255,0.8); max-width:480px; margin:auto; padding:20px; + } } html { margin: 0px; - height: 100%; + min-height: 100%; width: 100%; } @@ -97,4 +99,15 @@ } + } + + @media screen and (max-width: 800px) { + .columns{ + margin-bottom:50px; + width:auto; + padding:0 40px; + float:none; + + + } } \ No newline at end of file diff --git a/app/views/public/product_orders/my_cart.html.haml b/app/views/public/product_orders/my_cart.html.haml index b2b0af7..2865c19 100755 --- a/app/views/public/product_orders/my_cart.html.haml +++ b/app/views/public/product_orders/my_cart.html.haml @@ -30,8 +30,14 @@ =number_to_currency @product_order.vourcher_reduction .clear %div.boutique-right{:style => "width:auto;"} - = "Total : " + = "Total HT : " %strong=number_to_currency((@product_order.total_articles-@product_order.vourcher_reduction) , locale: :fr) + + .clear + %div.boutique-right{:style => "width:auto;"} + = "Total TTC : " + %strong=number_to_currency((@product_order.total_ttc) , locale: :fr) + .clear %br %br diff --git a/app/views/public/product_orders/particulars.html.haml b/app/views/public/product_orders/particulars.html.haml index 307faaa..7808206 100755 --- a/app/views/public/product_orders/particulars.html.haml +++ b/app/views/public/product_orders/particulars.html.haml @@ -1,4 +1,4 @@ -#my_cart +.padding.center#my_cart %h1 Coordonnées = semantic_form_for [:public,@product_order], :url => particulars_save_public_product_orders_path(), :html => { :method => :post, :onchange =>"cb_infos();"}do |f| diff --git a/app/views/public/product_orders/payment_instructions.html.haml b/app/views/public/product_orders/payment_instructions.html.haml index c8c21ba..5ba7b88 100644 --- a/app/views/public/product_orders/payment_instructions.html.haml +++ b/app/views/public/product_orders/payment_instructions.html.haml @@ -1,4 +1,5 @@ -.center +.padding.center + %h1="Merci pour votre commande !" %p @@ -9,7 +10,7 @@ %br =#%p Si vous souhaitez finalement payer cette commande par carte banque vous pouvez la retrouver dans votre compte client. - - - - + + + + diff --git a/app/views/public/product_orders/select_payment.html.haml b/app/views/public/product_orders/select_payment.html.haml index dd2c146..41a59da 100755 --- a/app/views/public/product_orders/select_payment.html.haml +++ b/app/views/public/product_orders/select_payment.html.haml @@ -1,4 +1,4 @@ -#my_cart +.padding.center#my_cart .order_recap %h1= "Validation de votre commande" %br @@ -55,14 +55,14 @@ - =f.input :product_order_payment_type_ok_id, :label => false, :collection => [["Pré-commande",10]], :as => :radio, :include_blank => false + =f.input :product_order_payment_type_ok_id, :label => false, :collection => [["Chèque",1], ["Virement",2],["Mandat administratif",4]], :as => :radio, :include_blank => false #["Pré-commande",10] .cb_infos = "Vous serez redirigé vers la page de paiement sécurisé." %br - =f.input :cgv, :label => "J'accepte les conditions générales de vente." + =f.input :cgv, :label => raw("J'accepte les conditions générales de vente.") .actions %center =f.submit "Valider ma commande", :class => "btn btn-primary order_button" diff --git a/app/views/public/products/index.html.haml b/app/views/public/products/index.html.haml index b492af4..76b526a 100644 --- a/app/views/public/products/index.html.haml +++ b/app/views/public/products/index.html.haml @@ -1,5 +1,7 @@ .center.row + + .intro=raw @reseaux.description %h1 Produits exclusifs réservés à ce réseau .boutique_body.products diff --git a/app/views/public/products/show.html.haml b/app/views/public/products/show.html.haml index 4055488..1785a3a 100755 --- a/app/views/public/products/show.html.haml +++ b/app/views/public/products/show.html.haml @@ -20,9 +20,16 @@ .price -if !@product.price_reduced_ht? - = number_to_currency(@product.price_ttc, locale: :fr) + = number_to_currency(@product.price_ht, locale: :fr) -else - = number_to_currency(@product.price_reduced_ttc, locale: :fr) + = number_to_currency(@product.price_reduced_ht, locale: :fr) + HT + + %div + %span{:style => "font-weight:normal;"} + = number_to_currency(@product.price_ttc, locale: :fr) + TTC + -if @product.price_reduced_ht? .price_reduced