Ver código fonte

trimed auto_label for reponse, better response display in besoin form

bach 1 ano atrás
pai
commit
4002c99966

+ 2 - 2
src/config/sync/auto_entitylabel.settings.node.besoin.yml

@@ -1,8 +1,8 @@
 status: 1
-pattern: 'besoin-[node:field_concernement:entity:title]-[node:field_index:value]'
+pattern: '[node:body]'
 escape: false
 preserve_titles: false
-save: false
+save: true
 chunk: 50
 dependencies:
   config:

+ 24 - 0
src/web/modules/custom/ouatt_admin/ouatt_admin.module

@@ -123,4 +123,28 @@ function ouatt_admin_inline_entity_form_reference_form_alter(&$reference_form, &
  */
 function ouatt_admin_inline_entity_form_table_fields_alter($fields, $context) {
   $t="t";
+}
+
+/**
+ * Provide post-processing of auto generated titles (labels).
+ *
+ * @param string $label
+ *   The auto-generated label to be altered.
+ * @param object $entity
+ *   The entity that the label is from.
+ *
+ * @see \Drupal\auto_entitylabel\AutoEntityLabelManager::generateLabel()
+ */
+function ouatt_admin_auto_entitylabel_label_alter(&$label, $entity) {
+  if (strlen($label) > 50) {
+    // if ($html) {
+    //     // Grabs the original and escapes any quotes
+    //     $original = str_replace('"', '\"', $label);
+    // }
+
+    // Truncates the string
+    $label = substr(strip_tags($label), 0, 50);
+
+    $label .= '...';
+  }
 }

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

@@ -209,6 +209,14 @@ div[data-drupal-selector=edit-actions] > * {
 #node-concernement-edit-form .field--name-field-date > * {
   display: inline-block;
 }
+#node-concernement-edit-form .field--name-field-reponse > .field__item {
+  padding-top: 1em;
+}
+#node-concernement-edit-form .field--name-field-reponse > .field__item:not(:last-of-type) {
+  padding-bottom: 1em;
+  border-bottom: #ccc 1px solid;
+  margin-bottom: 1em;
+}
 
 #boussole-layout {
   display: flex;

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
src/web/themes/custom/ouatminimal_theme/css/ouatminimal.css.map


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

@@ -228,6 +228,17 @@ div[data-drupal-selector="edit-actions"]{
       display: inline-block;
     }
   }
+
+  .field--name-field-reponse{
+    >.field__item{
+      padding-top: 1em;
+      &:not(:last-of-type){
+        padding-bottom: 1em;
+        border-bottom: #ccc 1px solid;
+        margin-bottom: 1em;
+      }
+    }
+  }
 }
 
 

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff