Browse Source

batch of improvement from quantin's feedback

Bachir Soussi Chiadmi 4 years ago
parent
commit
3a594202b8

+ 4 - 5
config/sync/core.entity_form_display.node.article.default.yml

@@ -32,7 +32,6 @@ third_party_settings:
         - group_contents
         - group_media
         - group_taxonomy
-        - group_internal
       parent_name: ''
       weight: 0
       format_type: tabs
@@ -93,12 +92,12 @@ third_party_settings:
     group_internal:
       children:
         - langcode
-        - translation
+        - field_date
         - field_workflow
         - field_migration
         - field_memo
-      parent_name: group_htabs
-      weight: 13
+      parent_name: ''
+      weight: 1
       format_type: tab
       format_settings:
         id: ''
@@ -123,7 +122,7 @@ content:
     third_party_settings: {  }
     region: content
   field_date:
-    weight: 26
+    weight: 3
     settings: {  }
     third_party_settings: {  }
     type: daterange_default

+ 3 - 5
config/sync/core.entity_form_display.taxonomy_term.showroom.default.yml

@@ -22,7 +22,6 @@ third_party_settings:
       children:
         - group_contents
         - group_info
-        - group_internal
       parent_name: ''
       weight: 1
       format_type: tabs
@@ -55,8 +54,8 @@ third_party_settings:
         - translation
         - field_workflow
         - field_migration
-      parent_name: group_tabs
-      weight: 22
+      parent_name: ''
+      weight: 2
       format_type: tab
       format_settings:
         id: ''
@@ -109,8 +108,7 @@ content:
     region: content
   field_public_address:
     weight: 5
-    settings:
-      default_country: null
+    settings: {  }
     third_party_settings: {  }
     type: address_default
     region: content

+ 5 - 1
config/sync/views.view.admin_taxo.yml

@@ -1233,7 +1233,7 @@ display:
             group_items: {  }
           plugin_id: string
       sorts: {  }
-      title: Tags
+      title: Taxonomy
       header:
         result:
           id: result
@@ -3765,6 +3765,7 @@ display:
         fields: false
         filters: false
         filter_groups: false
+        title: false
       row:
         type: fields
         options: {  }
@@ -4577,6 +4578,7 @@ display:
         weight: 0
         context: '0'
         menu_name: main
+      title: Thesaurus
     cache_metadata:
       max-age: 0
       contexts:
@@ -4683,6 +4685,7 @@ display:
         fields: false
         filters: false
         filter_groups: false
+        title: false
       row:
         type: fields
         options: {  }
@@ -5495,6 +5498,7 @@ display:
         weight: 0
         context: '0'
         menu_name: main
+      title: Tags
     cache_metadata:
       max-age: 0
       contexts:

+ 17 - 1
web/modules/custom/editors_menus/editors_menus.links.action.yml

@@ -21,7 +21,7 @@ editors_menus.company_add:
   title: 'Add Companie'
   appears_on:
     - view.admin_taxo.page_1
-
+    
 editors_menus.showroom_add:
   route_name: entity.taxonomy_term.add_form
   route_parameters:
@@ -29,6 +29,22 @@ editors_menus.showroom_add:
   title: 'Add Showroom'
   appears_on:
     - view.admin_taxo.page_2
+    
+editors_menus.thesaurus_add:
+  route_name: entity.taxonomy_term.add_form
+  route_parameters:
+    taxonomy_vocabulary: 'thesaurus'
+  title: 'Add Thesaurus'
+  appears_on:
+    - view.admin_taxo.page_3
+        
+editors_menus.tag_add:
+  route_name: entity.taxonomy_term.add_form
+  route_parameters:
+    taxonomy_vocabulary: 'tags'
+  title: 'Add Tag'
+  appears_on:
+    - view.admin_taxo.page_4
 
 editors_menus.user_add:
   route_name: user.admin_create

+ 65 - 0
web/themes/custom/matminimal/matminimal.theme

@@ -0,0 +1,65 @@
+<?php
+
+/**
+ * @file
+ * Functions to support theming in the Seven theme.
+ */
+
+use Drupal\Core\Form\FormStateInterface;
+
+
+/**
+ * Implements hook_preprocess_HOOK() for HTML document templates.
+ */
+// function matminimal_preprocess_html(&$variables) {
+//   // If on a node add or edit page, add a node-layout class.
+//   $path_args = explode('/', \Drupal::request()->getPathInfo());
+//   if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) {
+//     foreach ($suggestions as $suggestion) {
+//       // dsm($suggestion);
+//       preg_match('/taxonomy-manage-[^-]+-add$/', $suggestion, $matches);
+//       // ksm($matches);
+//       if ($suggestion === 'page--taxonomy-term-edit' || isset($matches)) {
+//         $variables['attributes']['class'][] = 'node-form-layout';
+//       }
+//     }
+//   }
+// }
+
+// function matminimal_form_alter(&$form, FormStateInterface $form_state, $form_id){
+//   // dsm($form_id);
+//   // create a colomuned term form (not working yet)
+//   if(in_array($form_id, ['taxonomy_term_company_form', 'taxonomy_term_showroom_form'])){
+//     // ksm($form);
+//     $form['#theme'] = ['term_edit_form'];
+//     $form['#attached']['library'][] = 'seven/node-form';
+// 
+//     $form['advanced']['#type'] = 'container';
+//     $form['meta']['#type'] = 'container';
+//     $form['meta']['#access'] = TRUE;
+//     $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline';
+//     $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline';
+// 
+//     $form['revision_information']['#type'] = 'container';
+//     $form['revision_information']['#group'] = 'meta';
+//   }
+// }
+
+/**
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
+ *
+ * Changes vertical tabs to container.
+ */
+function matminimal_form_node_form_alter(&$form, FormStateInterface $form_state) {
+  $form['#theme'] = ['node_edit_form'];
+  $form['#attached']['library'][] = 'seven/node-form';
+
+  $form['advanced']['#type'] = 'container';
+  $form['meta']['#type'] = 'container';
+  $form['meta']['#access'] = TRUE;
+  $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline';
+  $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline';
+
+  $form['revision_information']['#type'] = 'container';
+  $form['revision_information']['#group'] = 'meta';
+}

+ 33 - 0
web/themes/custom/matminimal/templates/form/node-edit-form.html.twig

@@ -0,0 +1,33 @@
+{#
+/**
+ * @file
+ * Theme override for a node edit form.
+ *
+ * Two column template for the node add/edit form.
+ *
+ * This template will be used when a node edit form specifies 'node_edit_form'
+ * as its #theme callback.  Otherwise, by default, node add/edit forms will be
+ * themed by form.html.twig.
+ *
+ * Available variables:
+ * - form: The node add/edit form.
+ *
+ * @see seven_form_node_form_alter()
+ */
+#}
+
+<div class="layout-node-form clearfix">
+  <div class="layout-region layout-region-node-main">
+    {{ form|without('advanced', 'footer', 'actions', 'group_internal') }}
+  </div>
+  <div class="layout-region layout-region-node-secondary">
+    {{ form.group_internal }}
+    {{ form.advanced }}
+    {{ form.actions }}
+  </div>
+  <div class="layout-region layout-region-node-footer">
+    <div class="layout-region-node-footer__content">
+      {{ form.footer }}
+    </div>
+  </div>
+</div>