|
7 | 7 | </div> |
8 | 8 | <% end %> |
9 | 9 |
|
10 | | - <% unless structural_fields_locked? %> |
| 10 | + <% unless disabled? %> |
11 | 11 | <script type="text/x-template" data-nested-form-target="template"> |
12 | 12 | <div class="nested-fields fr-grid-row fr-grid-row--gutters fr-mb-2w" data-new-record="true"> |
13 | 13 | <div class="fr-col-4"> |
|
57 | 57 | <div class="fr-input-group <%= scope_field_error_class(index, :value) %>"> |
58 | 58 | <label class="fr-label" for="scope-<%= index %>-value"><%= t('admin.habilitation_types.form.scopes_editor.value') %> <span class="fr-ml-1w fr-text-error">*</span></label> |
59 | 59 | <input type="text" id="scope-<%= index %>-value" name="habilitation_type[scopes][][value]" value="<%= scope['value'] %>" class="fr-input" required aria-describedby="scope-<%= index %>-value-error"<%= ' disabled' if structural_fields_locked? %>> |
| 60 | + <% if structural_fields_locked? %> |
| 61 | + <input type="hidden" name="habilitation_type[scopes][][value]" value="<%= scope['value'] %>"> |
| 62 | + <% end %> |
60 | 63 | <% if scope_field_errors(index, :value).any? %> |
61 | 64 | <p class="fr-messages-group" id="scope-<%= index %>-value-error"> |
62 | 65 | <% scope_field_errors(index, :value).each do |msg| %> |
|
72 | 75 | <input type="text" id="scope-<%= index %>-group" name="habilitation_type[scopes][][group]" value="<%= scope['group'] %>" class="fr-input"<%= ' disabled' if disabled? %>> |
73 | 76 | </div> |
74 | 77 | </div> |
75 | | - <% unless structural_fields_locked? %> |
76 | | - <div class="fr-col-2 fr-mt-4w"> |
| 78 | + <div class="fr-col-2 fr-mt-4w"> |
| 79 | + <% unless structural_fields_locked? %> |
77 | 80 | <button type="button" class="fr-btn fr-btn--tertiary fr-btn--sm" data-action="click->nested-form#remove"> |
78 | 81 | <%= t('admin.habilitation_types.form.scopes_editor.remove') %> |
79 | 82 | </button> |
80 | | - </div> |
81 | | - <% end %> |
| 83 | + <% end %> |
| 84 | + </div> |
82 | 85 | </div> |
83 | 86 | <% end %> |
84 | 87 | </div> |
85 | 88 |
|
86 | | - <% unless structural_fields_locked? %> |
| 89 | + <% unless disabled? %> |
87 | 90 | <button type="button" class="fr-btn fr-btn--secondary fr-btn--sm" data-action="click->nested-form#add"> |
88 | 91 | <%= t('admin.habilitation_types.form.scopes_editor.add') %> |
89 | 92 | </button> |
|
0 commit comments