Merge branch 'add-article' into pre-prod
This commit is contained in:
commit
452601cd16
Binary file not shown.
89
app/controllers/admin/p_article_serial_nums_controller.rb
Normal file
89
app/controllers/admin/p_article_serial_nums_controller.rb
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PArticleSerialNumsController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_article_serial_nums = PArticleSerialNum.all
|
||||||
|
|
||||||
|
if params[:search][:p_serial_num_type_name].present?
|
||||||
|
@p_article_serial_nums = @p_article_serial_nums.where(p_serial_num_type_id: params[:search][:p_serial_num_type_name])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:p_product_ref_cc_name]
|
||||||
|
@p_article_serial_nums = @p_article_serial_nums.joins(:p_article, :p_product_ref).where("cc_name LIKE ?","#{params[:search][:p_product_ref_cc_name]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:value]
|
||||||
|
@p_article_serial_nums = @p_article_serial_nums.where("value LIKE ?","#{params[:search][:value]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
@p_article_serial_nums = sort_by_sorting(@p_article_serial_nums, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_article_serial_nums = @p_article_serial_nums.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_article_serial_num = PArticleSerialNum.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_article_serial_num = PArticleSerialNum.new
|
||||||
|
# @p_article_serial_num.build_p_serial_num_value
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_article_serial_num = PArticleSerialNum.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_article_serial_num = PArticleSerialNum.new(params.require(:p_article_serial_num).permit!)
|
||||||
|
|
||||||
|
if @p_article_serial_num.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_article_serial_num = PArticleSerialNum.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_article_serial_num.update_attributes(params.require(:p_article_serial_num).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_article_serial_num = PArticleSerialNum.find(params[:id])
|
||||||
|
@p_article_serial_num.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
104
app/controllers/admin/p_articles_controller.rb
Normal file
104
app/controllers/admin/p_articles_controller.rb
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PArticlesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_articles = PArticle.all
|
||||||
|
|
||||||
|
if params[:search][:p_product_color].to_s != ""
|
||||||
|
if params[:search][:p_product_color].to_s == "null"
|
||||||
|
@p_articles = @p_articles.joins(:p_product_ref).where("p_product_color_id = ?", nil)
|
||||||
|
else
|
||||||
|
@p_articles = @p_articles.joins(:p_product_ref).where("p_product_color_id = ?", params[:search][:p_product_color])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:p_product_ref_cc_name]
|
||||||
|
@p_articles = @p_articles.joins(:p_product_ref).where("cc_name LIKE ?", "#{params[:search][:p_product_ref_cc_name]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:p_grade_id]
|
||||||
|
@p_articles = @p_articles.where("p_grade_id LIKE ?", "#{params[:search][:p_grade_id]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:p_product_ref_cc_code]
|
||||||
|
@p_articles = @p_articles.joins(:p_product_ref).where("cc_code LIKE ?", "#{params[:search][:p_product_ref_cc_code]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
if params[:search][:p_article_serial_num]
|
||||||
|
@p_articles = @p_articles.joins(:p_article_serial_nums).where("value LIKE ?", "#{params[:search][:p_article_serial_num]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@p_articles = sort_by_sorting(@p_articles, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_articles = @p_articles.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_article = PArticle.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_article = PArticle.new
|
||||||
|
@p_article_serial_nums = @p_article.p_article_serial_nums.build
|
||||||
|
|
||||||
|
@p_serial_num_type = @p_article_serial_nums.build_p_serial_num_type
|
||||||
|
# @p_serial_num_value = @p_article_serial_nums.build_p_serial_num_value
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_article = PArticle.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_article = PArticle.new(params.require(:p_article).permit!)
|
||||||
|
|
||||||
|
if @p_article.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_article = PArticle.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_article.update_attributes(params.require(:p_article).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_article = PArticle.find(params[:id])
|
||||||
|
@p_article.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
76
app/controllers/admin/p_grades_controller.rb
Normal file
76
app/controllers/admin/p_grades_controller.rb
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PGradesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_grades = PGrade.all
|
||||||
|
|
||||||
|
@p_grades = sort_by_sorting(@p_grades, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_grades = @p_grades.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_grade = PGrade.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_grade = PGrade.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_grade = PGrade.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_grade = PGrade.new(params.require(:p_grade).permit!)
|
||||||
|
|
||||||
|
if @p_grade.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_grade = PGrade.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_grade.update_attributes(params.require(:p_grade).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_grade = PGrade.find(params[:id])
|
||||||
|
@p_grade.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
78
app/controllers/admin/p_product_ref_specs_controller.rb
Normal file
78
app/controllers/admin/p_product_ref_specs_controller.rb
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PProductRefSpecsController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_product_ref_specs = PProductRefSpec.all
|
||||||
|
|
||||||
|
@p_product_ref_specs = sort_by_sorting(@p_product_ref_specs, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_product_ref_specs = @p_product_ref_specs.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_product_ref_spec = PProductRefSpec.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_product_ref_spec = PProductRefSpec.new
|
||||||
|
@p_product_ref_spec.build_p_spec_type
|
||||||
|
@p_product_ref_spec.build_p_spec_value
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_product_ref_spec = PProductRefSpec.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_product_ref_spec = PProductRefSpec.new(params.require(:p_product_ref_spec).permit!)
|
||||||
|
|
||||||
|
if @p_product_ref_spec.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_product_ref_spec = PProductRefSpec.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_product_ref_spec.update_attributes(params.require(:p_product_ref_spec).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_product_ref_spec = PProductRefSpec.find(params[:id])
|
||||||
|
@p_product_ref_spec.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -73,8 +73,11 @@ class Admin::PProductsController < ApplicationController
|
|||||||
|
|
||||||
@p_product = PProduct.new #(:p_customer_cat_ids => [3])
|
@p_product = PProduct.new #(:p_customer_cat_ids => [3])
|
||||||
|
|
||||||
@p_product.p_product_refs << PProductRef.new
|
# @p_product.p_product_refs << PProductRef.new
|
||||||
|
@p_product_refs = @p_product.p_product_refs.build
|
||||||
|
@p_product_ref_specs = @p_product_refs.p_product_ref_specs.build
|
||||||
|
@p_spec_type = @p_product_ref_specs.build_p_spec_type
|
||||||
|
@p_spec_value = @p_product_ref_specs.build_p_spec_value
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
81
app/controllers/admin/p_serial_num_types_controller.rb
Normal file
81
app/controllers/admin/p_serial_num_types_controller.rb
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PSerialNumTypesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_serial_num_types = PSerialNumType.all
|
||||||
|
|
||||||
|
if params[:search][:name]
|
||||||
|
@p_serial_num_types = @p_serial_num_types.where("id = ?","#{params[:search][:name]}%")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@p_serial_num_types = sort_by_sorting(@p_serial_num_types, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_serial_num_types = @p_serial_num_types.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_serial_num_type = PSerialNumType.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_serial_num_type = PSerialNumType.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_serial_num_type = PSerialNumType.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_serial_num_type = PSerialNumType.new(params.require(:p_serial_num_type).permit!)
|
||||||
|
|
||||||
|
if @p_serial_num_type.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_serial_num_type = PSerialNumType.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_serial_num_type.update_attributes(params.require(:p_serial_num_type).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_serial_num_type = PSerialNumType.find(params[:id])
|
||||||
|
@p_serial_num_type.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
76
app/controllers/admin/p_serial_num_values_controller.rb
Normal file
76
app/controllers/admin/p_serial_num_values_controller.rb
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PSerialNumValuesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_serial_num_values = PSerialNumValue.all
|
||||||
|
|
||||||
|
@p_serial_num_values = sort_by_sorting(@p_serial_num_values, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_serial_num_values = @p_serial_num_values.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_serial_num_value = PSerialNumValue.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_serial_num_value = PSerialNumValue.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_serial_num_value = PSerialNumValue.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_serial_num_value = PSerialNumValue.new(params.require(:p_serial_num_value).permit!)
|
||||||
|
|
||||||
|
if @p_serial_num_value.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_serial_num_value = PSerialNumValue.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_serial_num_value.update_attributes(params.require(:p_serial_num_value).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_serial_num_value = PSerialNumValue.find(params[:id])
|
||||||
|
@p_serial_num_value.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
76
app/controllers/admin/p_spec_types_controller.rb
Normal file
76
app/controllers/admin/p_spec_types_controller.rb
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PSpecTypesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_spec_types = PSpecType.all
|
||||||
|
|
||||||
|
@p_spec_types = sort_by_sorting(@p_spec_types, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_spec_types = @p_spec_types.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_spec_type = PSpecType.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_spec_type = PSpecType.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_spec_type = PSpecType.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_spec_type = PSpecType.new(params.require(:p_spec_type).permit!)
|
||||||
|
|
||||||
|
if @p_spec_type.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_spec_type = PSpecType.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_spec_type.update_attributes(params.require(:p_spec_type).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_spec_type = PSpecType.find(params[:id])
|
||||||
|
@p_spec_type.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
76
app/controllers/admin/p_spec_values_controller.rb
Normal file
76
app/controllers/admin/p_spec_values_controller.rb
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# -*- encoding : utf-8 -*-
|
||||||
|
|
||||||
|
class Admin::PSpecValuesController < ApplicationController
|
||||||
|
layout "admin"
|
||||||
|
before_action :auth_admin
|
||||||
|
|
||||||
|
before_action :admin_space
|
||||||
|
|
||||||
|
def admin_space
|
||||||
|
@admin_space = "default"
|
||||||
|
end
|
||||||
|
|
||||||
|
def index
|
||||||
|
@p_spec_values = PSpecValue.all
|
||||||
|
|
||||||
|
@p_spec_values = sort_by_sorting(@p_spec_values, "id DESC")
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{
|
||||||
|
|
||||||
|
params[:search][:per_page] = params[:search][:per_page] || 100
|
||||||
|
per_page = params[:search][:per_page]
|
||||||
|
page = (params[:page] and params[:page] != "") ? params[:page] : 1
|
||||||
|
@p_spec_values = @p_spec_values.page(page).per(per_page)
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@p_spec_value = PSpecValue.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def new
|
||||||
|
@p_spec_value = PSpecValue.new
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def edit
|
||||||
|
@p_spec_value = PSpecValue.find(params[:id])
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
@p_spec_value = PSpecValue.new(params.require(:p_spec_value).permit!)
|
||||||
|
|
||||||
|
if @p_spec_value.save
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "new"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def update
|
||||||
|
@p_spec_value = PSpecValue.find(params[:id])
|
||||||
|
|
||||||
|
|
||||||
|
if @p_spec_value.update_attributes(params.require(:p_spec_value).permit!)
|
||||||
|
|
||||||
|
else
|
||||||
|
render action: "edit"
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
@p_spec_value = PSpecValue.find(params[:id])
|
||||||
|
@p_spec_value.destroy
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -65,13 +65,14 @@ class ApplicationController < ActionController::Base
|
|||||||
if current_admin.has_permission?("products")
|
if current_admin.has_permission?("products")
|
||||||
set_sub_menu :stocks, :p_products, "Produits", admin_p_products_path
|
set_sub_menu :stocks, :p_products, "Produits", admin_p_products_path
|
||||||
set_sub_menu :stocks, :p_product_refs, "Références", admin_p_product_refs_path
|
set_sub_menu :stocks, :p_product_refs, "Références", admin_p_product_refs_path
|
||||||
set_sub_menu :stocks, :promos_p_products, "Offres spots", promos_admin_p_products_path
|
set_sub_menu :stocks, :p_articles, "Articles", admin_p_articles_path
|
||||||
|
# set_sub_menu :stocks, :promos_p_products, "Offres spots", promos_admin_p_products_path
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if current_admin.has_permission?("product-cats")
|
if current_admin.has_permission?("product-cats")
|
||||||
set_sub_menu :stocks, :p_product_cats, "Catégories produits", admin_p_product_cats_path
|
set_sub_menu :stocks, :p_product_cats, "Catégories produits", admin_p_product_cats_path
|
||||||
set_sub_menu :stocks, :p_product_sub_cats, "Sous catégories produits", admin_p_product_sub_cats_path
|
# set_sub_menu :stocks, :p_product_sub_cats, "Sous catégories produits", admin_p_product_sub_cats_path
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -97,6 +98,11 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
if current_admin.has_permission?("boutique")
|
if current_admin.has_permission?("boutique")
|
||||||
set_sub_menu :stocks, :p_product_colors, "Couleurs"
|
set_sub_menu :stocks, :p_product_colors, "Couleurs"
|
||||||
|
set_sub_menu :stocks, :p_article_serial_nums, "Numeros série"
|
||||||
|
set_sub_menu :stocks, :p_serial_num_types, "Types de Numero série"
|
||||||
|
set_sub_menu :stocks, :p_product_ref_specs, "Specs"
|
||||||
|
set_sub_menu :stocks, :p_spec_values, "Valeur de specs"
|
||||||
|
set_sub_menu :stocks, :p_grades, "Grades"
|
||||||
set_sub_menu :stocks, :p_product_powers, "Types de chargeurs"
|
set_sub_menu :stocks, :p_product_powers, "Types de chargeurs"
|
||||||
set_sub_menu :stocks, :p_product_zones, "Zones produits"
|
set_sub_menu :stocks, :p_product_zones, "Zones produits"
|
||||||
|
|
||||||
|
28
app/models/p_article.rb
Normal file
28
app/models/p_article.rb
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
class PArticle < ApplicationRecord
|
||||||
|
belongs_to :p_grade
|
||||||
|
belongs_to :p_product_ref
|
||||||
|
has_one :p_product, through: :p_product_ref
|
||||||
|
has_one :p_product_color, through: :p_product_ref
|
||||||
|
|
||||||
|
has_many :p_article_serial_nums, dependent: :destroy
|
||||||
|
has_many :p_serial_num_values, through: :p_article_serial_nums
|
||||||
|
accepts_nested_attributes_for :p_article_serial_nums
|
||||||
|
|
||||||
|
validates_presence_of :p_product_ref
|
||||||
|
# has_many :p_product_ref_specs, through: :p_product_ref
|
||||||
|
# accepts_nested_attributes_for :p_product_ref_specs
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "id", :reorder => true},
|
||||||
|
:p_product_ref_code => {:name => "Code ref", :reorder => true},
|
||||||
|
:p_product_ref => {:name => "Désignation", :reorder => true},
|
||||||
|
:p_grade => {:name => "Grade", :reorder => true},
|
||||||
|
:color => {:name => "Couleur"},
|
||||||
|
:p_article_serial_nums => {:name => "N° identifiants"},
|
||||||
|
:actions => {:name => "Actions", :reorder => false},
|
||||||
|
}
|
||||||
|
|
||||||
|
def member_label
|
||||||
|
"#{p_product_ref.cc_name}"
|
||||||
|
end
|
||||||
|
end
|
19
app/models/p_article_serial_num.rb
Normal file
19
app/models/p_article_serial_num.rb
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
class PArticleSerialNum < ApplicationRecord
|
||||||
|
belongs_to :p_article
|
||||||
|
belongs_to :p_serial_num_type
|
||||||
|
belongs_to :p_serial_num_value, inverse_of: :p_article_serial_nums
|
||||||
|
has_one :p_product_ref, through: :p_article
|
||||||
|
# accepts_nested_attributes_for :p_serial_num_value
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "ID"},
|
||||||
|
:p_article => {:name => "Article", :reorder => true},
|
||||||
|
:p_article_id => {:name => "Article ID", :reorder => true},
|
||||||
|
:p_serial_num_type => {:name => "Type", :reorder => true},
|
||||||
|
:value => {:name => "N°", :reorder => true},
|
||||||
|
|
||||||
|
:actions => {:name => "Actions", :reorder => true}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
10
app/models/p_grade.rb
Normal file
10
app/models/p_grade.rb
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
class PGrade < ApplicationRecord
|
||||||
|
has_many :p_articles
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "id", :reorder => true},
|
||||||
|
:grade => {:name => "Grade", :reorder => true},
|
||||||
|
:actions => {:name => "Actions", :reorder => false},
|
||||||
|
}
|
||||||
|
|
||||||
|
end
|
@ -5,8 +5,6 @@ class PProduct < ApplicationRecord
|
|||||||
has_many :p_product_refs, :dependent => :destroy
|
has_many :p_product_refs, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :p_product_refs, allow_destroy: true
|
accepts_nested_attributes_for :p_product_refs, allow_destroy: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
has_many :p_product_ingredients, :dependent => :destroy
|
has_many :p_product_ingredients, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :p_product_ingredients, allow_destroy: true
|
accepts_nested_attributes_for :p_product_ingredients, allow_destroy: true
|
||||||
|
|
||||||
@ -17,6 +15,14 @@ class PProduct < ApplicationRecord
|
|||||||
has_many :p_product_nutris, :dependent => :destroy
|
has_many :p_product_nutris, :dependent => :destroy
|
||||||
accepts_nested_attributes_for :p_product_nutris, allow_destroy: true
|
accepts_nested_attributes_for :p_product_nutris, allow_destroy: true
|
||||||
|
|
||||||
|
has_many :p_articles, through: :p_product_refs
|
||||||
|
|
||||||
|
# has_many :p_product_ref_specs, through: :p_product_refs
|
||||||
|
# accepts_nested_attributes_for :p_product_ref_specs
|
||||||
|
# # has_many :p_spec_types, through: :p_product_ref_specs
|
||||||
|
# has_many :p_spec_values, through: :p_product_ref_specs
|
||||||
|
# accepts_nested_attributes_for :p_spec_types, allow_destroy: true
|
||||||
|
# accepts_nested_attributes_for :p_spec_values, allow_destroy: true
|
||||||
|
|
||||||
|
|
||||||
has_many :p_product_images
|
has_many :p_product_images
|
||||||
|
@ -10,6 +10,13 @@ class PProductRef < ApplicationRecord
|
|||||||
|
|
||||||
belongs_to :p_product_color
|
belongs_to :p_product_color
|
||||||
|
|
||||||
|
has_many :p_articles
|
||||||
|
has_many :p_article_serial_nums, through: :p_articles
|
||||||
|
accepts_nested_attributes_for :p_article_serial_nums, allow_destroy: true
|
||||||
|
|
||||||
|
has_many :p_product_ref_specs
|
||||||
|
accepts_nested_attributes_for :p_product_ref_specs, allow_destroy: true
|
||||||
|
|
||||||
#validates :ct_price_ht, :presence => true
|
#validates :ct_price_ht, :presence => true
|
||||||
|
|
||||||
|
|
||||||
@ -64,7 +71,9 @@ class PProductRef < ApplicationRecord
|
|||||||
|
|
||||||
|
|
||||||
def ca_name
|
def ca_name
|
||||||
self.p_product.name if self.p_product
|
if self.p_product
|
||||||
|
self.p_product.name + " - " + self.ct_sub_name
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def ca_code
|
def ca_code
|
||||||
|
18
app/models/p_product_ref_spec.rb
Normal file
18
app/models/p_product_ref_spec.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class PProductRefSpec < ApplicationRecord
|
||||||
|
belongs_to :p_product_ref
|
||||||
|
belongs_to :p_spec_type
|
||||||
|
belongs_to :p_spec_value
|
||||||
|
|
||||||
|
accepts_nested_attributes_for :p_spec_type, :p_spec_value
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "ID"},
|
||||||
|
:p_product_ref => {:name => "Référence produit", :reorder => true},
|
||||||
|
:p_product_ref_id => {:name => "ID Ref produit", :reorder => true},
|
||||||
|
:p_spec_type => {:name => "Type", :reorder => true},
|
||||||
|
:p_spec_value => {:name => "Valeur", :reorder => true},
|
||||||
|
|
||||||
|
:actions => {:name => "Actions", :reorder => true}
|
||||||
|
|
||||||
|
}
|
||||||
|
end
|
9
app/models/p_serial_num_type.rb
Normal file
9
app/models/p_serial_num_type.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class PSerialNumType < ApplicationRecord
|
||||||
|
has_many :p_article_serial_nums
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "id", :reorder => true},
|
||||||
|
:name => {:name => "Type", :reorder => true},
|
||||||
|
:actions => {:name => "Actions", :reorder => false},
|
||||||
|
}
|
||||||
|
end
|
4
app/models/p_serial_num_value.rb
Normal file
4
app/models/p_serial_num_value.rb
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class PSerialNumValue < ApplicationRecord
|
||||||
|
has_many :p_article_serial_nums, inverse_of: :p_serial_num_value
|
||||||
|
has_many :p_articles, through: :p_article_serial_nums
|
||||||
|
end
|
5
app/models/p_spec_type.rb
Normal file
5
app/models/p_spec_type.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class PSpecType < ApplicationRecord
|
||||||
|
has_many :p_product_ref_specs
|
||||||
|
|
||||||
|
TYPES = ["Ram", "Stockage"]
|
||||||
|
end
|
18
app/models/p_spec_value.rb
Normal file
18
app/models/p_spec_value.rb
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
class PSpecValue < ApplicationRecord
|
||||||
|
has_many :p_product_ref_specs
|
||||||
|
|
||||||
|
UNITS = ["Go", "Mo"]
|
||||||
|
|
||||||
|
def member_label
|
||||||
|
"#{value} #{unit}"
|
||||||
|
end
|
||||||
|
|
||||||
|
acts_as_sorting :fields => {
|
||||||
|
:id => {:name => "ID"},
|
||||||
|
:value => {:name => "Valeur", :reorder => true},
|
||||||
|
:unit => {:name => "Unité", :reorder => true},
|
||||||
|
:actions => {:name => "Actions", :reorder => true}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
end
|
19
app/views/admin/p_article_serial_nums/_form.html.haml
Normal file
19
app/views/admin/p_article_serial_nums/_form.html.haml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
- if params[:controller] == "admin/p_article_serial_nums"
|
||||||
|
=semantic_form_for [:admin, @p_article_serial_num], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :p_article, as: :select, collection: PArticle.all ,:label => f.object.label_for(:p_article_id), member_label: :member_label
|
||||||
|
= f.input :p_serial_num_type_id, :label => "type", as: :select, collection: PSerialNumType.pluck(:name, :id)
|
||||||
|
|
||||||
|
= f.input :value
|
||||||
|
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
||||||
|
- else
|
||||||
|
.p_article_serial_nums_form.field
|
||||||
|
=form.inputs do
|
||||||
|
= form.input :p_serial_num_type_id, :label => "type", as: :select, collection: PSerialNumType.pluck(:name, :id)
|
||||||
|
= form.input :value
|
||||||
|
|
@ -0,0 +1,38 @@
|
|||||||
|
%tr#p_article_serial_num_row{:id => p_article_serial_num.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:p_article_id] = capture do
|
||||||
|
%td
|
||||||
|
= p_article_serial_num.p_article.id
|
||||||
|
|
||||||
|
-tr[:p_article] = capture do
|
||||||
|
%td
|
||||||
|
= p_article_serial_num.p_article.p_product.name
|
||||||
|
\-
|
||||||
|
= p_article_serial_num.p_article.p_product_ref.ct_sub_name
|
||||||
|
\-
|
||||||
|
= p_article_serial_num.p_article.p_product_ref.p_product_color.name
|
||||||
|
|
||||||
|
|
||||||
|
-tr[:p_serial_num_type] = capture do
|
||||||
|
%td
|
||||||
|
= p_article_serial_num.p_serial_num_type.name
|
||||||
|
|
||||||
|
-tr[:value] = capture do
|
||||||
|
%td
|
||||||
|
= p_article_serial_num.value
|
||||||
|
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_article_serial_num], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_article_serial_num_path(p_article_serial_num), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_article_serial_num_path(p_article_serial_num), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_article_serial_num}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_article_serial_nums/create.js.erb
Normal file
2
app/views/admin/p_article_serial_nums/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_article_serial_nums_rows').prepend("<%= escape_javascript(render(@p_article_serial_num))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_article_serial_nums/destroy.js.erb
Normal file
1
app/views/admin/p_article_serial_nums/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_article_serial_num_row_<%= @p_article_serial_num.id %>').remove();
|
1
app/views/admin/p_article_serial_nums/edit.js.erb
Normal file
1
app/views/admin/p_article_serial_nums/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
30
app/views/admin/p_article_serial_nums/index.html.haml
Normal file
30
app/views/admin/p_article_serial_nums/index.html.haml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_article_serial_num_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PArticleSerialNum.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=hidden_field_tag :column, params[:column]
|
||||||
|
=hidden_field_tag :direction, params[:direction]
|
||||||
|
|
||||||
|
%table
|
||||||
|
%tr
|
||||||
|
%td Type :
|
||||||
|
%td=select_tag "search[p_serial_num_type_name]", options_for_select([["",""],["Aucune","null"]]+PSerialNumType.pluck(:name, :id), params[:search][:p_serial_num_type_name]), class: "custom-select"
|
||||||
|
|
||||||
|
%td=text_field_tag "search[p_product_ref_cc_name]", params[:search][:p_product_ref_cc_name],:class => "form-control", :placeholder => "Article"
|
||||||
|
|
||||||
|
%td=text_field_tag "search[value]", params[:search][:value],:class => "form-control", :placeholder => "N° de serie"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_article_serial_nums}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_article_serial_nums}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_article_serial_nums/new.js.erb
Normal file
1
app/views/admin/p_article_serial_nums/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_article_serial_nums/show.html.haml
Normal file
10
app/views/admin/p_article_serial_nums/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_article_serial_num
|
2
app/views/admin/p_article_serial_nums/update.js.erb
Normal file
2
app/views/admin/p_article_serial_nums/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_article_serial_num_row_<%= @p_article_serial_num.id %>').replaceWith("<%= escape_javascript(render(@p_article_serial_num))%>");
|
||||||
|
close_pane_hover();
|
19
app/views/admin/p_articles/_form.html.haml
Normal file
19
app/views/admin/p_articles/_form.html.haml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
=semantic_form_for [:admin, @p_article], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :p_product_ref, as: :select, collection: PProductRef.all.distinct, :label => f.object.label_for(:p_product_ref)
|
||||||
|
= f.input :p_grade, as: :select, collection: PGrade.pluck(:grade, :id), :label => "Grade"
|
||||||
|
%h4 Numero de série :
|
||||||
|
.p_article_serial_nums_form
|
||||||
|
= f.semantic_fields_for :p_article_serial_nums do |form|
|
||||||
|
=render :partial => "admin/p_article_serial_nums/form", :locals => {:form => form}
|
||||||
|
%p= link_to_add_fields "Ajouter un numéro de série", f, :p_article_serial_nums, {:class => "btn btn-primary"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
43
app/views/admin/p_articles/_p_article.html.haml
Normal file
43
app/views/admin/p_articles/_p_article.html.haml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
%tr#p_article_row{:id => p_article.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:p_product_ref_code] = capture do
|
||||||
|
%td
|
||||||
|
= p_article.p_product_ref.code
|
||||||
|
|
||||||
|
-tr[:p_grade] = capture do
|
||||||
|
%td
|
||||||
|
= p_article.p_grade.grade
|
||||||
|
|
||||||
|
-tr[:color] = capture do
|
||||||
|
%td
|
||||||
|
= p_article.p_product_ref.p_product_color.color
|
||||||
|
|
||||||
|
-tr[:p_product_ref] = capture do
|
||||||
|
%td
|
||||||
|
= p_article.p_product_ref.p_product.name
|
||||||
|
\-
|
||||||
|
= p_article.p_product_ref.ct_sub_name
|
||||||
|
\-
|
||||||
|
= p_article.p_product_ref.p_product_color.name
|
||||||
|
|
||||||
|
-tr[:p_article_serial_nums] = capture do
|
||||||
|
%td
|
||||||
|
- p_article.p_article_serial_nums.each do |sn|
|
||||||
|
= sn.p_serial_num_type.name + " : " + sn.value
|
||||||
|
%br
|
||||||
|
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_article], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_article_path(p_article), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_article_path(p_article), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_article}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_articles/create.js.erb
Normal file
2
app/views/admin/p_articles/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_articles_rows').prepend("<%= escape_javascript(render(@p_article))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_articles/destroy.js.erb
Normal file
1
app/views/admin/p_articles/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_article_row_<%= @p_article.id %>').remove();
|
1
app/views/admin/p_articles/edit.js.erb
Normal file
1
app/views/admin/p_articles/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
35
app/views/admin/p_articles/index.html.haml
Normal file
35
app/views/admin/p_articles/index.html.haml
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_article_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PArticle.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=hidden_field_tag :column, params[:column]
|
||||||
|
=hidden_field_tag :direction, params[:direction]
|
||||||
|
|
||||||
|
%table
|
||||||
|
%tr
|
||||||
|
%td=text_field_tag "search[p_product_ref_cc_code]", params[:search][:p_product_ref_cc_code],:class => "form-control", :placeholder => "Code"
|
||||||
|
|
||||||
|
%td=text_field_tag "search[p_product_ref_cc_name]", params[:search][:p_product_ref_cc_name],:class => "form-control", :placeholder => "Article"
|
||||||
|
|
||||||
|
%td=text_field_tag "search[p_article_serial_num]", params[:search][:p_article_serial_num],:class => "form-control", :placeholder => "N° de serie"
|
||||||
|
|
||||||
|
%td.pl-2 Grade :
|
||||||
|
%td=select_tag "search[p_grade_id]", options_for_select([["",""],["Aucune","null"]]+PGrade.pluck(:grade, :id), params[:search][:p_grade_id]), class: "custom-select"
|
||||||
|
|
||||||
|
%td.pl-2 Couleur :
|
||||||
|
%td
|
||||||
|
=select_tag "search[p_product_color]", options_for_select([["",""],["Aucune","null"]]+PProductColor.pluck(:color, :id), params[:search][:p_product_color]),class: "custom-select"
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_articles}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_articles}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_articles/new.js.erb
Normal file
1
app/views/admin/p_articles/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_articles/show.html.haml
Normal file
10
app/views/admin/p_articles/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_article
|
2
app/views/admin/p_articles/update.js.erb
Normal file
2
app/views/admin/p_articles/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_article_row_<%= @p_article.id %>').replaceWith("<%= escape_javascript(render(@p_article))%>");
|
||||||
|
close_pane_hover();
|
12
app/views/admin/p_grades/_form.html.haml
Normal file
12
app/views/admin/p_grades/_form.html.haml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
=semantic_form_for [:admin, @p_grade], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :grade, :label => f.object.label_for(:grade)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
16
app/views/admin/p_grades/_p_grade.html.haml
Normal file
16
app/views/admin/p_grades/_p_grade.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%tr#p_grade_row{:id => p_grade.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_grade], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_grade_path(p_grade), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_grade_path(p_grade), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_grade}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_grades/create.js.erb
Normal file
2
app/views/admin/p_grades/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_grades_rows').prepend("<%= escape_javascript(render(@p_grade))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_grades/destroy.js.erb
Normal file
1
app/views/admin/p_grades/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_grade_row_<%= @p_grade.id %>').remove();
|
1
app/views/admin/p_grades/edit.js.erb
Normal file
1
app/views/admin/p_grades/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
16
app/views/admin/p_grades/index.html.haml
Normal file
16
app/views/admin/p_grades/index.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_grade_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PGrade.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_grades}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_grades}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_grades/new.js.erb
Normal file
1
app/views/admin/p_grades/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_grades/show.html.haml
Normal file
10
app/views/admin/p_grades/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_grade
|
2
app/views/admin/p_grades/update.js.erb
Normal file
2
app/views/admin/p_grades/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_grade_row_<%= @p_grade.id %>').replaceWith("<%= escape_javascript(render(@p_grade))%>");
|
||||||
|
close_pane_hover();
|
36
app/views/admin/p_product_ref_specs/_form.html.haml
Normal file
36
app/views/admin/p_product_ref_specs/_form.html.haml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
- if params[:controller] == "admin/p_product_ref_specs"
|
||||||
|
=semantic_form_for [:admin, @p_product_ref_spec], :remote => true do |f|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :p_product_ref, as: :select, collection: PProductRef.pluck(:cc_name, :id) ,:label => f.object.label_for(:p_product_ref)
|
||||||
|
= f.semantic_fields_for :p_spec_type do | form |
|
||||||
|
=render :partial => "admin/p_spec_types/form", :locals => {:f => form}
|
||||||
|
= f.semantic_fields_for :p_spec_value do | form |
|
||||||
|
=render :partial => "admin/p_spec_values/form", :locals => {:f => form}
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
||||||
|
- else
|
||||||
|
.p_product_ref_spec_form.field
|
||||||
|
%table
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
%h4 spec :
|
||||||
|
|
||||||
|
%td
|
||||||
|
-#form.object.p_spec_type = PSpecType.new if !form.object.p_spec_type
|
||||||
|
-#form.object.p_spec_value = PSpecValue.new if !form.object.p_spec_value
|
||||||
|
|
||||||
|
= form.input :p_spec_type_id, :label => "Type", as: :select, collection: PSpecType.all, :include_blank => false
|
||||||
|
%td
|
||||||
|
= form.input :p_spec_value_id, :label => "Valeur", as: :select, collection: PSpecValue.all, :include_blank => false, :member_label => :member_label
|
||||||
|
|
||||||
|
|
||||||
|
=#form.inputs do
|
||||||
|
=# form.semantic_fields_for :p_spec_type do | f |
|
||||||
|
=#render :partial => "admin/p_spec_types/form", :locals => {:f => f}
|
||||||
|
=# form.semantic_fields_for :p_spec_value do | f |
|
||||||
|
=# render :partial => "admin/p_spec_values/form", :locals => {:f => f}
|
||||||
|
%tr
|
||||||
|
%td
|
||||||
|
= link_to_remove_fields ic(:"trash-o"), form
|
@ -0,0 +1,31 @@
|
|||||||
|
%tr#p_product_ref_spec_row{:id => p_product_ref_spec.id}
|
||||||
|
-tr = {}
|
||||||
|
-tr[:p_product_ref] = capture do
|
||||||
|
%td
|
||||||
|
= p_product_ref_spec.p_product_ref.cc_name
|
||||||
|
|
||||||
|
-tr[:p_product_ref_id] = capture do
|
||||||
|
%td
|
||||||
|
= p_product_ref_spec.p_product_ref.id
|
||||||
|
|
||||||
|
-tr[:p_spec_type] = capture do
|
||||||
|
%td
|
||||||
|
= p_product_ref_spec.p_spec_type.name
|
||||||
|
-tr[:p_spec_value] = capture do
|
||||||
|
%td
|
||||||
|
= p_product_ref_spec.p_spec_value.value
|
||||||
|
= p_product_ref_spec.p_spec_value.unit
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_product_ref_spec], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_product_ref_spec_path(p_product_ref_spec), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_product_ref_spec_path(p_product_ref_spec), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_product_ref_spec}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_product_ref_specs/create.js.erb
Normal file
2
app/views/admin/p_product_ref_specs/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_product_ref_specs_rows').prepend("<%= escape_javascript(render(@p_product_ref_spec))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_product_ref_specs/destroy.js.erb
Normal file
1
app/views/admin/p_product_ref_specs/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_product_ref_spec_row_<%= @p_product_ref_spec.id %>').remove();
|
1
app/views/admin/p_product_ref_specs/edit.js.erb
Normal file
1
app/views/admin/p_product_ref_specs/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
16
app/views/admin/p_product_ref_specs/index.html.haml
Normal file
16
app/views/admin/p_product_ref_specs/index.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_product_ref_spec_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PProductRefSpec.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_product_ref_specs}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_product_ref_specs}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_product_ref_specs/new.js.erb
Normal file
1
app/views/admin/p_product_ref_specs/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_product_ref_specs/show.html.haml
Normal file
10
app/views/admin/p_product_ref_specs/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_product_ref_spec
|
2
app/views/admin/p_product_ref_specs/update.js.erb
Normal file
2
app/views/admin/p_product_ref_specs/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_product_ref_spec_row_<%= @p_product_ref_spec.id %>').replaceWith("<%= escape_javascript(render(@p_product_ref_spec))%>");
|
||||||
|
close_pane_hover();
|
@ -4,10 +4,8 @@
|
|||||||
|
|
||||||
%table.form-table
|
%table.form-table
|
||||||
%tr
|
%tr
|
||||||
%td
|
=# form.input :enabled, :label => "Actif ?"
|
||||||
=# form.input :enabled, :label => "Actif ?"
|
=# form.input :assembled, :label => "Assemblé ?", :input_html => {:onchange => 'if ($(this).is(":checked")) {$(this).closest(".field").find(".p_product_assembleds_part").show();}else{$(this).closest(".field").find(".p_product_assembleds_part").hide();}'}
|
||||||
%td
|
|
||||||
=# form.input :assembled, :label => "Assemblé ?", :input_html => {:onchange => 'if ($(this).is(":checked")) {$(this).closest(".field").find(".p_product_assembleds_part").show();}else{$(this).closest(".field").find(".p_product_assembleds_part").hide();}'}
|
|
||||||
|
|
||||||
%td
|
%td
|
||||||
= form.input :ref, :label => "Réf int. :"
|
= form.input :ref, :label => "Réf int. :"
|
||||||
@ -22,7 +20,15 @@
|
|||||||
%td
|
%td
|
||||||
=form.input :p_product_color_id, :label => "Couleur :", :collection => PProductColor.all, :as => :select, :include_blank => true
|
=form.input :p_product_color_id, :label => "Couleur :", :collection => PProductColor.all, :as => :select, :include_blank => true
|
||||||
|
|
||||||
=# form.input :s_brand_id, :label => "Marque :", :collection => SBrand.all, :as => :select, :include_blank => true
|
|
||||||
|
|
||||||
|
%tr
|
||||||
|
%td{:colspan => 4}
|
||||||
|
.p_product_ref_specs_form
|
||||||
|
= form.semantic_fields_for :p_product_ref_specs do |f|
|
||||||
|
=render :partial => "admin/p_product_ref_specs/form", :locals => {:form => f}
|
||||||
|
%p= link_to_add_fields "Ajouter une spec", form, :p_product_ref_specs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
|
12
app/views/admin/p_serial_num_types/_form.html.haml
Normal file
12
app/views/admin/p_serial_num_types/_form.html.haml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
=semantic_form_for [:admin, @p_serial_num_type], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :name, :label => f.object.label_for(:name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
%tr#p_serial_num_type_row{:id => p_serial_num_type.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_serial_num_type], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_serial_num_type_path(p_serial_num_type), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_serial_num_type_path(p_serial_num_type), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_serial_num_type}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_serial_num_types/create.js.erb
Normal file
2
app/views/admin/p_serial_num_types/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_serial_num_types_rows').prepend("<%= escape_javascript(render(@p_serial_num_type))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_serial_num_types/destroy.js.erb
Normal file
1
app/views/admin/p_serial_num_types/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_serial_num_type_row_<%= @p_serial_num_type.id %>').remove();
|
1
app/views/admin/p_serial_num_types/edit.js.erb
Normal file
1
app/views/admin/p_serial_num_types/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
24
app/views/admin/p_serial_num_types/index.html.haml
Normal file
24
app/views/admin/p_serial_num_types/index.html.haml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_serial_num_type_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PSerialNumType.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=hidden_field_tag :column, params[:column]
|
||||||
|
=hidden_field_tag :direction, params[:direction]
|
||||||
|
|
||||||
|
%table
|
||||||
|
%tr
|
||||||
|
%td Type :
|
||||||
|
%td=select_tag "search[name]", options_for_select([["",""],["Aucune","null"]]+PSerialNumType.pluck(:name, :id), params[:search][:name]), class: "custom-select"
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_serial_num_types}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_serial_num_types}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_serial_num_types/new.js.erb
Normal file
1
app/views/admin/p_serial_num_types/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_serial_num_types/show.html.haml
Normal file
10
app/views/admin/p_serial_num_types/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_serial_num_type
|
2
app/views/admin/p_serial_num_types/update.js.erb
Normal file
2
app/views/admin/p_serial_num_types/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_serial_num_type_row_<%= @p_serial_num_type.id %>').replaceWith("<%= escape_javascript(render(@p_serial_num_type))%>");
|
||||||
|
close_pane_hover();
|
12
app/views/admin/p_serial_num_values/_form.html.haml
Normal file
12
app/views/admin/p_serial_num_values/_form.html.haml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
/ =semantic_form_for [:admin, @p_serial_num_value], :remote => true do |f|
|
||||||
|
|
||||||
|
|
||||||
|
=f.inputs do
|
||||||
|
= f.input :value, :label => "Numéro"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/ .actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
%tr#p_serial_num_value_row{:id => p_serial_num_value.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_serial_num_value], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_serial_num_value_path(p_serial_num_value), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_serial_num_value_path(p_serial_num_value), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_serial_num_value}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_serial_num_values/create.js.erb
Normal file
2
app/views/admin/p_serial_num_values/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_serial_num_values_rows').prepend("<%= escape_javascript(render(@p_serial_num_value))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_serial_num_values/destroy.js.erb
Normal file
1
app/views/admin/p_serial_num_values/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_serial_num_value_row_<%= @p_serial_num_value.id %>').remove();
|
1
app/views/admin/p_serial_num_values/edit.js.erb
Normal file
1
app/views/admin/p_serial_num_values/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
16
app/views/admin/p_serial_num_values/index.html.haml
Normal file
16
app/views/admin/p_serial_num_values/index.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_serial_num_value_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PSerialNumValue.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_serial_num_values}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_serial_num_values}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_serial_num_values/new.js.erb
Normal file
1
app/views/admin/p_serial_num_values/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_serial_num_values/show.html.haml
Normal file
10
app/views/admin/p_serial_num_values/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_serial_num_value
|
2
app/views/admin/p_serial_num_values/update.js.erb
Normal file
2
app/views/admin/p_serial_num_values/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_serial_num_value_row_<%= @p_serial_num_value.id %>').replaceWith("<%= escape_javascript(render(@p_serial_num_value))%>");
|
||||||
|
close_pane_hover();
|
2
app/views/admin/p_spec_types/_form.html.haml
Normal file
2
app/views/admin/p_spec_types/_form.html.haml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
=f.inputs do
|
||||||
|
= f.input :name, :label => "Type", as: :select, collection: PSpecType::TYPES
|
16
app/views/admin/p_spec_types/_p_spec_type.html.haml
Normal file
16
app/views/admin/p_spec_types/_p_spec_type.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%tr#p_spec_type_row{:id => p_spec_type.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_spec_type], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_spec_type_path(p_spec_type), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_spec_type_path(p_spec_type), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_spec_type}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_spec_types/create.js.erb
Normal file
2
app/views/admin/p_spec_types/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_spec_types_rows').prepend("<%= escape_javascript(render(@p_spec_type))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_spec_types/destroy.js.erb
Normal file
1
app/views/admin/p_spec_types/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_spec_type_row_<%= @p_spec_type.id %>').remove();
|
1
app/views/admin/p_spec_types/edit.js.erb
Normal file
1
app/views/admin/p_spec_types/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
16
app/views/admin/p_spec_types/index.html.haml
Normal file
16
app/views/admin/p_spec_types/index.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_spec_type_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PSpecType.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_spec_types}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_spec_types}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_spec_types/new.js.erb
Normal file
1
app/views/admin/p_spec_types/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_spec_types/show.html.haml
Normal file
10
app/views/admin/p_spec_types/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_spec_type
|
2
app/views/admin/p_spec_types/update.js.erb
Normal file
2
app/views/admin/p_spec_types/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_spec_type_row_<%= @p_spec_type.id %>').replaceWith("<%= escape_javascript(render(@p_spec_type))%>");
|
||||||
|
close_pane_hover();
|
18
app/views/admin/p_spec_values/_form.html.haml
Normal file
18
app/views/admin/p_spec_values/_form.html.haml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
- if params[:controller] == "admin/p_spec_values"
|
||||||
|
=semantic_form_for [:admin, @p_spec_value], :remote => true do |f|
|
||||||
|
|
||||||
|
.content
|
||||||
|
=f.inputs do
|
||||||
|
%td
|
||||||
|
= f.input :value, :label => "Valeur"
|
||||||
|
%td
|
||||||
|
= f.input :unit, :label => "Unité", as: :select, collection: PSpecValue::UNITS
|
||||||
|
|
||||||
|
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||||
|
|
||||||
|
- else
|
||||||
|
=f.inputs do
|
||||||
|
%td
|
||||||
|
= f.input :value, :label => "Valeur"
|
||||||
|
%td
|
||||||
|
= f.input :unit, :label => "Unité", as: :select, collection: PSpecValue::UNITS
|
16
app/views/admin/p_spec_values/_p_spec_value.html.haml
Normal file
16
app/views/admin/p_spec_values/_p_spec_value.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%tr#p_spec_value_row{:id => p_spec_value.id}
|
||||||
|
-tr = {}
|
||||||
|
|
||||||
|
-tr[:actions] = capture do
|
||||||
|
%td.actions
|
||||||
|
= link_to i(:"trash-o"), [:admin, p_spec_value], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||||
|
= link_to i(:pencil), edit_admin_p_spec_value_path(p_spec_value), :remote => true
|
||||||
|
= link_to i(:eye), admin_p_spec_value_path(p_spec_value), :remote => true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => p_spec_value}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
app/views/admin/p_spec_values/create.js.erb
Normal file
2
app/views/admin/p_spec_values/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_spec_values_rows').prepend("<%= escape_javascript(render(@p_spec_value))%>");
|
||||||
|
close_pane_hover();
|
1
app/views/admin/p_spec_values/destroy.js.erb
Normal file
1
app/views/admin/p_spec_values/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
$('#p_spec_value_row_<%= @p_spec_value.id %>').remove();
|
1
app/views/admin/p_spec_values/edit.js.erb
Normal file
1
app/views/admin/p_spec_values/edit.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
16
app/views/admin/p_spec_values/index.html.haml
Normal file
16
app/views/admin/p_spec_values/index.html.haml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
.qi_header
|
||||||
|
.right= link_to ic(:plus)+' Ajouter', new_admin_p_spec_value_path(), :class => "btn btn-primary btn-ap-add", :remote => true
|
||||||
|
%h1
|
||||||
|
=PSpecValue.human rescue ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_search_row
|
||||||
|
=form_tag "", :method => "get", :onsubmit => "" do
|
||||||
|
=render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @p_spec_values}
|
||||||
|
|
||||||
|
|
||||||
|
=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @p_spec_values}
|
||||||
|
|
||||||
|
|
||||||
|
|
1
app/views/admin/p_spec_values/new.js.erb
Normal file
1
app/views/admin/p_spec_values/new.js.erb
Normal file
@ -0,0 +1 @@
|
|||||||
|
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/p_spec_values/show.html.haml
Normal file
10
app/views/admin/p_spec_values/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.qi_header
|
||||||
|
%h1
|
||||||
|
|
||||||
|
%span
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.qi_row
|
||||||
|
.qi_pannel.qi_plain.padding
|
||||||
|
=debug @p_spec_value
|
2
app/views/admin/p_spec_values/update.js.erb
Normal file
2
app/views/admin/p_spec_values/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$('#p_spec_value_row_<%= @p_spec_value.id %>').replaceWith("<%= escape_javascript(render(@p_spec_value))%>");
|
||||||
|
close_pane_hover();
|
@ -1,5 +1,93 @@
|
|||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_grades do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_product_ref_specs do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_spec_values do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_spec_types do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_article_serial_nums do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_serial_num_values do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_serial_num_types do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
namespace :admin do
|
||||||
|
resources :p_articles do
|
||||||
|
member do
|
||||||
|
|
||||||
|
end
|
||||||
|
collection do
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
resources :buy_lists do
|
resources :buy_lists do
|
||||||
member do
|
member do
|
||||||
|
9
db/migrate/20210826135742_create_p_articles.rb
Normal file
9
db/migrate/20210826135742_create_p_articles.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class CreatePArticles < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
create_table :p_articles do |t|
|
||||||
|
t.references :p_product_ref, foreign_key: true
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
9
db/migrate/20210826140333_create_p_serial_num_types.rb
Normal file
9
db/migrate/20210826140333_create_p_serial_num_types.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class CreatePSerialNumTypes < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
create_table :p_serial_num_types do |t|
|
||||||
|
t.string :type
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
9
db/migrate/20210826140445_create_p_serial_num_values.rb
Normal file
9
db/migrate/20210826140445_create_p_serial_num_values.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class CreatePSerialNumValues < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
create_table :p_serial_num_values do |t|
|
||||||
|
t.string :value
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
11
db/migrate/20210826140648_create_p_article_serial_nums.rb
Normal file
11
db/migrate/20210826140648_create_p_article_serial_nums.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
class CreatePArticleSerialNums < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
create_table :p_article_serial_nums do |t|
|
||||||
|
t.references :p_article, foreign_key: true
|
||||||
|
t.references :p_serial_num_type, foreign_key: true
|
||||||
|
t.references :p_serial_num_value, foreign_key: true
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class RenameColumnTypeByNameInPSerialNumTypes < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
rename_column :p_serial_num_types, :type, :name
|
||||||
|
end
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user