batch of improvement from quantin's feedback

This commit is contained in:
Bachir Soussi Chiadmi 2019-07-05 16:27:47 +02:00
parent 983f99876c
commit 3a594202b8
6 changed files with 127 additions and 12 deletions

View File

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

View File

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

View File

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

View File

@ -21,7 +21,7 @@ editors_menus.company_add:
title: 'Add Companie' title: 'Add Companie'
appears_on: appears_on:
- view.admin_taxo.page_1 - view.admin_taxo.page_1
editors_menus.showroom_add: editors_menus.showroom_add:
route_name: entity.taxonomy_term.add_form route_name: entity.taxonomy_term.add_form
route_parameters: route_parameters:
@ -29,6 +29,22 @@ editors_menus.showroom_add:
title: 'Add Showroom' title: 'Add Showroom'
appears_on: appears_on:
- view.admin_taxo.page_2 - 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: editors_menus.user_add:
route_name: user.admin_create route_name: user.admin_create

View File

@ -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';
}

View File

@ -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>