Browse Source

improved concernement admin form

bach 1 year ago
parent
commit
a6bb304bff

+ 1 - 1
src/config/sync/core.entity_form_display.node.entite.default.yml

@@ -121,7 +121,7 @@ third_party_settings:
     group_sources:
       children:
         - field_sources
-      label: Sources
+      label: 'Expériences vécues'
       region: content
       parent_name: group_tabs
       weight: 15

+ 5 - 0
src/config/sync/field.field.node.besoin.body.yml

@@ -6,7 +6,12 @@ dependencies:
     - field.storage.node.body
     - node.type.besoin
   module:
+    - allowed_formats
     - text
+third_party_settings:
+  allowed_formats:
+    allowed_formats:
+      - linkonly
 id: node.besoin.body
 field_name: body
 entity_type: node

+ 6 - 3
src/config/sync/field.field.node.entite.field_sources.yml

@@ -12,7 +12,7 @@ id: node.entite.field_sources
 field_name: field_sources
 entity_type: node
 bundle: entite
-label: Sources
+label: 'Experiences vécues'
 description: 'Comment avez-vous eu connaissance de cette menace / ce maintient ?'
 required: false
 translatable: false
@@ -25,12 +25,15 @@ settings:
       source: source
     negate: 0
     target_bundles_drag_drop:
-      action:
-        weight: 4
+      doleance:
+        weight: 5
         enabled: false
       entite_concernement:
         weight: 5
         enabled: false
+      etape:
+        weight: 7
+        enabled: false
       source:
         weight: 6
         enabled: true

+ 1 - 1
src/config/sync/paragraphs.paragraphs_type.source.yml

@@ -3,7 +3,7 @@ langcode: fr
 status: true
 dependencies: {  }
 id: source
-label: source
+label: 'Expérience vécue'
 icon_uuid: null
 icon_default: null
 description: 'action''s source'

+ 3 - 0
src/web/themes/custom/ouatminimal_theme/css/ouatminimal.css

@@ -206,6 +206,9 @@ div[data-drupal-selector=edit-actions] > * {
 #node-concernement-edit-form .ief-entity-operations input[type=submit].ief-submit-remove {
   display: none;
 }
+#node-concernement-edit-form .field--name-field-date > * {
+  display: inline-block;
+}
 
 #boussole-layout {
   display: flex;

File diff suppressed because it is too large
+ 0 - 0
src/web/themes/custom/ouatminimal_theme/css/ouatminimal.css.map


+ 10 - 11
src/web/themes/custom/ouatminimal_theme/ouatminimal.theme

@@ -157,17 +157,16 @@ function ouatminimal_preprocess_input(&$variables) {
     if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add$/', $name)) {
       $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Editer l'entité";
     } 
-    // // rename entité reference in paragraphe "Ajouter un node existant" to "ajouyer entite existante"
-    // // "ief-field_entite-0-subform-field_entite-form-add"
-    // if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add-existing$/', $name)) {
-    //   $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter une entité éxistante";
-    // }
-
-    // // rename entité reference in paragraphe "Ajout de node" to "Ajouter"
-    // // "ief-reference-submit-field_entite-7-subform-field_entite-form"
-    // if (preg_match('/^ief-reference-submit-field_entite-\d+-subform-field_entite-form$/', $name)) {
-    //   $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter";
-    // }
+
+    // ief-add-submit-field_entite-15-subform-field_entite-form
+    if (preg_match('/^ief-add-submit-field_entite-\d+-subform-field_entite-form$/', $name)) {
+      $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Créer l'entité";
+    } 
+
+    // ief-edit-submit-field_entite-14-subform-field_entite-form-0
+    if (preg_match('/^ief-edit-submit-field_entite-\d+-subform-field_entite-form-\d+$/', $name)) {
+      $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Enregistrer l'entité";
+    } 
 
     // rename remove (paragraphe) to "supprimer" 
     if (preg_match('/field_entite_\d+_remove/', $name)) {

+ 6 - 0
src/web/themes/custom/ouatminimal_theme/scss/ouatminimal.scss

@@ -222,6 +222,12 @@ div[data-drupal-selector="edit-actions"]{
   .ief-entity-operations input[type="submit"].ief-submit-remove{
     display: none;
   }
+
+  .field--name-field-date{
+    >*{
+      display: inline-block;
+    }
+  }
 }
 
 

+ 44 - 0
src/web/themes/custom/ouatminimal_theme/templates/form/field-multiple-value-form--field-sources--node-concernement.html.twig

@@ -0,0 +1,44 @@
+{#
+/**
+ * @file
+ * Default theme implementation for an individual form element.
+ *
+ * Available variables for all fields:
+ * - multiple: Whether there are multiple instances of the field.
+ *
+ * Available variables for single cardinality fields:
+ * - elements: Form elements to be rendered.
+ *
+ * Available variables when there are multiple fields.
+ * - table: Table of field items.
+ * - description: The description element containing the following properties:
+ *   - content: The description content of the form element.
+ *   - attributes: HTML attributes to apply to the description container.
+ * - button: "Add another item" button.
+ *
+ * @see template_preprocess_field_multiple_value_form()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if multiple %}
+  {%
+    set classes = [
+      'js-form-item',
+      'form-item'
+    ]
+  %}
+  <div{{ attributes.addClass(classes) }}>
+    {% if description.content %}
+      <div{{ description.attributes.addClass('description') }} >{{ description.content }}</div>
+    {% endif %}
+    {{ table }}
+    {% if button %}
+      <div class="clearfix">{{ button }}</div>
+    {% endif %}
+  </div>
+{% else %}
+  {% for element in elements %}
+    {{ element }}
+  {% endfor %}
+{% endif %}

Some files were not shown because too many files changed in this diff