suite
This commit is contained in:
parent
f5b030b522
commit
2e982b4fd2
2
Gemfile
2
Gemfile
@ -106,3 +106,5 @@ gem "tiny_tds", "1.3.0"
|
||||
|
||||
gem 'axlsx', '3.0.0.pre'
|
||||
gem 'axlsx_rails'
|
||||
|
||||
gem 'iban-tools'
|
||||
|
@ -1 +1,4 @@
|
||||
@import "vendor/flipclock";
|
||||
@import "bootstrap";
|
||||
|
||||
@import "fontawesome/font-awesome";
|
65
app/controllers/admin/m_odr_brands_controller.rb
Normal file
65
app/controllers/admin/m_odr_brands_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrBrandsController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_brands = MOdrBrand.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_brand = MOdrBrand.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_brand = MOdrBrand.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_brand = MOdrBrand.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_brand = MOdrBrand.new(params.require(:m_odr_brand).permit!)
|
||||
|
||||
if @m_odr_brand.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_brand = MOdrBrand.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_brand.update_attributes(params.require(:m_odr_brand).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_brand = MOdrBrand.find(params[:id])
|
||||
@m_odr_brand.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_file_types_controller.rb
Normal file
65
app/controllers/admin/m_odr_file_types_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrFileTypesController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_file_types = MOdrFileType.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_file_type = MOdrFileType.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_file_type = MOdrFileType.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_file_type = MOdrFileType.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_file_type = MOdrFileType.new(params.require(:m_odr_file_type).permit!)
|
||||
|
||||
if @m_odr_file_type.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_file_type = MOdrFileType.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_file_type.update_attributes(params.require(:m_odr_file_type).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_file_type = MOdrFileType.find(params[:id])
|
||||
@m_odr_file_type.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_files_controller.rb
Normal file
65
app/controllers/admin/m_odr_files_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrFilesController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_files = MOdrFile.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_file = MOdrFile.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_file = MOdrFile.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_file = MOdrFile.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_file = MOdrFile.new(params.require(:m_odr_file).permit!)
|
||||
|
||||
if @m_odr_file.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_file = MOdrFile.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_file.update_attributes(params.require(:m_odr_file).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_file = MOdrFile.find(params[:id])
|
||||
@m_odr_file.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_places_controller.rb
Normal file
65
app/controllers/admin/m_odr_places_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrPlacesController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_places = MOdrPlace.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_place = MOdrPlace.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_place = MOdrPlace.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_place = MOdrPlace.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_place = MOdrPlace.new(params.require(:m_odr_place).permit!)
|
||||
|
||||
if @m_odr_place.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_place = MOdrPlace.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_place.update_attributes(params.require(:m_odr_place).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_place = MOdrPlace.find(params[:id])
|
||||
@m_odr_place.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_product_remises_controller.rb
Normal file
65
app/controllers/admin/m_odr_product_remises_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrProductRemisesController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_product_remises = MOdrProductRemise.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_product_remise = MOdrProductRemise.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_product_remise = MOdrProductRemise.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_product_remise = MOdrProductRemise.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_product_remise = MOdrProductRemise.new(params.require(:m_odr_product_remise).permit!)
|
||||
|
||||
if @m_odr_product_remise.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_product_remise = MOdrProductRemise.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_product_remise.update_attributes(params.require(:m_odr_product_remise).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_product_remise = MOdrProductRemise.find(params[:id])
|
||||
@m_odr_product_remise.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_products_controller.rb
Normal file
65
app/controllers/admin/m_odr_products_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrProductsController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_products = MOdrProduct.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_product = MOdrProduct.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_product = MOdrProduct.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_product = MOdrProduct.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_product = MOdrProduct.new(params.require(:m_odr_product).permit!)
|
||||
|
||||
if @m_odr_product.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_product = MOdrProduct.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_product.update_attributes(params.require(:m_odr_product).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_product = MOdrProduct.find(params[:id])
|
||||
@m_odr_product.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_rep_ribs_controller.rb
Normal file
65
app/controllers/admin/m_odr_rep_ribs_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrRepRibsController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_rep_ribs = MOdrRepRib.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_rep_rib = MOdrRepRib.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_rep_rib = MOdrRepRib.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_rep_rib = MOdrRepRib.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_rep_rib = MOdrRepRib.new(params.require(:m_odr_rep_rib).permit!)
|
||||
|
||||
if @m_odr_rep_rib.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_rep_rib = MOdrRepRib.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_rep_rib.update_attributes(params.require(:m_odr_rep_rib).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_rep_rib = MOdrRepRib.find(params[:id])
|
||||
@m_odr_rep_rib.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_reps_controller.rb
Normal file
65
app/controllers/admin/m_odr_reps_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrRepsController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_reps = MOdrRep.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_rep = MOdrRep.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_rep = MOdrRep.new(params.require(:m_odr_rep).permit!)
|
||||
|
||||
if @m_odr_rep.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_rep.update_attributes(params.require(:m_odr_rep).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
@m_odr_rep.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/m_odr_trackers_controller.rb
Normal file
65
app/controllers/admin/m_odr_trackers_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::MOdrTrackersController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@m_odr_trackers = MOdrTracker.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@m_odr_tracker = MOdrTracker.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@m_odr_tracker = MOdrTracker.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_tracker = MOdrTracker.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_tracker = MOdrTracker.new(params.require(:m_odr_tracker).permit!)
|
||||
|
||||
if @m_odr_tracker.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@m_odr_tracker = MOdrTracker.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_tracker.update_attributes(params.require(:m_odr_tracker).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@m_odr_tracker = MOdrTracker.find(params[:id])
|
||||
@m_odr_tracker.destroy
|
||||
|
||||
end
|
||||
end
|
65
app/controllers/admin/odr_trackers_controller.rb
Normal file
65
app/controllers/admin/odr_trackers_controller.rb
Normal file
@ -0,0 +1,65 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Admin::OdrTrackersController < ApplicationController
|
||||
layout "admin"
|
||||
before_action :auth_admin
|
||||
|
||||
before_action :admin_space
|
||||
|
||||
def admin_space
|
||||
@admin_space = "default"
|
||||
end
|
||||
|
||||
def index
|
||||
@odr_trackers = OdrTracker.order(:name).all
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
@odr_tracker = OdrTracker.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
@odr_tracker = OdrTracker.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@odr_tracker = OdrTracker.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@odr_tracker = OdrTracker.new(params.require(:odr_tracker).permit!)
|
||||
|
||||
if @odr_tracker.save
|
||||
|
||||
else
|
||||
render action: "new"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@odr_tracker = OdrTracker.find(params[:id])
|
||||
|
||||
|
||||
if @odr_tracker.update_attributes(params.require(:odr_tracker).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@odr_tracker = OdrTracker.find(params[:id])
|
||||
@odr_tracker.destroy
|
||||
|
||||
end
|
||||
end
|
63
app/controllers/public/m_odr_reps_controller.rb
Normal file
63
app/controllers/public/m_odr_reps_controller.rb
Normal file
@ -0,0 +1,63 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class Public::MOdrRepsController < ApplicationController
|
||||
layout "public"
|
||||
|
||||
|
||||
def new
|
||||
@m_odr_rep = MOdrRep.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def create
|
||||
@m_odr_rep = MOdrRep.new(params.require(:m_odr_rep).permit!)
|
||||
@m_odr = @m_odr_rep.m_odr
|
||||
|
||||
if @m_odr_rep.save
|
||||
if mail_type = @m_odr.mail_types.where(:slug => "confirmation-inscription").first
|
||||
|
||||
mail = GeneralMails.general(:fr, mail_type, @m_odr_rep.particulars.first.email, {:arguments => {:numero_avoir => ""}})
|
||||
mail.deliver
|
||||
end
|
||||
|
||||
|
||||
redirect_to thank_public_m_odr_rep_path(@m_odr_rep)
|
||||
|
||||
|
||||
|
||||
else
|
||||
render :template => "public/m_odrs/show"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def thank
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
@m_odr = @m_odr_rep.m_odr
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
@m_odr_rep = MOdrRep.find(params[:id])
|
||||
|
||||
|
||||
if @m_odr_rep.update_attributes(params.require(:m_odr_rep).permit!)
|
||||
|
||||
else
|
||||
render action: "edit"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
end
|
@ -1,11 +1,11 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
module MailHelper
|
||||
|
||||
def mail_content(slug, lang, arguments = {})
|
||||
def mail_content(lang, mail_content, arguments = {})
|
||||
|
||||
lang_site = LangSite.find_by_slug(lang)
|
||||
|
||||
mail_content = MailContent.joins(:mail_type).where(:lang_site_id => lang_site.id, :mail_types => { :slug => slug}).first
|
||||
#mail_content = MailContent.joins(:mail_type).where(:lang_site_id => lang_site.id, :mail_types => { :slug => slug}).first
|
||||
|
||||
@new_site = true
|
||||
if mail_content.content_type == "blocs" and mail_content.block
|
||||
@ -28,7 +28,7 @@ module MailHelper
|
||||
|
||||
|
||||
arguments.each_pair do |key, value|
|
||||
r = r.gsub(/\[#{key}\]/, value.to_s)
|
||||
r = r.gsub(/\[#{key.to_s}\]/, value.to_s)
|
||||
|
||||
end
|
||||
|
||||
|
55
app/mailers/general_mails.rb
Normal file
55
app/mailers/general_mails.rb
Normal file
@ -0,0 +1,55 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
class GeneralMails < ActionMailer::Base
|
||||
add_template_helper(MailHelper)
|
||||
|
||||
layout 'mail'
|
||||
|
||||
default from: "Market-Inn <offre@market-inn.fr>"
|
||||
|
||||
|
||||
def general(lang_slug, mail_type, email, options = {})
|
||||
@options = options
|
||||
|
||||
@mail_type = mail_type
|
||||
|
||||
@lang = LangSite.find_by_slug(lang_slug.to_s)
|
||||
|
||||
@mail_content = @mail_type.mail_contents.where(:lang_site_id => @lang.id).first
|
||||
|
||||
subject = @mail_content.subject
|
||||
|
||||
@arguments = @options[:arguments]
|
||||
|
||||
@ccis = @options[:ccis] || []
|
||||
|
||||
|
||||
|
||||
@from = @options[:from] if @options[:from]
|
||||
|
||||
if @from
|
||||
mail(:to => email, :subject => subject, :bcc => @ccis.join(";"), :from => @from)
|
||||
else
|
||||
mail(:to => email, :subject => subject, :bcc => @ccis.join(";"))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def admin(email, subject, content, options = {})
|
||||
@options = options
|
||||
|
||||
@content = content
|
||||
@arguments = @options[:arguments]
|
||||
|
||||
@ccis = @options[:ccis] || []
|
||||
|
||||
|
||||
@from_admin = @options[:from_admin] if @options[:from_admin]
|
||||
|
||||
mail(:to => email, :subject => "Notification ADMIN : "+subject.to_s, :bcc => @ccis.join(";"))
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
@ -19,4 +19,29 @@ class MOdr < ApplicationRecord
|
||||
validates :public_end, :presence => true
|
||||
|
||||
|
||||
has_many :m_odr_file_types, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_file_types, :allow_destroy => true
|
||||
|
||||
has_many :m_odr_brands, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_brands, :allow_destroy => true
|
||||
|
||||
has_many :m_odr_products, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_products, :allow_destroy => true
|
||||
|
||||
has_many :m_odr_places, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_places, :allow_destroy => true
|
||||
|
||||
has_many :m_odr_trackers, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_trackers, :allow_destroy => true
|
||||
|
||||
has_many :mail_types, :dependent => :destroy
|
||||
accepts_nested_attributes_for :mail_types, :allow_destroy => true
|
||||
|
||||
|
||||
|
||||
|
||||
has_many :m_odr_reps, :dependent => :destroy
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
3
app/models/m_odr_brand.rb
Normal file
3
app/models/m_odr_brand.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class MOdrBrand < ApplicationRecord
|
||||
belongs_to :m_odr
|
||||
end
|
21
app/models/m_odr_file.rb
Normal file
21
app/models/m_odr_file.rb
Normal file
@ -0,0 +1,21 @@
|
||||
class MOdrFile < ApplicationRecord
|
||||
belongs_to :m_odr_rep
|
||||
belongs_to :m_odr_file_type
|
||||
|
||||
mount_uploader :file, OdrUploader
|
||||
|
||||
validates :file, :presence => true
|
||||
|
||||
|
||||
before_create { generate_token() }
|
||||
|
||||
def generate_token()
|
||||
begin
|
||||
self[:token] = SecureRandom.urlsafe_base64
|
||||
end while MOdrFile.exists?(:token => self[:token])
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
2
app/models/m_odr_file_type.rb
Normal file
2
app/models/m_odr_file_type.rb
Normal file
@ -0,0 +1,2 @@
|
||||
class MOdrFileType < ApplicationRecord
|
||||
end
|
3
app/models/m_odr_place.rb
Normal file
3
app/models/m_odr_place.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class MOdrPlace < ApplicationRecord
|
||||
belongs_to :m_odr
|
||||
end
|
20
app/models/m_odr_product.rb
Normal file
20
app/models/m_odr_product.rb
Normal file
@ -0,0 +1,20 @@
|
||||
class MOdrProduct < ApplicationRecord
|
||||
belongs_to :m_odr_brand
|
||||
|
||||
|
||||
has_many :m_odr_product_remises, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_product_remises, :allow_destroy => true
|
||||
|
||||
|
||||
def member_label
|
||||
if self.m_odr_brand
|
||||
"#{self.m_odr_brand.name} - #{self.name}"
|
||||
|
||||
else
|
||||
self.name
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
3
app/models/m_odr_product_remise.rb
Normal file
3
app/models/m_odr_product_remise.rb
Normal file
@ -0,0 +1,3 @@
|
||||
class MOdrProductRemise < ApplicationRecord
|
||||
belongs_to :m_odr_product
|
||||
end
|
49
app/models/m_odr_rep.rb
Normal file
49
app/models/m_odr_rep.rb
Normal file
@ -0,0 +1,49 @@
|
||||
class MOdrRep < ApplicationRecord
|
||||
belongs_to :m_odr
|
||||
|
||||
|
||||
has_many :particulars, :dependent => :destroy
|
||||
accepts_nested_attributes_for :particulars, :allow_destroy => true
|
||||
|
||||
|
||||
|
||||
has_many :m_odr_rep_ribs, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_rep_ribs, :allow_destroy => true
|
||||
|
||||
belongs_to :m_odr_product
|
||||
|
||||
belongs_to :m_odr_place
|
||||
|
||||
has_many :m_odr_files, :dependent => :destroy
|
||||
accepts_nested_attributes_for :m_odr_files, :allow_destroy => true
|
||||
|
||||
|
||||
|
||||
validates :qte, :presence => true
|
||||
validates :m_odr_product_id, :presence => true
|
||||
validates :m_odr_place_id, :presence => true
|
||||
|
||||
belongs_to :m_odr_tracker
|
||||
|
||||
|
||||
attr_accessor :t
|
||||
|
||||
before_validation do
|
||||
if self.t.to_s != ""
|
||||
self.m_odr_tracker = MOdrTracker.where(:token => self.t).first
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
before_create { generate_token() }
|
||||
|
||||
def generate_token()
|
||||
begin
|
||||
self[:token] = SecureRandom.urlsafe_base64
|
||||
end while MOdrRep.exists?(:token => self[:token])
|
||||
end
|
||||
|
||||
end
|
13
app/models/m_odr_rep_rib.rb
Normal file
13
app/models/m_odr_rep_rib.rb
Normal file
@ -0,0 +1,13 @@
|
||||
class MOdrRepRib < ApplicationRecord
|
||||
belongs_to :admin
|
||||
|
||||
belongs_to :m_odr_rep
|
||||
|
||||
has_one :m_odr, :through => :m_odr_rep
|
||||
|
||||
validates :bic, :presence => true, length: { in: 8..11 }
|
||||
|
||||
validates :iban, :presence => true
|
||||
|
||||
validates_with IbanValidator
|
||||
end
|
15
app/models/m_odr_tracker.rb
Normal file
15
app/models/m_odr_tracker.rb
Normal file
@ -0,0 +1,15 @@
|
||||
class MOdrTracker < ApplicationRecord
|
||||
belongs_to :m_odr
|
||||
|
||||
|
||||
|
||||
before_create { generate_token() }
|
||||
|
||||
def generate_token()
|
||||
begin
|
||||
self[:token] = SecureRandom.hex(2)
|
||||
end while MOdrRep.exists?(:token => self[:token])
|
||||
end
|
||||
|
||||
|
||||
end
|
@ -2,4 +2,6 @@ class MailType < ApplicationRecord
|
||||
has_many :mail_contents
|
||||
belongs_to :mail_type_reference, :class_name => "MailType"
|
||||
|
||||
|
||||
accepts_nested_attributes_for :mail_contents
|
||||
end
|
||||
|
@ -7,25 +7,56 @@ class Particular < ApplicationRecord
|
||||
has_many :open_ranges, :through => :open_range_elements
|
||||
|
||||
belongs_to :owner, :polymorphic => true
|
||||
#validates :civilite, :presence => true, :if => :force_validation
|
||||
#validates :name, :presence => true, :if => :force_validation
|
||||
#validates :firstname, :presence => true, :if => :force_validation
|
||||
validates :civilite, :presence => true, :if => :force_validate_name
|
||||
validates :name, :presence => true, :if => :force_validate_name
|
||||
validates :firstname, :presence => true, :if => :force_validate_name
|
||||
validates :email, :presence => true, :format => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :if => :force_email_validation
|
||||
validates :address_2, :presence => true, :if => :force_validation
|
||||
validates :cp, :presence => true, :if => :force_validation
|
||||
validates :city, :presence => true, :if => :force_validation
|
||||
validates :country, :presence => true, :if => :force_validation
|
||||
#validates :tel, :presence => true, :if => :force_validation
|
||||
validates :organisation, :presence => true, :if => :force_validation
|
||||
attr_accessor :validate_email, :skip_email
|
||||
validates :tel, :presence => true, :if => :force_validate_tel
|
||||
validates :organisation, :presence => true, :if => :force_organisation_validation
|
||||
attr_accessor :validate_email, :skip_email, :validate_name, :validate_tel, :skip_organisation
|
||||
|
||||
belongs_to :particular_ref, :class_name => "Particular"
|
||||
def validate_pro
|
||||
true if self.force_validation and self.pro
|
||||
end
|
||||
def force_email_validation
|
||||
false #true if (self.validate_email or self.force_validation) and !skip_email
|
||||
|
||||
def force_organisation_validation
|
||||
if self.force_validation and !self.skip_organisation
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def force_email_validation
|
||||
if self.validate_email and !skip_email
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def force_validate_name
|
||||
if self.validate_name
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def force_validate_tel
|
||||
if self.validate_tel
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def force_validation
|
||||
|
||||
|
||||
|
58
app/uploaders/odr_uploader.rb
Normal file
58
app/uploaders/odr_uploader.rb
Normal file
@ -0,0 +1,58 @@
|
||||
# -*- encoding : utf-8 -*-
|
||||
|
||||
class OdrUploader < CarrierWave::Uploader::Base
|
||||
|
||||
# Include RMagick or ImageScience support:
|
||||
# include CarrierWave::RMagick
|
||||
# include CarrierWave::ImageScience
|
||||
|
||||
# Choose what kind of storage to use for this uploader:
|
||||
storage :file
|
||||
# storage :s3
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
"#{Rails.root}/private_medias/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
|
||||
end
|
||||
|
||||
def url
|
||||
"/download_odr_file/#{model.id}"
|
||||
|
||||
end
|
||||
|
||||
# Provide a default URL as a default if there hasn't been a file uploaded:
|
||||
def default_url
|
||||
"/images/fallback/" + [version_name, "default.png"].compact.join('_')
|
||||
end
|
||||
|
||||
# Process files as they are uploaded:
|
||||
# process :scale => [200, 300]
|
||||
#
|
||||
# def scale(width, height)
|
||||
# # do something
|
||||
# end
|
||||
|
||||
# Create different versions of your uploaded files:
|
||||
# version :thumb do
|
||||
# process :scale => [50, 50]
|
||||
# end
|
||||
|
||||
# Add a white list of extensions which are allowed to be uploaded.
|
||||
# For images you might use something like this:
|
||||
# def extension_white_list
|
||||
# %w(jpg jpeg gif png)
|
||||
# end
|
||||
|
||||
# Override the filename of the uploaded files:
|
||||
# def filename
|
||||
# "something.jpg" if original_filename
|
||||
# end
|
||||
|
||||
def filename
|
||||
File.basename(original_filename, File.extname(original_filename)).to_s.to_slug + File.extname(original_filename).to_s if original_filename
|
||||
|
||||
|
||||
end
|
||||
|
||||
end
|
9
app/validators/iban_validator.rb
Normal file
9
app/validators/iban_validator.rb
Normal file
@ -0,0 +1,9 @@
|
||||
require 'iban-tools'
|
||||
|
||||
class IbanValidator < ActiveModel::Validator
|
||||
def validate(record)
|
||||
unless IBANTools::IBAN.valid?(record.iban)
|
||||
record.errors.add :iban, record.errors.generate_message(:iban, :invalid)
|
||||
end
|
||||
end
|
||||
end
|
15
app/views/admin/m_odr_brands/_form.html.haml
Normal file
15
app/views/admin/m_odr_brands/_form.html.haml
Normal file
@ -0,0 +1,15 @@
|
||||
.m_odr_brand_form.field
|
||||
= form.input :name, :label => "Nom :"
|
||||
Dates si différentes des dates générales :
|
||||
.row.qi_cancel_margins
|
||||
.col-sm-4
|
||||
= form.input :start_at, :label => "Date de début :" , :as => :date
|
||||
.col-sm-4
|
||||
= form.input :end_at, :label => "Date de fin :" , :as => :date
|
||||
.col-sm-4
|
||||
= form.input :public_end, :label => "Date de fin des envois :" , :as => :date
|
||||
|
||||
|
||||
|
||||
|
||||
=link_to_remove_fields ic(:"trash-o"), form
|
11
app/views/admin/m_odr_brands/_m_odr_brand.html.haml
Normal file
11
app/views/admin/m_odr_brands/_m_odr_brand.html.haml
Normal file
@ -0,0 +1,11 @@
|
||||
%tr#m_odr_brand_row{:id => m_odr_brand.id}
|
||||
%td= m_odr_brand.name
|
||||
%td= m_odr_brand.ref
|
||||
%td= m_odr_brand.image_file_id
|
||||
%td= m_odr_brand.m_odr_id
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_brand], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_brand_path(m_odr_brand), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_brand_path(m_odr_brand), :remote => true
|
||||
|
2
app/views/admin/m_odr_brands/create.js.erb
Normal file
2
app/views/admin/m_odr_brands/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_brands_rows').prepend("<%= escape_javascript(render(@m_odr_brand))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_brands/destroy.js.erb
Normal file
1
app/views/admin/m_odr_brands/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_brand_<%= @m_odr_brand.id %>').remove();
|
1
app/views/admin/m_odr_brands/edit.js.erb
Normal file
1
app/views/admin/m_odr_brands/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
23
app/views/admin/m_odr_brands/index.html.haml
Normal file
23
app/views/admin/m_odr_brands/index.html.haml
Normal file
@ -0,0 +1,23 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_brand_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th name
|
||||
%th ref
|
||||
%th image_file_id
|
||||
%th m_odr_id
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_brands_rows
|
||||
=render @m_odr_brands
|
||||
|
||||
|
1
app/views/admin/m_odr_brands/new.js.erb
Normal file
1
app/views/admin/m_odr_brands/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_brands/show.html.haml
Normal file
10
app/views/admin/m_odr_brands/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_brand
|
2
app/views/admin/m_odr_brands/update.js.erb
Normal file
2
app/views/admin/m_odr_brands/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_brand_row_<%= @m_odr_brand.id %>').replaceWith("<%= escape_javascript(render(@m_odr_brand))%>");
|
||||
close_pane_hover();
|
7
app/views/admin/m_odr_file_types/_form.html.haml
Normal file
7
app/views/admin/m_odr_file_types/_form.html.haml
Normal file
@ -0,0 +1,7 @@
|
||||
.m_odr_file_type_form.field
|
||||
=form.input :name, :label => "Nom :"
|
||||
=form.input :need_file, :label => "Nécessaire ?"
|
||||
|
||||
=link_to_remove_fields ic(:"trash-o"), form
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
%tr#m_odr_file_type_row{:id => m_odr_file_type.id}
|
||||
%td= m_odr_file_type.name
|
||||
%td= m_odr_file_type.needed
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_file_type], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_file_type_path(m_odr_file_type), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_file_type_path(m_odr_file_type), :remote => true
|
||||
|
2
app/views/admin/m_odr_file_types/create.js.erb
Normal file
2
app/views/admin/m_odr_file_types/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_file_types_rows').prepend("<%= escape_javascript(render(@m_odr_file_type))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_file_types/destroy.js.erb
Normal file
1
app/views/admin/m_odr_file_types/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_file_type_<%= @m_odr_file_type.id %>').remove();
|
1
app/views/admin/m_odr_file_types/edit.js.erb
Normal file
1
app/views/admin/m_odr_file_types/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
21
app/views/admin/m_odr_file_types/index.html.haml
Normal file
21
app/views/admin/m_odr_file_types/index.html.haml
Normal file
@ -0,0 +1,21 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_file_type_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th name
|
||||
%th needed
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_file_types_rows
|
||||
=render @m_odr_file_types
|
||||
|
||||
|
1
app/views/admin/m_odr_file_types/new.js.erb
Normal file
1
app/views/admin/m_odr_file_types/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_file_types/show.html.haml
Normal file
10
app/views/admin/m_odr_file_types/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_file_type
|
2
app/views/admin/m_odr_file_types/update.js.erb
Normal file
2
app/views/admin/m_odr_file_types/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_file_type_row_<%= @m_odr_file_type.id %>').replaceWith("<%= escape_javascript(render(@m_odr_file_type))%>");
|
||||
close_pane_hover();
|
17
app/views/admin/m_odr_files/_form.html.haml
Normal file
17
app/views/admin/m_odr_files/_form.html.haml
Normal file
@ -0,0 +1,17 @@
|
||||
=semantic_form_for [:admin, @m_odr_file], :remote => true do |f|
|
||||
|
||||
.content
|
||||
=f.inputs do
|
||||
= f.input :file, :label => "file :"
|
||||
= f.input :m_odr, :label => "m_odr :"
|
||||
= f.input :action_date, :label => "action_date :"
|
||||
= f.input :notes, :label => "notes :"
|
||||
= f.input :name, :label => "name :"
|
||||
= f.input :m_odr_file_type, :label => "m_odr_file_type :"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||
|
13
app/views/admin/m_odr_files/_m_odr_file.html.haml
Normal file
13
app/views/admin/m_odr_files/_m_odr_file.html.haml
Normal file
@ -0,0 +1,13 @@
|
||||
%tr#m_odr_file_row{:id => m_odr_file.id}
|
||||
%td= m_odr_file.file
|
||||
%td= m_odr_file.m_odr_id
|
||||
%td= m_odr_file.action_date
|
||||
%td= m_odr_file.notes
|
||||
%td= m_odr_file.name
|
||||
%td= m_odr_file.m_odr_file_type_id
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_file], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_file_path(m_odr_file), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_file_path(m_odr_file), :remote => true
|
||||
|
2
app/views/admin/m_odr_files/create.js.erb
Normal file
2
app/views/admin/m_odr_files/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_files_rows').prepend("<%= escape_javascript(render(@m_odr_file))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_files/destroy.js.erb
Normal file
1
app/views/admin/m_odr_files/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_file_<%= @m_odr_file.id %>').remove();
|
1
app/views/admin/m_odr_files/edit.js.erb
Normal file
1
app/views/admin/m_odr_files/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
25
app/views/admin/m_odr_files/index.html.haml
Normal file
25
app/views/admin/m_odr_files/index.html.haml
Normal file
@ -0,0 +1,25 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_file_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th file
|
||||
%th m_odr_id
|
||||
%th action_date
|
||||
%th notes
|
||||
%th name
|
||||
%th m_odr_file_type_id
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_files_rows
|
||||
=render @m_odr_files
|
||||
|
||||
|
1
app/views/admin/m_odr_files/new.js.erb
Normal file
1
app/views/admin/m_odr_files/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_files/show.html.haml
Normal file
10
app/views/admin/m_odr_files/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_file
|
2
app/views/admin/m_odr_files/update.js.erb
Normal file
2
app/views/admin/m_odr_files/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_file_row_<%= @m_odr_file.id %>').replaceWith("<%= escape_javascript(render(@m_odr_file))%>");
|
||||
close_pane_hover();
|
18
app/views/admin/m_odr_places/_form.html.haml
Normal file
18
app/views/admin/m_odr_places/_form.html.haml
Normal file
@ -0,0 +1,18 @@
|
||||
.m_odr_place_form.field
|
||||
|
||||
|
||||
= form.input :name, :label => "Nom du magasin :"
|
||||
=# f.input :enseigne, :label => "enseigne :"
|
||||
=# f.input :city, :label => "city :"
|
||||
=# f.input :cp, :label => "cp :"
|
||||
=# f.input :departement, :label => "departement :"
|
||||
=# f.input :departement_nbr, :label => "departement_nbr :"
|
||||
=# f.input :responsable, :label => "responsable :"
|
||||
=# f.input :tel, :label => "tel :"
|
||||
=# f.input :email, :label => "email :"
|
||||
=# f.input :m_odr, :label => "m_odr :"
|
||||
|
||||
=link_to_remove_fields ic(:"trash-o"), form
|
||||
|
||||
|
||||
|
17
app/views/admin/m_odr_places/_m_odr_place.html.haml
Normal file
17
app/views/admin/m_odr_places/_m_odr_place.html.haml
Normal file
@ -0,0 +1,17 @@
|
||||
%tr#m_odr_place_row{:id => m_odr_place.id}
|
||||
%td= m_odr_place.name
|
||||
%td= m_odr_place.enseigne
|
||||
%td= m_odr_place.city
|
||||
%td= m_odr_place.cp
|
||||
%td= m_odr_place.departement
|
||||
%td= m_odr_place.departement_nbr
|
||||
%td= m_odr_place.responsable
|
||||
%td= m_odr_place.tel
|
||||
%td= m_odr_place.email
|
||||
%td= m_odr_place.m_odr_id
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_place], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_place_path(m_odr_place), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_place_path(m_odr_place), :remote => true
|
||||
|
2
app/views/admin/m_odr_places/create.js.erb
Normal file
2
app/views/admin/m_odr_places/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_places_rows').prepend("<%= escape_javascript(render(@m_odr_place))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_places/destroy.js.erb
Normal file
1
app/views/admin/m_odr_places/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_place_<%= @m_odr_place.id %>').remove();
|
1
app/views/admin/m_odr_places/edit.js.erb
Normal file
1
app/views/admin/m_odr_places/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
29
app/views/admin/m_odr_places/index.html.haml
Normal file
29
app/views/admin/m_odr_places/index.html.haml
Normal file
@ -0,0 +1,29 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_place_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th name
|
||||
%th enseigne
|
||||
%th city
|
||||
%th cp
|
||||
%th departement
|
||||
%th departement_nbr
|
||||
%th responsable
|
||||
%th tel
|
||||
%th email
|
||||
%th m_odr_id
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_places_rows
|
||||
=render @m_odr_places
|
||||
|
||||
|
1
app/views/admin/m_odr_places/new.js.erb
Normal file
1
app/views/admin/m_odr_places/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_places/show.html.haml
Normal file
10
app/views/admin/m_odr_places/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_place
|
2
app/views/admin/m_odr_places/update.js.erb
Normal file
2
app/views/admin/m_odr_places/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_place_row_<%= @m_odr_place.id %>').replaceWith("<%= escape_javascript(render(@m_odr_place))%>");
|
||||
close_pane_hover();
|
5
app/views/admin/m_odr_product_remises/_form.html.haml
Normal file
5
app/views/admin/m_odr_product_remises/_form.html.haml
Normal file
@ -0,0 +1,5 @@
|
||||
%tr.m_odr_product_remise_form.field
|
||||
%td= form.input :qte, :label => "Qté :"
|
||||
%td= form.input :amount, :label => "Montant :"
|
||||
|
||||
%td.actions=link_to_remove_fields ic(:"trash-o"), form
|
@ -0,0 +1,10 @@
|
||||
%tr#m_odr_product_remise_row{:id => m_odr_product_remise.id}
|
||||
%td= m_odr_product_remise.m_odr_product_id
|
||||
%td= m_odr_product_remise.qte
|
||||
%td= m_odr_product_remise.amount
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_product_remise], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_product_remise_path(m_odr_product_remise), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_product_remise_path(m_odr_product_remise), :remote => true
|
||||
|
2
app/views/admin/m_odr_product_remises/create.js.erb
Normal file
2
app/views/admin/m_odr_product_remises/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_product_remises_rows').prepend("<%= escape_javascript(render(@m_odr_product_remise))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_product_remises/destroy.js.erb
Normal file
1
app/views/admin/m_odr_product_remises/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_product_remise_<%= @m_odr_product_remise.id %>').remove();
|
1
app/views/admin/m_odr_product_remises/edit.js.erb
Normal file
1
app/views/admin/m_odr_product_remises/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
22
app/views/admin/m_odr_product_remises/index.html.haml
Normal file
22
app/views/admin/m_odr_product_remises/index.html.haml
Normal file
@ -0,0 +1,22 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_product_remise_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th m_odr_product_id
|
||||
%th qte
|
||||
%th amount
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_product_remises_rows
|
||||
=render @m_odr_product_remises
|
||||
|
||||
|
1
app/views/admin/m_odr_product_remises/new.js.erb
Normal file
1
app/views/admin/m_odr_product_remises/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_product_remises/show.html.haml
Normal file
10
app/views/admin/m_odr_product_remises/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_product_remise
|
2
app/views/admin/m_odr_product_remises/update.js.erb
Normal file
2
app/views/admin/m_odr_product_remises/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_product_remise_row_<%= @m_odr_product_remise.id %>').replaceWith("<%= escape_javascript(render(@m_odr_product_remise))%>");
|
||||
close_pane_hover();
|
16
app/views/admin/m_odr_products/_form.html.haml
Normal file
16
app/views/admin/m_odr_products/_form.html.haml
Normal file
@ -0,0 +1,16 @@
|
||||
.m_odr_product_form.field
|
||||
|
||||
= form.input :name, :label => "Nom :"
|
||||
= form.input :m_odr_brand, :label => "Marque :"
|
||||
|
||||
|
||||
%table.m_odr_product_remises_form
|
||||
|
||||
=form.semantic_fields_for :m_odr_product_remises do |form|
|
||||
=render :partial => "admin/m_odr_product_remises/form", :locals => {:form => form}
|
||||
|
||||
%p= link_to_add_fields ic(:plus)+" Ajouter une remise", form, :m_odr_product_remises
|
||||
|
||||
|
||||
|
||||
=link_to_remove_fields ic(:"trash-o"), form
|
11
app/views/admin/m_odr_products/_m_odr_product.html.haml
Normal file
11
app/views/admin/m_odr_products/_m_odr_product.html.haml
Normal file
@ -0,0 +1,11 @@
|
||||
%tr#m_odr_product_row{:id => m_odr_product.id}
|
||||
%td= m_odr_product.name
|
||||
%td= m_odr_product.ref
|
||||
%td= m_odr_product.ean
|
||||
%td= m_odr_product.m_odr_brand_id
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_product], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_product_path(m_odr_product), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_product_path(m_odr_product), :remote => true
|
||||
|
2
app/views/admin/m_odr_products/create.js.erb
Normal file
2
app/views/admin/m_odr_products/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_products_rows').prepend("<%= escape_javascript(render(@m_odr_product))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_products/destroy.js.erb
Normal file
1
app/views/admin/m_odr_products/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_product_<%= @m_odr_product.id %>').remove();
|
1
app/views/admin/m_odr_products/edit.js.erb
Normal file
1
app/views/admin/m_odr_products/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
23
app/views/admin/m_odr_products/index.html.haml
Normal file
23
app/views/admin/m_odr_products/index.html.haml
Normal file
@ -0,0 +1,23 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_product_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th name
|
||||
%th ref
|
||||
%th ean
|
||||
%th m_odr_brand_id
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_products_rows
|
||||
=render @m_odr_products
|
||||
|
||||
|
1
app/views/admin/m_odr_products/new.js.erb
Normal file
1
app/views/admin/m_odr_products/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_products/show.html.haml
Normal file
10
app/views/admin/m_odr_products/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_product
|
2
app/views/admin/m_odr_products/update.js.erb
Normal file
2
app/views/admin/m_odr_products/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_product_row_<%= @m_odr_product.id %>').replaceWith("<%= escape_javascript(render(@m_odr_product))%>");
|
||||
close_pane_hover();
|
22
app/views/admin/m_odr_rep_ribs/_form.html.haml
Normal file
22
app/views/admin/m_odr_rep_ribs/_form.html.haml
Normal file
@ -0,0 +1,22 @@
|
||||
=semantic_form_for [:admin, @m_odr_rep_rib], :remote => true do |f|
|
||||
|
||||
.content
|
||||
=f.inputs do
|
||||
= f.input :iban, :label => "iban :"
|
||||
= f.input :bic, :label => "bic :"
|
||||
= f.input :name, :label => "name :"
|
||||
= f.input :admin, :label => "admin :"
|
||||
= f.input :admin_valid, :label => "admin_valid :"
|
||||
= f.input :confirmed, :label => "confirmed :"
|
||||
= f.input :m_odr_rep_id, :label => "m_odr_rep_id :"
|
||||
= f.input :nbr_virements, :label => "nbr_virements :"
|
||||
= f.input :bank_name, :label => "bank_name :"
|
||||
= f.input :bank_adress, :label => "bank_adress :"
|
||||
= f.input :notes, :label => "notes :"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||
|
18
app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml
Normal file
18
app/views/admin/m_odr_rep_ribs/_m_odr_rep_rib.html.haml
Normal file
@ -0,0 +1,18 @@
|
||||
%tr#m_odr_rep_rib_row{:id => m_odr_rep_rib.id}
|
||||
%td= m_odr_rep_rib.iban
|
||||
%td= m_odr_rep_rib.bic
|
||||
%td= m_odr_rep_rib.name
|
||||
%td= m_odr_rep_rib.admin_id
|
||||
%td= m_odr_rep_rib.admin_valid
|
||||
%td= m_odr_rep_rib.confirmed
|
||||
%td= m_odr_rep_rib.m_odr_rep_id
|
||||
%td= m_odr_rep_rib.nbr_virements
|
||||
%td= m_odr_rep_rib.bank_name
|
||||
%td= m_odr_rep_rib.bank_adress
|
||||
%td= m_odr_rep_rib.notes
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_rep_rib], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_rep_rib_path(m_odr_rep_rib), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_rep_rib_path(m_odr_rep_rib), :remote => true
|
||||
|
2
app/views/admin/m_odr_rep_ribs/create.js.erb
Normal file
2
app/views/admin/m_odr_rep_ribs/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_rep_ribs_rows').prepend("<%= escape_javascript(render(@m_odr_rep_rib))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_rep_ribs/destroy.js.erb
Normal file
1
app/views/admin/m_odr_rep_ribs/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_rep_rib_<%= @m_odr_rep_rib.id %>').remove();
|
1
app/views/admin/m_odr_rep_ribs/edit.js.erb
Normal file
1
app/views/admin/m_odr_rep_ribs/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
30
app/views/admin/m_odr_rep_ribs/index.html.haml
Normal file
30
app/views/admin/m_odr_rep_ribs/index.html.haml
Normal file
@ -0,0 +1,30 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_rep_rib_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th iban
|
||||
%th bic
|
||||
%th name
|
||||
%th admin_id
|
||||
%th admin_valid
|
||||
%th confirmed
|
||||
%th m_odr_rep_id
|
||||
%th nbr_virements
|
||||
%th bank_name
|
||||
%th bank_adress
|
||||
%th notes
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_rep_ribs_rows
|
||||
=render @m_odr_rep_ribs
|
||||
|
||||
|
1
app/views/admin/m_odr_rep_ribs/new.js.erb
Normal file
1
app/views/admin/m_odr_rep_ribs/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_rep_ribs/show.html.haml
Normal file
10
app/views/admin/m_odr_rep_ribs/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_rep_rib
|
2
app/views/admin/m_odr_rep_ribs/update.js.erb
Normal file
2
app/views/admin/m_odr_rep_ribs/update.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_rep_rib_row_<%= @m_odr_rep_rib.id %>').replaceWith("<%= escape_javascript(render(@m_odr_rep_rib))%>");
|
||||
close_pane_hover();
|
17
app/views/admin/m_odr_reps/_form.html.haml
Normal file
17
app/views/admin/m_odr_reps/_form.html.haml
Normal file
@ -0,0 +1,17 @@
|
||||
=semantic_form_for [:admin, @m_odr_rep], :remote => true do |f|
|
||||
|
||||
.content
|
||||
=f.inputs do
|
||||
= f.input :state, :label => "state :"
|
||||
= f.input :admin_id, :label => "admin_id :"
|
||||
= f.input :admin_valid, :label => "admin_valid :"
|
||||
= f.input :token, :label => "token :"
|
||||
= f.input :m_odr, :label => "m_odr :"
|
||||
= f.input :rgpd, :label => "rgpd :"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.actions=f.submit "sauvegarder", :class => "btn btn-primary"
|
||||
|
13
app/views/admin/m_odr_reps/_m_odr_rep.html.haml
Normal file
13
app/views/admin/m_odr_reps/_m_odr_rep.html.haml
Normal file
@ -0,0 +1,13 @@
|
||||
%tr#m_odr_rep_row{:id => m_odr_rep.id}
|
||||
%td= m_odr_rep.state
|
||||
%td= m_odr_rep.admin_id
|
||||
%td= m_odr_rep.admin_valid
|
||||
%td= m_odr_rep.token
|
||||
%td= m_odr_rep.m_odr_id
|
||||
%td= m_odr_rep.rgpd
|
||||
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, m_odr_rep], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
= link_to i(:pencil), edit_admin_m_odr_rep_path(m_odr_rep), :remote => true
|
||||
= link_to i(:eye), admin_m_odr_rep_path(m_odr_rep), :remote => true
|
||||
|
2
app/views/admin/m_odr_reps/create.js.erb
Normal file
2
app/views/admin/m_odr_reps/create.js.erb
Normal file
@ -0,0 +1,2 @@
|
||||
$('#m_odr_reps_rows').prepend("<%= escape_javascript(render(@m_odr_rep))%>");
|
||||
close_pane_hover();
|
1
app/views/admin/m_odr_reps/destroy.js.erb
Normal file
1
app/views/admin/m_odr_reps/destroy.js.erb
Normal file
@ -0,0 +1 @@
|
||||
$('#m_odr_rep_<%= @m_odr_rep.id %>').remove();
|
1
app/views/admin/m_odr_reps/edit.js.erb
Normal file
1
app/views/admin/m_odr_reps/edit.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
25
app/views/admin/m_odr_reps/index.html.haml
Normal file
25
app/views/admin/m_odr_reps/index.html.haml
Normal file
@ -0,0 +1,25 @@
|
||||
.qi_header
|
||||
.right= link_to 'Ajouter ', new_admin_m_odr_rep_path(), :class => "btn btn-primary", :remote => true
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
%table.table
|
||||
%tr
|
||||
%th state
|
||||
%th admin_id
|
||||
%th admin_valid
|
||||
%th token
|
||||
%th m_odr_id
|
||||
%th rgpd
|
||||
%th.actions
|
||||
|
||||
|
||||
%tbody#m_odr_reps_rows
|
||||
=render @m_odr_reps
|
||||
|
||||
|
1
app/views/admin/m_odr_reps/new.js.erb
Normal file
1
app/views/admin/m_odr_reps/new.js.erb
Normal file
@ -0,0 +1 @@
|
||||
show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
|
10
app/views/admin/m_odr_reps/show.html.haml
Normal file
10
app/views/admin/m_odr_reps/show.html.haml
Normal file
@ -0,0 +1,10 @@
|
||||
.qi_header
|
||||
%h1
|
||||
|
||||
%span
|
||||
|
||||
|
||||
|
||||
.qi_row
|
||||
.qi_pannel.qi_plain.padding
|
||||
=debug @m_odr_rep
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user