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(){
buttons_api_carto();
button_cerfa();
button_individual();
}
function buttons_api_carto () {
@ -25,3 +26,13 @@ function button_cerfa () {
if ($('#procedure_cerfa_flag').is(':checked'))
$("#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{
display: none;
}
#individual_with_siret {
display: none;
}

View file

@ -187,7 +187,7 @@ class Admin::ProceduresController < AdminController
private
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
def create_module_api_carto_params

View file

@ -60,9 +60,16 @@
.row
.col-md-6.col-lg-6
%h4 Particuliers
%div
%label
=f.check_box :for_individual
Cette procédure s'adresse à un public qui
%b
ne possède pas de numéro SIRET,
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.
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
enable_extension "plpgsql"
@ -295,6 +295,7 @@ ActiveRecord::Schema.define(version: 20161004175442) do
t.string "lien_site_web"
t.string "lien_notice"
t.boolean "for_individual", default: false
t.boolean "individual_with_siret", default: false
end
create_table "quartier_prioritaires", force: :cascade do |t|