Can create procédure individual with SIRET for later

This commit is contained in:
Xavier J 2016-10-05 10:48:11 +02:00
parent 551df27192
commit aa3b1e974d
6 changed files with 44 additions and 16 deletions

View file

@ -4,6 +4,7 @@ $(document).ready(button_edit_procedure_init);
function button_edit_procedure_init(){ function button_edit_procedure_init(){
buttons_api_carto(); buttons_api_carto();
button_cerfa(); button_cerfa();
button_individual();
} }
function buttons_api_carto () { function buttons_api_carto () {
@ -25,3 +26,13 @@ function button_cerfa () {
if ($('#procedure_cerfa_flag').is(':checked')) if ($('#procedure_cerfa_flag').is(':checked'))
$("#procedure_lien_demarche").show(); $("#procedure_lien_demarche").show();
} }
function button_individual () {
$("#procedure_for_individual").on('change', function() {
$("#individual_with_siret").toggle()
});
if ($('#procedure_for_individual').is(':checked'))
$("#individual_with_siret").show();
}

View file

@ -5,3 +5,7 @@
#procedure_lien_demarche{ #procedure_lien_demarche{
display: none; display: none;
} }
#individual_with_siret {
display: none;
}

View file

@ -187,7 +187,7 @@ class Admin::ProceduresController < AdminController
private private
def create_procedure_params def create_procedure_params
params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :lien_site_web, :lien_notice, :euro_flag, :logo, :cerfa_flag, :for_individual, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id) params.require(:procedure).permit(:libelle, :description, :organisation, :direction, :lien_demarche, :lien_site_web, :lien_notice, :euro_flag, :logo, :cerfa_flag, :for_individual, :individual_with_siret, module_api_carto_attributes: [:id, :use_api_carto, :quartiers_prioritaires, :cadastre]).merge(administrateur_id: current_administrateur.id)
end end
def create_module_api_carto_params def create_module_api_carto_params

View file

@ -25,7 +25,7 @@
%h4 Drapeau européen %h4 Drapeau européen
%label %label
=f.check_box :euro_flag =f.check_box :euro_flag
Afficher le drapeau européen Afficher le drapeau européen
%br %br
@ -60,9 +60,16 @@
.row .row
.col-md-6.col-lg-6 .col-md-6.col-lg-6
%h4 Particuliers %h4 Particuliers
%label %div
=f.check_box :for_individual %label
Cette procédure s'adresse à un public qui =f.check_box :for_individual
%b Cette procédure s'adresse à un public qui
ne possède pas de numéro SIRET, %b
qui doivent donc s'identifier en tant que personne physique. ne possède pas (ou pas encore) de numéro SIRET,
qui doivent donc s'identifier en tant que personne physique.
%ul#individual_with_siret{style:'margin-top: 8px'}
%li
%label
=f.check_box :individual_with_siret
Donner la possibilité de renseigner un SIRET au cours de la construction du dossier.

View file

@ -0,0 +1,5 @@
class AddIndividualWithSiretInProcedure < ActiveRecord::Migration
def change
add_column :procedures, :individual_with_siret, :boolean, default: false
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161004175442) do ActiveRecord::Schema.define(version: 20161005082113) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -282,19 +282,20 @@ ActiveRecord::Schema.define(version: 20161004175442) do
t.string "organisation" t.string "organisation"
t.string "direction" t.string "direction"
t.string "lien_demarche" t.string "lien_demarche"
t.datetime "created_at", null: false t.datetime "created_at", null: false
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
t.boolean "test" t.boolean "test"
t.integer "administrateur_id" t.integer "administrateur_id"
t.boolean "archived", default: false t.boolean "archived", default: false
t.boolean "euro_flag", default: false t.boolean "euro_flag", default: false
t.string "logo" t.string "logo"
t.boolean "cerfa_flag", default: false t.boolean "cerfa_flag", default: false
t.string "logo_secure_token" t.string "logo_secure_token"
t.boolean "published", default: false, null: false t.boolean "published", default: false, null: false
t.string "lien_site_web" t.string "lien_site_web"
t.string "lien_notice" t.string "lien_notice"
t.boolean "for_individual", default: false t.boolean "for_individual", default: false
t.boolean "individual_with_siret", default: false
end end
create_table "quartier_prioritaires", force: :cascade do |t| create_table "quartier_prioritaires", force: :cascade do |t|