Début popup produits
This commit is contained in:
parent
8be2ad4ce9
commit
eed90a2d33
@ -42,7 +42,7 @@ function manager_show(url){
|
||||
|
||||
function manager_hide(){
|
||||
$("#manager_box_place").removeClass("manager_box_place_active");
|
||||
|
||||
$('#manager_box').html("");
|
||||
$("body").css("overflow", "auto");
|
||||
slider_enabled = null;
|
||||
|
||||
@ -239,3 +239,22 @@ function select_video_from_manager(input_id){
|
||||
}
|
||||
|
||||
|
||||
function select_product_from_manager(input_id){
|
||||
|
||||
|
||||
manager_prompt("/admin/p_product_refs.html?manager=true",function(m_return){
|
||||
|
||||
$('.p_product_ref_id_'+input_id).val(m_return.id);
|
||||
$('.p_product_ref_name_'+input_id).val(m_return.name);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function send_manager_product(product_id, product_name){
|
||||
|
||||
manager_send_response({id : product_id, name : product_name});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
#manager_box_place{
|
||||
position:fixed;
|
||||
height:0;
|
||||
width:100%;
|
||||
left:100px;
|
||||
right:30px;
|
||||
z-index:1500;
|
||||
top:0px;
|
||||
margin:0px;
|
||||
|
@ -58,6 +58,11 @@ class Admin::PProductRefsController < ApplicationController
|
||||
end
|
||||
|
||||
|
||||
if params[:manager].to_s == "true"
|
||||
@manager = true
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -17,8 +17,8 @@
|
||||
|
||||
|
||||
|
||||
.right.actions
|
||||
.large_actions
|
||||
.actions
|
||||
=link_to "Annuler", admin_p_customer_sheets_path(), :class => "btn"
|
||||
=form.submit "sauvegarder", :class => "btn btn-primary btn-ap-add"
|
||||
.clear
|
||||
|
||||
|
@ -31,6 +31,12 @@
|
||||
%td.actions
|
||||
=# link_to i(:"trash-o"), [:admin, p_product_ref], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer ce produit ? ' } , :remote => true if !PriceLine.where(:p_product_ref_id => p_product_ref).first
|
||||
=#debug PriceLine.where(:p_product_ref_id => p_product_ref.id).first
|
||||
|
||||
-if @manager
|
||||
= link_to i(:eye), admin_p_product_ref_path(p_product_ref), :remote => false, :target => "_blank"
|
||||
= link_to i(:"check"), "#",:onclick => "send_manager_product('"+p_product_ref.id.to_s+"', '"+escape_javascript(p_product_ref.member_label.to_s)+"');return false;"
|
||||
|
||||
-else
|
||||
= link_to i(:pencil), edit_admin_p_product_path(p_product_ref.p_product), :remote => false
|
||||
= link_to i(:eye), admin_p_product_ref_path(p_product_ref), :remote => false
|
||||
|
||||
|
@ -9,12 +9,15 @@
|
||||
|
||||
= form.input :ct_title, :label => "Designation personnalisée : " if @avoir
|
||||
%div{:class => ("error has-error" if form.object.errors[:p_product_ref_id].size > 0 )}
|
||||
|
||||
-key = SecureRandom.hex(6)
|
||||
|
||||
%label Produit :
|
||||
%input.p_product_ref_autocomplete_input.form-control{:type => "text", :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref)}
|
||||
%input.p_product_ref_autocomplete_input.form-control{:type => "text", :value => ("#{form.object.p_product_ref.ref} #{form.object.p_product_ref.cc_name}" if form.object.p_product_ref), :class => "p_product_ref_name_#{key}"}
|
||||
|
||||
|
||||
= form.hidden_field :p_product_ref_id, :class => "p_product_ref_id"
|
||||
|
||||
= form.hidden_field :p_product_ref_id, :class => "p_product_ref_id p_product_ref_id_#{key}"
|
||||
=link_to "selectionner un produit", "#", :onclick => "select_product_from_manager('#{key}');return false;"
|
||||
:javascript
|
||||
$( function() {
|
||||
|
||||
|
Reference in New Issue
Block a user