concernement form concernement improved
This commit is contained in:
parent
32071e2bf5
commit
2b23013fa5
|
@ -18,11 +18,13 @@ third_party_settings:
|
|||
children:
|
||||
- group_contenu
|
||||
- group_entites
|
||||
- group_details
|
||||
- status
|
||||
- uid
|
||||
- created
|
||||
label: Tabs
|
||||
region: content
|
||||
parent_name: ''
|
||||
weight: 1
|
||||
weight: 0
|
||||
format_type: tabs
|
||||
format_settings:
|
||||
classes: ''
|
||||
|
@ -63,26 +65,6 @@ third_party_settings:
|
|||
formatter: closed
|
||||
description: ''
|
||||
required_fields: true
|
||||
group_details:
|
||||
children:
|
||||
- langcode
|
||||
- uid
|
||||
- created
|
||||
- status
|
||||
label: Details
|
||||
region: content
|
||||
parent_name: group_tabs
|
||||
weight: 14
|
||||
format_type: tab
|
||||
format_settings:
|
||||
classes: ''
|
||||
show_empty_fields: true
|
||||
id: ''
|
||||
formatter: closed
|
||||
description: ''
|
||||
required_fields: true
|
||||
open: true
|
||||
weight: -100
|
||||
id: node.concernement.default
|
||||
targetEntityType: node
|
||||
bundle: concernement
|
||||
|
@ -90,7 +72,7 @@ mode: default
|
|||
content:
|
||||
created:
|
||||
type: datetime_timestamp
|
||||
weight: 5
|
||||
weight: 17
|
||||
region: content
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
|
@ -129,16 +111,9 @@ content:
|
|||
settings:
|
||||
progress_indicator: throbber
|
||||
third_party_settings: { }
|
||||
langcode:
|
||||
type: language_select
|
||||
weight: 3
|
||||
region: content
|
||||
settings:
|
||||
include_locked: true
|
||||
third_party_settings: { }
|
||||
status:
|
||||
type: boolean_checkbox
|
||||
weight: 6
|
||||
weight: 15
|
||||
region: content
|
||||
settings:
|
||||
display_label: true
|
||||
|
@ -153,7 +128,7 @@ content:
|
|||
third_party_settings: { }
|
||||
uid:
|
||||
type: entity_reference_autocomplete
|
||||
weight: 4
|
||||
weight: 16
|
||||
region: content
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
|
@ -162,6 +137,7 @@ content:
|
|||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
langcode: true
|
||||
path: true
|
||||
promote: true
|
||||
sticky: true
|
||||
|
|
|
@ -37,7 +37,14 @@ function ouatt_admin_form_node_concernement_edit_form_alter(&$form, $form_state,
|
|||
$concernement_title = $concernement_node->getTitle();
|
||||
$form_state->setTemporaryValue("concernement_title", $concernement_title);
|
||||
// menace/maintien
|
||||
|
||||
$field_entite_widget = $form['field_entite']['widget'];
|
||||
$i = 0;
|
||||
while (isset($field_entite_widget[$i]) && $item = $field_entite_widget[$i]) {
|
||||
$ief_id = $item['subform']['field_entite']['widget']['#ief_id'];
|
||||
$mm = $item['subform']['field_menace_maintien_degres']['widget'][0]['value']['#default_value'];
|
||||
$form_state->setTemporaryValue($ief_id . "_mm", $mm);
|
||||
$i++;
|
||||
}
|
||||
// actuel/future
|
||||
|
||||
}
|
||||
|
@ -52,11 +59,35 @@ function ouatt_admin_form_node_concernement_edit_form_alter(&$form, $form_state,
|
|||
* The form state of the parent form.
|
||||
*/
|
||||
function ouatt_admin_inline_entity_form_entity_form_alter(&$entity_form, &$form_state) {
|
||||
$t="t";
|
||||
// concernement title
|
||||
$concernement_title = $form_state->getTemporaryValue("concernement_title");
|
||||
$entity_form['field_menace_maintien']['widget']['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action menace/maintient \"$concernement_title\" ?");
|
||||
$entity_form['field_menace_maintien']['widget'][0]['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action menace/maintient \"$concernement_title\" ?");
|
||||
$entity_form['field_menace_maintien']['widget'][0]['value']['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action menace/maintient \"$concernement_title\" ?");
|
||||
|
||||
// menace maintient
|
||||
$ief_id = $entity_form['#ief_id'];
|
||||
$mm = $form_state->getTemporaryValue($ief_id . "_mm");
|
||||
|
||||
// field menace / maintient
|
||||
$mm_string = "menace / maintient";
|
||||
if ($mm > 0) {
|
||||
$mm_string = "maintient";
|
||||
} else if ($mm < 0) {
|
||||
$mm_string = "menace";
|
||||
}
|
||||
$entity_form['field_menace_maintien']['widget']['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action $mm_string \"$concernement_title\" ?");
|
||||
$entity_form['field_menace_maintien']['widget'][0]['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action $mm_string \"$concernement_title\" ?");
|
||||
$entity_form['field_menace_maintien']['widget'][0]['value']['#description'] = FieldFilteredMarkup::create("Pouvez-vous décrire en quoi l'action $mm_string \"$concernement_title\" ?");
|
||||
|
||||
|
||||
// field SOURCES
|
||||
// Comment avez-vous eu connaissance de cette menace / ce maintient ?
|
||||
$mm_string = "cette menace / ce maintient";
|
||||
if ($mm > 0) {
|
||||
$mm_string = "ce maintient";
|
||||
} else if ($mm < 0) {
|
||||
$mm_string = "cette menace";
|
||||
}
|
||||
|
||||
$entity_form['field_sources']['widget']['#description'] = FieldFilteredMarkup::create("Comment avez-vous eu connaissance de $mm_string ?");
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,11 +122,5 @@ function ouatt_admin_inline_entity_form_reference_form_alter(&$reference_form, &
|
|||
* @see \Drupal\inline_entity_form\InlineFormInterface::getTableFields()
|
||||
*/
|
||||
function ouatt_admin_inline_entity_form_table_fields_alter($fields, $context) {
|
||||
if ($context['entity_type'] == 'commerce_product_variation') {
|
||||
$fields['field_category'] = [
|
||||
'type' => 'field',
|
||||
'label' => t('Category'),
|
||||
'weight' => 101,
|
||||
];
|
||||
}
|
||||
$t="t";
|
||||
}
|
|
@ -156,12 +156,36 @@
|
|||
|
||||
#node-concernement-edit-form{}
|
||||
|
||||
#node-concernement-edit-form .layout-region-node-secondary{
|
||||
position: fixed;
|
||||
background-color: #fff;
|
||||
bottom:0; left:2.5em;
|
||||
width:200px;
|
||||
}
|
||||
#node-concernement-edit-form .layout-region-node-secondary >*{
|
||||
font-size: 0.765em;
|
||||
}
|
||||
|
||||
#node-concernement-edit-form .layout-region-node-secondary #edit-actions{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1em;
|
||||
}
|
||||
#node-concernement-edit-form .layout-region-node-secondary #edit-actions input,
|
||||
#node-concernement-edit-form .layout-region-node-secondary #edit-actions a{
|
||||
font-size: 1em;
|
||||
margin: 0;
|
||||
}
|
||||
/* #node-concernement-edit-form .layout-region-node-secondary #edit-actions a.button--danger{
|
||||
margin-top: 2em;
|
||||
} */
|
||||
|
||||
#node-concernement-edit-form .vertical-tabs__menu{
|
||||
/* width: auto; */
|
||||
max-width:110px;
|
||||
max-width:200px;
|
||||
}
|
||||
#node-concernement-edit-form .vertical-tabs__panes{
|
||||
margin-left: 110px;
|
||||
margin-left: 200px;
|
||||
}
|
||||
|
||||
#boussole-layout{
|
||||
|
@ -288,6 +312,11 @@ div.field--name-field-menace-maintien-degres.form-wrapper{
|
|||
flex:0 1 auto;
|
||||
} */
|
||||
|
||||
div.field--name-field-action.form-wrapper label,
|
||||
div.field--name-field-menace-maintien label{
|
||||
display: none;
|
||||
}
|
||||
|
||||
#boussole-layout .form-item[data-drupal-selector="edit-field-entite"] .button{
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ function ouatminimal_form_node_form_alter(&$form, FormStateInterface $form_state
|
|||
$form['#theme'] = ['node_edit_form'];
|
||||
$form['#attached']['library'][] = 'seven/node-form';
|
||||
|
||||
// unset($form['advanced']);
|
||||
$form['advanced']['#type'] = 'container';
|
||||
$form['meta']['#type'] = 'container';
|
||||
$form['meta']['#access'] = TRUE;
|
||||
|
@ -63,6 +64,9 @@ function ouatminimal_form_node_form_alter(&$form, FormStateInterface $form_state
|
|||
|
||||
$form['revision_information']['#type'] = 'container';
|
||||
$form['revision_information']['#group'] = 'meta';
|
||||
|
||||
// $form['author']['#group']['group_admin'];
|
||||
|
||||
}
|
||||
|
||||
// https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21theme.api.php/function/hook_theme_suggestions_HOOK_alter/10
|
||||
|
@ -115,3 +119,7 @@ function ouatminimal_preprocess_form_element(&$variables) {
|
|||
$variables['description_display']="before";
|
||||
}
|
||||
}
|
||||
|
||||
function ouatminimal_preprocess_node_edit_form__node_concernement(&$variables) {
|
||||
$variables['form']['advanced']['#group'] = "group_admin";
|
||||
}
|
|
@ -22,18 +22,19 @@
|
|||
</div>
|
||||
<div class="layout-region layout-region-node-center clearfix">
|
||||
<div class="layout-region layout-region-node-main">
|
||||
{# {{ form|without('title','advanced', 'footer', 'actions', 'group_internal') }} #}
|
||||
{{ form|without('title','footer') }}
|
||||
{{ form|without('title','advanced', 'footer', 'actions', 'group_internal') }}
|
||||
{# {{ form|without('title','footer') }} #}
|
||||
{# {{ form }} #}
|
||||
</div>
|
||||
{# <div class="layout-region layout-region-node-secondary">
|
||||
<div class="layout-region layout-region-node-secondary">
|
||||
{{ form.group_internal }}
|
||||
{{ form.advanced }}
|
||||
{{ form.actions }}
|
||||
</div> #}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layout-region layout-region-node-footer">
|
||||
{# <div class="layout-region layout-region-node-footer">
|
||||
<div class="layout-region-node-footer__content">
|
||||
{{ form.footer }}
|
||||
</div>
|
||||
</div>
|
||||
</div> #}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue