Add carte type de champ options
This commit is contained in:
parent
b40abaa133
commit
4249f8ae25
5 changed files with 19 additions and 1 deletions
|
@ -27,6 +27,7 @@ $(document).on('change', 'select.form-control.type-champ', function() {
|
||||||
parent.removeClass('header-section');
|
parent.removeClass('header-section');
|
||||||
parent.children('.drop-down-list').removeClass('show-inline');
|
parent.children('.drop-down-list').removeClass('show-inline');
|
||||||
parent.children('.pj-template').removeClass('show-inline');
|
parent.children('.pj-template').removeClass('show-inline');
|
||||||
|
parent.children('.carte-options').removeClass('show-inline');
|
||||||
|
|
||||||
$('.mandatory', parent).show();
|
$('.mandatory', parent).show();
|
||||||
|
|
||||||
|
@ -42,6 +43,9 @@ $(document).on('change', 'select.form-control.type-champ', function() {
|
||||||
case 'piece_justificative':
|
case 'piece_justificative':
|
||||||
parent.children('.pj-template').addClass('show-inline');
|
parent.children('.pj-template').addClass('show-inline');
|
||||||
break;
|
break;
|
||||||
|
case 'carte':
|
||||||
|
parent.children('.carte-options').addClass('show-inline');
|
||||||
|
break;
|
||||||
case 'explication':
|
case 'explication':
|
||||||
$('.mandatory', parent).hide();
|
$('.mandatory', parent).hide();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-group.drop-down-list,
|
.form-group.drop-down-list,
|
||||||
.form-group.pj-template {
|
.form-group.pj-template,
|
||||||
|
.form-group.carte-options {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ class TypesDeChampService
|
||||||
:id,
|
:id,
|
||||||
:mandatory,
|
:mandatory,
|
||||||
:piece_justificative_template,
|
:piece_justificative_template,
|
||||||
|
:quartiers_prioritaires,
|
||||||
|
:cadastres,
|
||||||
drop_down_list_attributes: [:value, :id]
|
drop_down_list_attributes: [:value, :id]
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,16 @@
|
||||||
= ff.file_field :piece_justificative_template,
|
= ff.file_field :piece_justificative_template,
|
||||||
direct_upload: true
|
direct_upload: true
|
||||||
|
|
||||||
|
.form-group.carte-options{ class: (type_champ == TypeDeChamp.type_champs.fetch(:carte)) ? 'show-inline' : nil }
|
||||||
|
%h4 Utilisation de la cartographie
|
||||||
|
%label
|
||||||
|
= ff.check_box :quartiers_prioritaires
|
||||||
|
Quartiers prioritaires
|
||||||
|
%br
|
||||||
|
%label
|
||||||
|
= ff.check_box :cadastres
|
||||||
|
Cadastre
|
||||||
|
|
||||||
- hide_mandatory = (ff.object.object.private? || type_champ == TypeDeChamp.type_champs.fetch(:explication))
|
- hide_mandatory = (ff.object.object.private? || type_champ == TypeDeChamp.type_champs.fetch(:explication))
|
||||||
.form-group.mandatory{ style: hide_mandatory ? 'visibility: hidden;' : nil }
|
.form-group.mandatory{ style: hide_mandatory ? 'visibility: hidden;' : nil }
|
||||||
%h4 Obligatoire ?
|
%h4 Obligatoire ?
|
||||||
|
|
|
@ -28,3 +28,4 @@ fr:
|
||||||
dossier_link: 'Lien vers un autre dossier'
|
dossier_link: 'Lien vers un autre dossier'
|
||||||
piece_justificative: 'Pièce justificative'
|
piece_justificative: 'Pièce justificative'
|
||||||
siret: 'SIRET'
|
siret: 'SIRET'
|
||||||
|
carte: 'Carte'
|
||||||
|
|
Loading…
Reference in a new issue