suite
This commit is contained in:
parent
93b8f1c3df
commit
44ec541588
@ -13,7 +13,7 @@ class Public::CircuitsController < ApplicationController
|
||||
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]}%")
|
||||
@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|
|
||||
|
@ -7,6 +7,17 @@ class Public::OrganisateursController < ApplicationController
|
||||
@organisateurs = Organisateur.order(:name).all
|
||||
@organisateurs_active = true
|
||||
|
||||
|
||||
if params[:search][:circuit_region_id].to_s != ""
|
||||
@organisateurs = @organisateurs.where(:circuit_region_id => params[:search][:circuit_region_id])
|
||||
|
||||
end
|
||||
|
||||
if params[:search][:name].to_s != ""
|
||||
@organisateurs = @organisateurs.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{
|
||||
|
||||
|
@ -98,8 +98,6 @@ class Public::PCustomerAuthsController < ApplicationController
|
||||
|
||||
|
||||
if @edit_p_customer.save
|
||||
redirect_to public_my_account_path, :notice => "Votre mot de passe est à jour."
|
||||
|
||||
if params[:for_order].to_s != ""
|
||||
redirect_to particulars_public_p_orders_path(), :notice => "Votre mot de passe est à jour."
|
||||
elsif
|
||||
|
@ -36,6 +36,7 @@ class Organisateur < ApplicationRecord
|
||||
belongs_to :image_file
|
||||
belongs_to :logo, :class_name => "ImageFile"
|
||||
|
||||
belongs_to :circuit_region
|
||||
|
||||
def member_label
|
||||
"#{self.name}"
|
||||
|
@ -5,6 +5,9 @@
|
||||
|
||||
= f.input :logo_id, :label => "Logo :", :as => :qi_image_select
|
||||
= f.input :image_file_id, :label => "Image :" , :as => :qi_image_select
|
||||
|
||||
= f.input :circuit_region, :label => "Région :"
|
||||
|
||||
|
||||
= f.input :name, :label => "Nom :"
|
||||
= f.input :website, :label => "Site web :"
|
||||
|
@ -1,6 +1,15 @@
|
||||
%tr#organisateur_row{:id => organisateur.id}
|
||||
-tr = {}
|
||||
|
||||
-tr[:cp] = capture do
|
||||
%td
|
||||
=d = organisateur.cp.to_s[0..1]
|
||||
-dep = DepartementFrance.where(:num_dep => d).first
|
||||
-if dep and !organisateur.circuit_region
|
||||
-organisateur.circuit_region = CircuitRegion.where(:name => dep.region_name).first
|
||||
- organisateur.save if organisateur.circuit_region
|
||||
|
||||
|
||||
-tr[:actions] = capture do
|
||||
%td.actions
|
||||
= link_to i(:"trash-o"), [:admin, organisateur], method: :delete, data: { confirm: 'Voulez-vous vraiment supprimer cet enregistrement ? ' } , :remote => true
|
||||
|
@ -3,13 +3,12 @@
|
||||
-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;"}
|
||||
.right{:style => ""}
|
||||
=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 => ""
|
||||
|
@ -1,3 +1,25 @@
|
||||
.recherche_filtre
|
||||
-params[:search] = params[:search] || []
|
||||
-params[:search][:m_event_type_title] = params[:search][:m_event_type_title] || []
|
||||
|
||||
.centre_filtre
|
||||
%h4 Trouvez votre organisateur
|
||||
|
||||
=form_tag "", :method => "get", :onsubmit => "" do
|
||||
|
||||
|
||||
.right{:style => ""}
|
||||
=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 Organisateurs
|
||||
|
@ -0,0 +1,5 @@
|
||||
class AddCircuitRegionToOrganisateurs < ActiveRecord::Migration[6.0]
|
||||
def change
|
||||
add_column :organisateurs, :circuit_region_id, :integer
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2020_06_24_105128) do
|
||||
ActiveRecord::Schema.define(version: 2020_06_24_140026) do
|
||||
|
||||
create_table "accounting_zones", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4", force: :cascade do |t|
|
||||
t.string "name"
|
||||
@ -1380,6 +1380,7 @@ ActiveRecord::Schema.define(version: 2020_06_24_105128) do
|
||||
t.string "affiliation"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.integer "circuit_region_id"
|
||||
t.index ["admin_id"], name: "index_organisateurs_on_admin_id"
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user