diff --git a/app/assets/javascripts/admin.coffee b/app/assets/javascripts/admin.coffee
index 1612ede..a097a67 100644
--- a/app/assets/javascripts/admin.coffee
+++ b/app/assets/javascripts/admin.coffee
@@ -693,5 +693,8 @@ $(document).on "click", "#menu_item_informations h4", ->
$(this).next('.' + autocomplete_object + '_id').val ui.item.id
return
return
+
+
+
diff --git a/app/assets/stylesheets/public.scss b/app/assets/stylesheets/public.scss
index b290e3b..2c2a6d6 100644
--- a/app/assets/stylesheets/public.scss
+++ b/app/assets/stylesheets/public.scss
@@ -1242,7 +1242,6 @@ body {
.avantage {
background-image: url(http://mamotosurcircuit.com/images/interface/slide5.jpg);
background-size: cover;
- background-position: 0px -100px;
padding: 70px 0px;
position: relative;
text-align: center;
@@ -10225,6 +10224,8 @@ a.sp-video {
margin:20px 0;
background:black;
display:block;
+
+ min-height:180px;
.absolute_logo{
background:white;
@@ -10293,8 +10294,15 @@ a.sp-video {
margin-bottom:30px;
}
.logo{
- max-width:150px;
+ max-width:250px;
max-height:100px;
+ position:absolute;
+ right:10px;
+ top:-30px;
+ background:white;
+
+ padding:20px ;
+ box-shadow:0 0 5px rgba(0,0,0,0.5);
}
.circuit_img{
@@ -10304,11 +10312,12 @@ a.sp-video {
}
.info_lien{
- text-align:right;
+ text-align:left;
background:black;
color:white;
padding:10px 20px;
margin-bottom:30px;
+ min-height:50px;
}
}
@@ -10320,7 +10329,7 @@ a.sp-video {
margin:20px 0;
background:black;
display:block;
-
+ min-height:180px;
.info_lien{
color:#cc4b14
diff --git a/app/controllers/admin/departement_frances_controller.rb b/app/controllers/admin/departement_frances_controller.rb
new file mode 100644
index 0000000..ad7ded3
--- /dev/null
+++ b/app/controllers/admin/departement_frances_controller.rb
@@ -0,0 +1,76 @@
+# -*- encoding : utf-8 -*-
+
+class Admin::DepartementFrancesController < ApplicationController
+ layout "admin"
+ before_action :auth_admin
+
+ before_action :admin_space
+
+ def admin_space
+ @admin_space = "default"
+ end
+
+ def index
+ @departement_frances = DepartementFrance.all
+
+ @departement_frances = sort_by_sorting(@departement_frances, "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
+ @departement_frances = @departement_frances.page(page).per(per_page)
+
+ }
+ end
+ end
+
+ def show
+ @departement_france = DepartementFrance.find(params[:id])
+
+ end
+
+ def new
+ @departement_france = DepartementFrance.new
+
+ end
+
+ def edit
+ @departement_france = DepartementFrance.find(params[:id])
+
+ end
+
+ def create
+ @departement_france = DepartementFrance.new(params.require(:departement_france).permit!)
+
+ if @departement_france.save
+
+ else
+ render action: "new"
+
+ end
+
+ end
+
+
+ def update
+ @departement_france = DepartementFrance.find(params[:id])
+
+
+ if @departement_france.update_attributes(params.require(:departement_france).permit!)
+
+ else
+ render action: "edit"
+
+ end
+
+ end
+
+
+ def destroy
+ @departement_france = DepartementFrance.find(params[:id])
+ @departement_france.destroy
+
+ end
+end
diff --git a/app/controllers/public/circuits_controller.rb b/app/controllers/public/circuits_controller.rb
index 790a744..6739474 100644
--- a/app/controllers/public/circuits_controller.rb
+++ b/app/controllers/public/circuits_controller.rb
@@ -6,6 +6,26 @@ class Public::CircuitsController < ApplicationController
def index
@circuits = Circuit.order("name ASC").all
@circuits_active = true
+
+ if params[:search][:circuit_region_id].to_s != ""
+ @circuits = @circuits.where(:circuit_region_id => params[:search][:circuit_region_id])
+
+ end
+
+ if params[:search][:name].to_s != ""
+ @circuits = @circuits.where("name LIKE ? or city LIKE ? or cp LIKE ?","#{params[:search][:name]}%","#{params[:search][:name]}%","#{params[:search][:name]}%")
+ end
+
+ respond_to do |format|
+ format.html{
+
+ params[:search][:per_page] = params[:search][:per_page] || 10
+ per_page = params[:search][:per_page]
+ page = (params[:page] and params[:page] != "") ? params[:page] : 1
+ @circuits = @circuits.page(page).per(per_page)
+
+ }
+ end
end
diff --git a/app/controllers/public/m_odr_files_controller.rb b/app/controllers/public/m_odr_files_controller.rb
index 579c1e1..0ad627c 100644
--- a/app/controllers/public/m_odr_files_controller.rb
+++ b/app/controllers/public/m_odr_files_controller.rb
@@ -21,6 +21,10 @@ class Public::MOdrFilesController < ApplicationController
if @m_odr_file.m_odr_file_type_id == 2
@m_odr_file.m_odr_file_products.build
+ @m_odr_file.m_odr_file_products.build
+
+ else
+ @m_odr_file.m_odr_file_roulages.build
end
end
diff --git a/app/controllers/public/organisateurs_controller.rb b/app/controllers/public/organisateurs_controller.rb
index 3dda118..a2bb070 100644
--- a/app/controllers/public/organisateurs_controller.rb
+++ b/app/controllers/public/organisateurs_controller.rb
@@ -4,8 +4,20 @@ class Public::OrganisateursController < ApplicationController
def index
- @organisateurs = Organisateur.all
+ @organisateurs = Organisateur.order(:name).all
@organisateurs_active = true
+
+ respond_to do |format|
+ format.html{
+
+ params[:search][:per_page] = params[:search][:per_page] || 10
+ per_page = params[:search][:per_page]
+ page = (params[:page] and params[:page] != "") ? params[:page] : 1
+ @organisateurs = @organisateurs.page(page).per(per_page)
+
+ }
+ end
+
end
diff --git a/app/models/departement_france.rb b/app/models/departement_france.rb
new file mode 100644
index 0000000..bd27537
--- /dev/null
+++ b/app/models/departement_france.rb
@@ -0,0 +1,3 @@
+class DepartementFrance < ApplicationRecord
+ acts_as_csv_import :fields => [:num_dep, :dep_name , :region_name , :num_dep_format]
+end
diff --git a/app/models/m_odr_file.rb b/app/models/m_odr_file.rb
index 8117ba7..4ca1ad1 100644
--- a/app/models/m_odr_file.rb
+++ b/app/models/m_odr_file.rb
@@ -21,7 +21,13 @@ class MOdrFile < ApplicationRecord
before_create { generate_token() }
-
+ validates :buy_at, :presence => true, :if => :buy_at_needed?
+
+ def buy_at_needed?
+ true if self.m_odr_file_type_id == 2
+ end
+
+
after_save do
#self.p_customer.generate_prime if self.p_customer
end
diff --git a/app/models/m_odr_file_product.rb b/app/models/m_odr_file_product.rb
index e5ea584..208054e 100644
--- a/app/models/m_odr_file_product.rb
+++ b/app/models/m_odr_file_product.rb
@@ -3,7 +3,9 @@ class MOdrFileProduct < ApplicationRecord
belongs_to :m_odr_product
belongs_to :m_odr_product_size
- validates :qte, :presence => true, numericality: { greater_than: 0}
+ #validates :qte, :presence => true, numericality: { greater_than: 0}
+
+
before_save do
if self.m_odr_product_size
self.m_odr_product = self.m_odr_product_size.m_odr_product
diff --git a/app/models/p_customer.rb b/app/models/p_customer.rb
index cacfc82..df6515a 100644
--- a/app/models/p_customer.rb
+++ b/app/models/p_customer.rb
@@ -196,7 +196,7 @@ class PCustomer < ApplicationRecord
def generate_prime
- MOdrFileRoulage.joins(:m_odr_file).where("m_odr_file_roulages.nbr_primes_not_useds > 0").where(:m_odr_files => {:p_customer_id => self.id, :admin_ok => true}).order("date ASC").all.each do |mofr|
+ MOdrFileRoulage.joins(:m_odr_file).where("m_odr_file_roulages.nbr_primes_useds = 0").where(:m_odr_files => {:p_customer_id => self.id, :admin_ok => true}).order("date ASC").all.each do |mofr|
mofr.generate_prime
end
end
diff --git a/app/views/admin/circuits/_circuit.html.haml b/app/views/admin/circuits/_circuit.html.haml
index 6b80d93..c8f4071 100644
--- a/app/views/admin/circuits/_circuit.html.haml
+++ b/app/views/admin/circuits/_circuit.html.haml
@@ -4,7 +4,16 @@
-tr[:description] = capture do
%td
=circuit.description.truncate(100)
-
+
+ -tr[:cp] = capture do
+ %td
+ =d = circuit.cp.to_s[0..1]
+ -dep = DepartementFrance.where(:num_dep => d).first
+ -if dep and !circuit.circuit_region
+ -circuit.circuit_region = CircuitRegion.where(:name => dep.region_name).first
+ - circuit.save if circuit.circuit_region
+
+
-tr[:actions] = capture do
%td.actions
= link_to i(:"trash-o"), [:admin, circuit], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
diff --git a/app/views/admin/departement_frances/_departement_france.html.haml b/app/views/admin/departement_frances/_departement_france.html.haml
new file mode 100644
index 0000000..9c54d25
--- /dev/null
+++ b/app/views/admin/departement_frances/_departement_france.html.haml
@@ -0,0 +1,16 @@
+%tr#departement_france_row{:id => departement_france.id}
+ -tr = {}
+
+ -tr[:actions] = capture do
+ %td.actions
+ = link_to i(:"trash-o"), [:admin, departement_france], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
+ = link_to i(:pencil), edit_admin_departement_france_path(departement_france), :remote => true
+ = link_to i(:eye), admin_departement_france_path(departement_france), :remote => true
+
+
+
+ =render :partial => "qi/qi_ordered_table_object", :locals => {:tr => tr, :object => departement_france}
+
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/_form.html.haml b/app/views/admin/departement_frances/_form.html.haml
new file mode 100644
index 0000000..2b023e7
--- /dev/null
+++ b/app/views/admin/departement_frances/_form.html.haml
@@ -0,0 +1,15 @@
+=semantic_form_for [:admin, @departement_france], :remote => true do |f|
+
+ .content
+ =f.inputs do
+ = f.input :num_dep, :label => "num_dep :"
+ = f.input :dep_name, :label => "dep_name :"
+ = f.input :region_name, :label => "region_name :"
+ = f.input :num_dep_format, :label => "num_dep_format :"
+
+
+
+
+
+ .actions=f.submit "sauvegarder", :class => "btn btn-primary"
+
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/create.js.erb b/app/views/admin/departement_frances/create.js.erb
new file mode 100644
index 0000000..c9a9242
--- /dev/null
+++ b/app/views/admin/departement_frances/create.js.erb
@@ -0,0 +1,2 @@
+$('#departement_frances_rows').prepend("<%= escape_javascript(render(@departement_france))%>");
+close_pane_hover();
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/destroy.js.erb b/app/views/admin/departement_frances/destroy.js.erb
new file mode 100644
index 0000000..fe41f1f
--- /dev/null
+++ b/app/views/admin/departement_frances/destroy.js.erb
@@ -0,0 +1 @@
+$('#departement_france_row_<%= @departement_france.id %>').remove();
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/edit.js.erb b/app/views/admin/departement_frances/edit.js.erb
new file mode 100644
index 0000000..6c8f015
--- /dev/null
+++ b/app/views/admin/departement_frances/edit.js.erb
@@ -0,0 +1 @@
+show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/index.html.haml b/app/views/admin/departement_frances/index.html.haml
new file mode 100644
index 0000000..fc9c3d3
--- /dev/null
+++ b/app/views/admin/departement_frances/index.html.haml
@@ -0,0 +1,15 @@
+.qi_header
+ .right= link_to ic(:plus)+' Ajouter', new_admin_departement_france_path(), :class => "btn btn-primary btn-ap-add", :remote => true
+ %h1
+
+
+
+.qi_search_row
+ =form_tag "", :method => "get", :onsubmit => "" do
+ =render :partial => "qi/qi_ordered_table_search_footer", :locals => {:collection_object => @departement_frances}
+
+
+=render :partial => "qi/qi_ordered_table", :locals => {:qi_ordered_table_collection => @departement_frances}
+
+
+
diff --git a/app/views/admin/departement_frances/new.js.erb b/app/views/admin/departement_frances/new.js.erb
new file mode 100644
index 0000000..6c8f015
--- /dev/null
+++ b/app/views/admin/departement_frances/new.js.erb
@@ -0,0 +1 @@
+show_pane_hover("<%= escape_javascript(render(:partial => "form"))%>",700,900);
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/show.html.haml b/app/views/admin/departement_frances/show.html.haml
new file mode 100644
index 0000000..99d1d62
--- /dev/null
+++ b/app/views/admin/departement_frances/show.html.haml
@@ -0,0 +1,10 @@
+.qi_header
+ %h1
+
+ %span
+
+
+
+.qi_row
+ .qi_pannel.qi_plain.padding
+ =debug @departement_france
\ No newline at end of file
diff --git a/app/views/admin/departement_frances/update.js.erb b/app/views/admin/departement_frances/update.js.erb
new file mode 100644
index 0000000..8bbc4d5
--- /dev/null
+++ b/app/views/admin/departement_frances/update.js.erb
@@ -0,0 +1,2 @@
+$('#departement_france_row_<%= @departement_france.id %>').replaceWith("<%= escape_javascript(render(@departement_france))%>");
+close_pane_hover();
\ No newline at end of file
diff --git a/app/views/admin/import_csvs/_form.html.haml b/app/views/admin/import_csvs/_form.html.haml
index a36237b..28ab675 100644
--- a/app/views/admin/import_csvs/_form.html.haml
+++ b/app/views/admin/import_csvs/_form.html.haml
@@ -6,7 +6,7 @@
= f.input :name, :label => "Nom de l'import :"
= f.input :file, :label => "file :"
- = f.input :table_name, :label => "Table :" , :as => :select, :collection => ["p_customers", "circuits", "organisateurs", "m_odr_product_sizes", "m_odr_places", "circuit_regions", "m_events"]
+ = f.input :table_name, :label => "Table :" , :as => :select, :collection => ["p_customers", "circuits", "organisateurs", "m_odr_product_sizes", "m_odr_places", "circuit_regions", "m_events", "departement_frances"]
-if f.object.id
%table.import_csv_champs_form
diff --git a/app/views/admin/m_odr_files/_m_odr_file.html.haml b/app/views/admin/m_odr_files/_m_odr_file.html.haml
index f3d3352..ce808f3 100644
--- a/app/views/admin/m_odr_files/_m_odr_file.html.haml
+++ b/app/views/admin/m_odr_files/_m_odr_file.html.haml
@@ -10,6 +10,20 @@
%td
=m_odr_file.m_odr_file_type.name
+ -tr[:nbr_primes] = capture do
+ %td
+ =m_odr_file.m_odr_file_roulages.count if m_odr_file.m_odr_file_type_id == 1
+
+ -tr[:nbr_primes_useds] = capture do
+ %td
+ =MOdrPrime.where(:m_odr_file_roulage_id => m_odr_file.m_odr_file_roulages.ids).count if m_odr_file.m_odr_file_type_id == 1
+
+ -tr[:nbr_primes_not_useds] = capture do
+ %td
+ =(m_odr_file.m_odr_file_roulages.count - MOdrPrime.where(:m_odr_file_roulage_id => m_odr_file.m_odr_file_roulages.ids).count) if m_odr_file.m_odr_file_type_id == 1
+
+
+
-tr[:admin_ok] = capture do
%td
-if m_odr_file.admin_ok
diff --git a/app/views/admin/p_customers/_p_customer.html.haml b/app/views/admin/p_customers/_p_customer.html.haml
index e64d60b..723d01e 100644
--- a/app/views/admin/p_customers/_p_customer.html.haml
+++ b/app/views/admin/p_customers/_p_customer.html.haml
@@ -13,6 +13,12 @@
="-"
=p_customer.show_name
+ -tr[:mlm_token] = capture do
+ %td
+ -if p_customer.ambassadeur
+ =p_customer.mlm_token
+
+
-tr[:p_commercial] = capture do
%td
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index d655fc6..a351168 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -322,3 +322,11 @@
+:javascript
+ $('.qi_search_row form input').keypress(function (e) {
+ if (e.which == 13) {
+ $(this).closest('form').submit();
+
+ return false; //<---- Add this line
+ }
+ });
\ No newline at end of file
diff --git a/app/views/portlets/dynamic_contents/_plan.html.haml b/app/views/portlets/dynamic_contents/_plan.html.haml
index b8cf650..785ce31 100644
--- a/app/views/portlets/dynamic_contents/_plan.html.haml
+++ b/app/views/portlets/dynamic_contents/_plan.html.haml
@@ -1,66 +1,46 @@
-if @admin
plan du site
-else
- =raw ""
- .plan_sub
- .inner
- =link_to qit("Médiathèque"), search_path(:media => true)
- =link_to qit("Presse"), search_path(:press => true)
- =link_to qit("Documentation"), search_path(:doc => true)
- =link_to qit("Boutique"), "/fr/boutique.html"
-
-
-
- =raw "
"
-
+ %h1 Plan du site
.plan_body
+ %ul
+ -MenuItem.where(:parent_id => nil, :menu_id => 1).order(:position).each do |menu_item|
+ -description = ""
+ -description = menu_item.menu_content.description if menu_item.menu_content and menu_item.menu_content_type == "Page"
+ -if menu_item_link(menu_item) and menu_item_link(menu_item) != ""
+
+ %li=menu_item_link(menu_item)
+
+ %ul
+ -menu_item.children.each do |menu_item|
+ -if menu_item_link(menu_item) and menu_item_link(menu_item) != ""
+
+ %li=menu_item_link(menu_item)
+
+ %li=link_to "Trouvez votre journée", public_m_events_path
+
+
+ %li
+ =link_to "Circuits", public_circuits_path, :class => ("active" if @circuits_active)
+ %li
+ =link_to "Organisateurs", public_organisateurs_path, :class => ("active" if @organisateurs_active)
- -MenuItem.where(:parent_id => nil, :menu_id => 2).order(:position).each do |menu_item|
- -description = ""
- -description = menu_item.menu_content.description if menu_item.menu_content and menu_item.menu_content_type == "Page"
- -if menu_item_link(menu_item) and menu_item_link(menu_item) != ""
-
- %h3
- =menu_item_link(menu_item)
-
- -MenuItem.where(:id => menu_item.id).each do |menu_item|
- .plan_sub_menu{:class => "plan_sub_"+menu_item.id.to_s }
-
-
- .inner
-
-
- %ul
- -MenuItem.where(:parent_id => menu_item.id).order(:position).each do |menu_item|
-
- -menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-
+ %li
+ %a{:href => "https://www.dunlop.eu/fr_fr/motorcycle/dealers/find-a-dealer.html", :target => "_blank", :title => "Distributeurs"}
+ %span Distributeurs
+
+
+ %li=link_to "Mon compte", public_my_account_path
- -name = menu_item_lang.name
- -if menu_item_lang.enabled == true and menu_item_lang.visible == true #and menu_item.menu_content.page_type_id == 4
-
- %li
- =link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "chapitre_link "+("active" if @menu_item and menu_item.id == @menu_item.id).to_s do
- =menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
- =">"
-
-
- %ul
- -MenuItem.where(:parent_id => menu_item.id).order(:position).each do |menu_item|
-
- -menu_item_lang = menu_item.menu_item_langs.find_by_lang_site_id(@lang.id)
-
- -name = menu_item_lang.name
- -if menu_item_lang.enabled == true and menu_item_lang.visible == true and menu_item.menu_content.page_type_id == 2
-
- %li
- =link_to @one_voice_host.to_s+menu_item_path(:url => menu_item_lang.url, :lang => @lang.slug) , :class => "chapitre_link "+("active" if @menu_item and menu_item.id == @menu_item.id).to_s do
- =menu_item.menu_item_langs.find_by_lang_site_id(@lang.id).name
- =">"
-
-
-
-
- %h3=link_to "blog", articles_path(:lang => @lang.slug)
+ %li
+ %a{:accesskey => "3", :href => "/fr/plan-site.html", :title => "Plan du site"} Plan du site
+ %li
+ %a{:accesskey => "8", :href => "/fr/mentions-legales.html", :title => "Mentions légales"} Mentions légales
+ %li
+ %a{:accesskey => "8", :href => "/fr/conditions-generales-utilisation.html", :title => "Conditions générales d'utilisation"} Conditions générales d'utilisation
+
+ %br
+ %br
+ %br
\ No newline at end of file
diff --git a/app/views/public/circuits/index.html.haml b/app/views/public/circuits/index.html.haml
index 424d083..e6907ee 100644
--- a/app/views/public/circuits/index.html.haml
+++ b/app/views/public/circuits/index.html.haml
@@ -1,4 +1,32 @@
+.recherche_filtre
+ -params[:search] = params[:search] || []
+ -params[:search][:m_event_type_title] = params[:search][:m_event_type_title] || []
+
+ .centre_filtre
+ =link_to image_tag('https://www.mamotosurcircuit.com/images/interface/btn_inscription.png'), public_my_account_path(), :class => "ins"
+ %h4 Trouvez votre circuit
+
+ =form_tag "", :method => "get", :onsubmit => "" do
+
+
+ .right{:style => "position:relative;top:10px;"}
+ =submit_tag "Rechercher", :class => "submit"
+ %p
+ .select.inline_large_input=select_tag "search[circuit_region_id]", options_for_select([["Région",""]]+CircuitRegion.order(:name).all.map{|a| [a.name, a.id]}, params[:search][:circuit_region_id]), :class => ""
+
+
+
+ =text_field_tag "search[name]", params[:search][:name],:class => "form-control inline_input", :placeholder => "Nom"
+
+
+ .clear
+
+
.center_content
+
%center
%h1 Circuits
- =render @circuits
\ No newline at end of file
+ =render @circuits
+
+ .prevnext= paginate @circuits
+
\ No newline at end of file
diff --git a/app/views/public/circuits/show.html.haml b/app/views/public/circuits/show.html.haml
index 9ac963a..4b84437 100644
--- a/app/views/public/circuits/show.html.haml
+++ b/app/views/public/circuits/show.html.haml
@@ -1,10 +1,31 @@
.center_content
.circuit_show
- -if @circuit.logo
- .right
- =image_tag(@circuit.logo.file.large.medium.url, :class => "logo" )
+
+
%h1
=@circuit.name
+
+ .info_lien
+
+ -if @circuit.logo
+ .right
+ =image_tag(@circuit.logo.file.large.medium.url, :class => "logo" )
+
+ -if @circuit.longueur?
+ .block_info
+ %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_flag.png"}/
+ =@circuit.longueur
+
+
+ -if @circuit.nbr_courbes?
+ .block_info
+ %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_nombre_virages.png"}/
+ =@circuit.nbr_courbes
+
+ -if @circuit.longueur_ligne?
+ .block_info
+ %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_longueur_circuit.png"}/
+ =@circuit.longueur_ligne
@@ -24,7 +45,7 @@
=link_to "Site officiel", @circuit.website, :target => "_blank", :class => "new_btn"
-if @circuit.facebook?
- =link_to raw(ic(:'facebook-f')+" Page Facebook"), @circuit.facebook, :target => "_blank", :class => "new_btn"
+ =link_to raw(ic(:'facebook-f')), @circuit.facebook, :target => "_blank", :class => "new_btn"
.clear
@@ -38,24 +59,7 @@
=@circuit.cp
=@circuit.city
=@circuit.country
- .info_lien
-
-
- -if @circuit.longueur?
- .block_info
- %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_flag.png"}/
- =@circuit.longueur
-
-
- -if @circuit.nbr_courbes?
- .block_info
- %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_nombre_virages.png"}/
- =@circuit.nbr_courbes
-
- -if @circuit.longueur_ligne?
- .block_info
- %img{:src => "https://www.mamotosurcircuit.com/images/interface/picto_longueur_circuit.png"}/
- =@circuit.longueur_ligne
+
-@m_events = MEvent.where("start_at >= ? or end_at >= ?", Date.today.beginning_of_day, Date.today.beginning_of_day).where(:circuit_id => @circuit.id)
-if @m_events.count > 0
diff --git a/app/views/public/m_odr_files/_form.html.haml b/app/views/public/m_odr_files/_form.html.haml
index ad60f26..0409fb4 100644
--- a/app/views/public/m_odr_files/_form.html.haml
+++ b/app/views/public/m_odr_files/_form.html.haml
@@ -4,7 +4,7 @@
.qi_pannel.qi_plain.padding
=f.inputs do
- = f.input :file, :label => "Fichier :"
+
= f.hidden_field :m_odr_file_type_id
@@ -12,16 +12,17 @@
-if f.object.m_odr_file_type_id == 2
%table.m_odr_file_products_form.form-table{:style => "width:100%;"}
- = f.input :buy_at, :label => "Date de l'achat",:as => :string, :input_html => {:autocomplete => "off", :class => "year_date_picker"}
+ = f.input :buy_at, :label => "Date de l'achat :",:as => :string, :input_html => {:autocomplete => "off", :class => "year_date_picker"}
+
+
+ -if true
+ %p= public_link_to_add_fields ic(:plus)+" Ajouter un ou plusieurs pneus", f, :m_odr_file_products
-
=f.semantic_fields_for :m_odr_file_products do |form|
=render :partial => "public/m_odr_file_products/form", :locals => {:form => form}
- -if true
- %p= public_link_to_add_fields ic(:plus)+" Ajouter un ou plusieurs pneus", f, :m_odr_file_products
%br
@@ -31,15 +32,18 @@
-else
%table.m_odr_file_roulages_form.form-table{:style => "width:100%;"}
- =f.semantic_fields_for :m_odr_file_roulages do |form|
- =render :partial => "public/m_odr_file_roulages/form", :locals => {:form => form}
-
-if true
%p= public_link_to_add_fields ic(:plus)+" Ajouter une journée de roulage", f, :m_odr_file_roulages
-
-
+
+ =f.semantic_fields_for :m_odr_file_roulages do |form|
+ =render :partial => "public/m_odr_file_roulages/form", :locals => {:form => form}
+
+
+ = f.input :file, :label => "Fichier :"
+
+
%center=f.submit "sauvegarder", :class => "btn btn-primary"
%br
%br
diff --git a/app/views/public/menu_items/index.html.haml b/app/views/public/menu_items/index.html.haml
index 972d253..b342e19 100644
--- a/app/views/public/menu_items/index.html.haml
+++ b/app/views/public/menu_items/index.html.haml
@@ -19,7 +19,8 @@
%p Des avantages pour vous et votre moto
%a{:href => "/fr/primes.html"} Le programme
%br
- .block_intro
+ .block_intro{:style => "position:relative;"}
+ =image_tag "/Sticker_mockup_mmsc.png", :style => "position:absolute;top:10px;right:0px;width:280px;"
%h3
Devenez membre
%br
@@ -62,4 +63,25 @@
%img.img_av{:src => "https://www.mamotosurcircuit.com/images/interface/infosexclu_left.png"}/
%img.img_av_hover{:src => "https://www.mamotosurcircuit.com/images/interface/infosexclu_left_white.png"}/
%h5 Des informations exclusives
- %p Les coulisses de l'exploit
\ No newline at end of file
+ %p Les coulisses de l'exploit
+
+#paragraphe339.paragraphe{:style => "padding:0;margin:0;"}
+ %a{:name => "paragraphe339"}
+ .num_programme
+ .center_programme
+ .block_num
+ %span.chiffre
+ =PCustomer.where(:enabled => true).count
+ %span.label-chiffre Membres
+ .block_num
+ %span.chiffre
+ =MEvent.count
+ %span.label-chiffre Dates
+ .block_num
+ %span.chiffre
+ =Circuit.count
+ %span.label-chiffre Circuits
+ .block_num
+ %span.chiffre
+ =Organisateur.count
+ %span.label-chiffre Organisateurs
\ No newline at end of file
diff --git a/app/views/public/my_account/index.html.haml b/app/views/public/my_account/index.html.haml
index 9bab6b6..d560774 100644
--- a/app/views/public/my_account/index.html.haml
+++ b/app/views/public/my_account/index.html.haml
@@ -22,7 +22,8 @@
-else
%span.orange
=ic :flag
- Remplissez votre adresse pour recevoir vos stickers
+ Vérifiez vos coordonnées pour recevoir votre planche de stickers
+
-particular = current_p_customer.particular
@@ -48,6 +49,14 @@
%br
%p
=link_to "Modifier mes coordonnées", edit_public_particular_path(current_p_customer.particular)
+
+ %p
+ -if current_p_customer.sticker
+ %br
+ %span.green
+ =ic :flag
+
+ Planche de stickers envoyée
@@ -99,30 +108,40 @@
.clear
- %br
- %br
- .right
-
- %h3
- Mes primes :
-
- %span{:style => "font-size:16px;"}
- =c = current_p_customer.m_odr_primes.where(:state => "Virement envoyé").count
- -if c > 1
- primes obtenues sur 5 pour 2020
- -else
- prime obtenue sur 5 pour 2020
-
- -if current_p_customer.m_odr_primes.count > 0
- %table.table
- =render current_p_customer.m_odr_primes
+ -c = current_p_customer.m_odr_primes.where(:state => "Virement envoyé").count
- -else
- .empty
- Pour obtenir des primes déposez vos factures d'achat et de roulage
+ -if c > 0
+ %br
+ %br
+
+ %h3
+ Mes primes :
+ %br
+ %span{:style => "font-size:16px;"}
+ -if c == 5
+ %span.green
+ =ic :flag
+
+ -else
+ %span.orange
+ =ic :flag
+
+ =c
+ -if c > 1
+ primes obtenues sur 5 pour 2020
+ -else
+ prime obtenue sur 5 pour 2020
+
+ -if current_p_customer.m_odr_primes.count > 0
+ %table.table
+ =render current_p_customer.m_odr_primes
+
+ -else
+ .empty
+ Pour obtenir des primes déposez vos factures d'achat et de roulage
.doc_pannel
diff --git a/app/views/public/organisateurs/_organisateur.html.haml b/app/views/public/organisateurs/_organisateur.html.haml
index 25bfc53..ed77114 100644
--- a/app/views/public/organisateurs/_organisateur.html.haml
+++ b/app/views/public/organisateurs/_organisateur.html.haml
@@ -11,8 +11,15 @@
.titre_list
%h3=organisateur.name
.details
- =simple_format organisateur.description
-
+ -if organisateur.description.size > 300
+ %p
+ =organisateur.description.truncate(300)
+
+ %u
+ + d'infos
+ -else
+ =simple_format organisateur.description
+
.info_lien
.block_info
=organisateur.cp
diff --git a/app/views/public/organisateurs/index.html.haml b/app/views/public/organisateurs/index.html.haml
index 97ec1e9..0586036 100644
--- a/app/views/public/organisateurs/index.html.haml
+++ b/app/views/public/organisateurs/index.html.haml
@@ -2,4 +2,7 @@
%center
%h1 Organisateurs
- =render @organisateurs
\ No newline at end of file
+ =render @organisateurs
+
+ .prevnext= paginate @organisateurs
+
\ No newline at end of file
diff --git a/app/views/public/organisateurs/show.html.haml b/app/views/public/organisateurs/show.html.haml
index da11ecf..d7cc8c8 100644
--- a/app/views/public/organisateurs/show.html.haml
+++ b/app/views/public/organisateurs/show.html.haml
@@ -39,7 +39,7 @@
-if @organisateur.facebook?
- =link_to raw(ic(:'facebook-f')+" Page Facebook"), @organisateur.facebook, :target => "_blank", :class => "new_btn"
+ =link_to raw(ic(:'facebook-f')+""), @organisateur.facebook, :target => "_blank", :class => "new_btn"
%p.localisation{:style => "text-align:center !important;"}
diff --git a/app/views/public/p_customers/_new_form.html.haml b/app/views/public/p_customers/_new_form.html.haml
index 823dbce..c172198 100644
--- a/app/views/public/p_customers/_new_form.html.haml
+++ b/app/views/public/p_customers/_new_form.html.haml
@@ -27,7 +27,11 @@
%br
%center=f.submit "Créer mon compte", :class => "new_btn new_btn_red new_btn_big"
-
+ %br
+ %p.rgpd
+ Conformément à la loi « informatique et libertés » du 6 janvier 1978 ainsi qu'à la législation sur la protection des données personnelles (RGPD), vous bénéficiez d'un droit d'accès, de rectification, de portabilité et d'effacement. Pour exercer ces droits d'accès et de rectification, cliquez sur la rubrique Mon Compte de ce site web. Pour obtenir des informations vous concernant, contactez-nous par email, voie postale ou téléphone.
+
+
:scss
.control-label{
input{
@@ -35,4 +39,9 @@
top:5px;
}
}
+
+ .rgpd{
+ text-align:justify;
+ font-size:0.90em;
+ }
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 439b773..ac21140 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,5 +1,16 @@
Rails.application.routes.draw do
+ namespace :admin do
+ resources :departement_frances do
+ member do
+
+ end
+ collection do
+
+ end
+ end
+ end
+
namespace :admin do
resources :mail_type_cats do
member do
diff --git a/db/migrate/20200624105128_create_departement_frances.rb b/db/migrate/20200624105128_create_departement_frances.rb
new file mode 100644
index 0000000..158387e
--- /dev/null
+++ b/db/migrate/20200624105128_create_departement_frances.rb
@@ -0,0 +1,12 @@
+class CreateDepartementFrances < ActiveRecord::Migration[6.0]
+ def change
+ create_table :departement_frances do |t|
+ t.string :num_dep
+ t.string :dep_name
+ t.string :region_name
+ t.string :num_dep_format
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 4c25853..2dd11a4 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2020_06_11_051849) do
+ActiveRecord::Schema.define(version: 2020_06_24_105128) do
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "name"
@@ -319,6 +319,15 @@ ActiveRecord::Schema.define(version: 2020_06_11_051849) do
t.index ["square_image_file_id"], name: "index_data_files_on_square_image_file_id"
end
+ create_table "departement_frances", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
+ t.string "num_dep"
+ t.string "dep_name"
+ t.string "region_name"
+ t.string "num_dep_format"
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ end
+
create_table "download_contents", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
t.string "title"
t.string "style"
diff --git a/public/Sticker_mockup_mmsc.png b/public/Sticker_mockup_mmsc.png
new file mode 100644
index 0000000..b597f2e
Binary files /dev/null and b/public/Sticker_mockup_mmsc.png differ
diff --git a/public/webotheque/images/1372-sportsmart.jpg b/public/webotheque/images/1372-sportsmart.jpg
new file mode 100644
index 0000000..a37157e
Binary files /dev/null and b/public/webotheque/images/1372-sportsmart.jpg differ
diff --git a/public/webotheque/images/1373-sportsmarttt.jpg b/public/webotheque/images/1373-sportsmarttt.jpg
new file mode 100644
index 0000000..31bfb81
Binary files /dev/null and b/public/webotheque/images/1373-sportsmarttt.jpg differ
diff --git a/public/webotheque/images/1374-gpracerd212.jpg b/public/webotheque/images/1374-gpracerd212.jpg
new file mode 100644
index 0000000..5db698c
Binary files /dev/null and b/public/webotheque/images/1374-gpracerd212.jpg differ
diff --git a/public/webotheque/images/1375-gpracerslick.jpg b/public/webotheque/images/1375-gpracerslick.jpg
new file mode 100644
index 0000000..d2601b6
Binary files /dev/null and b/public/webotheque/images/1375-gpracerslick.jpg differ
diff --git a/test/fixtures/departement_frances.yml b/test/fixtures/departement_frances.yml
new file mode 100644
index 0000000..aecfecf
--- /dev/null
+++ b/test/fixtures/departement_frances.yml
@@ -0,0 +1,13 @@
+# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
+
+one:
+ num_dep: MyString
+ dep_name: MyString
+ region_name: MyString
+ num_dep_format: MyString
+
+two:
+ num_dep: MyString
+ dep_name: MyString
+ region_name: MyString
+ num_dep_format: MyString
diff --git a/test/models/departement_france_test.rb b/test/models/departement_france_test.rb
new file mode 100644
index 0000000..683fe48
--- /dev/null
+++ b/test/models/departement_france_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class DepartementFranceTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end