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.children('.drop-down-list').removeClass('show-inline');
|
||||
parent.children('.pj-template').removeClass('show-inline');
|
||||
parent.children('.carte-options').removeClass('show-inline');
|
||||
|
||||
$('.mandatory', parent).show();
|
||||
|
||||
|
@ -42,6 +43,9 @@ $(document).on('change', 'select.form-control.type-champ', function() {
|
|||
case 'piece_justificative':
|
||||
parent.children('.pj-template').addClass('show-inline');
|
||||
break;
|
||||
case 'carte':
|
||||
parent.children('.carte-options').addClass('show-inline');
|
||||
break;
|
||||
case 'explication':
|
||||
$('.mandatory', parent).hide();
|
||||
break;
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
}
|
||||
|
||||
.form-group.drop-down-list,
|
||||
.form-group.pj-template {
|
||||
.form-group.pj-template,
|
||||
.form-group.carte-options {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ class TypesDeChampService
|
|||
:id,
|
||||
:mandatory,
|
||||
:piece_justificative_template,
|
||||
:quartiers_prioritaires,
|
||||
:cadastres,
|
||||
drop_down_list_attributes: [:value, :id]
|
||||
])
|
||||
|
||||
|
|
|
@ -38,6 +38,16 @@
|
|||
= ff.file_field :piece_justificative_template,
|
||||
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))
|
||||
.form-group.mandatory{ style: hide_mandatory ? 'visibility: hidden;' : nil }
|
||||
%h4 Obligatoire ?
|
||||
|
|
|
@ -28,3 +28,4 @@ fr:
|
|||
dossier_link: 'Lien vers un autre dossier'
|
||||
piece_justificative: 'Pièce justificative'
|
||||
siret: 'SIRET'
|
||||
carte: 'Carte'
|
||||
|
|
Loading…
Reference in a new issue