added admin_toolbar_content contrib module, changed toolbar home button to go to client

This commit is contained in:
2023-03-07 14:22:50 +01:00
parent 190a8d27f7
commit ef271210d2
12 changed files with 222 additions and 7 deletions

View File

@@ -39,6 +39,10 @@ extend type Query {
static(id: Int!): Static
}
extend type Query {
user(id: Int!): User
}
extend type Query {
allgroups: [Group]
}

View File

@@ -215,7 +215,9 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
->map('entity', $builder->fromParent())
->map('field', $builder->fromValue('field_entite')),
$builder->callback(function ($items) {
return $items[0];
if (isset($items[0])) {
return $items[0];
}
})
));
@@ -559,6 +561,13 @@ class OuattSchemaExtension extends SdlSchemaExtensionPluginBase {
// \____/____/\___/_/
protected function addUser(ResolverRegistryInterface $registry, ResolverBuilder $builder) {
$registry->addFieldResolver('Query', 'user',
$builder->produce('entity_load')
->map('type', $builder->fromValue('user'))
// ->map('bundles', $builder->fromValue(['static']))
->map('id', $builder->fromArgument('id'))
);
$registry->addFieldResolver('User', 'id',
$builder->produce('entity_id')
->map('entity', $builder->fromParent())

View File

@@ -171,9 +171,9 @@
#boussole-layout .form-item[data-drupal-selector="edit-field-entite"] table.field-multiple-table>tbody>tr{
border: none;
}
#boussole-layout .form-item[data-drupal-selector="edit-field-entite"] table.field-multiple-table>tbody>tr>td.field-multiple-drag{
/* #boussole-layout .form-item[data-drupal-selector="edit-field-entite"] table.field-multiple-table>tbody>tr>td.field-multiple-drag{
}
} */
#boussole-layout .form-item[data-drupal-selector="edit-field-entite"] table.field-multiple-table>tbody>tr>td:not(.field-multiple-drag)>div{
padding:0.5em;
border: 1px solid #bbb;

View File

@@ -6,7 +6,8 @@
*/
use Drupal\Core\Form\FormStateInterface;
use \Drupal\Core\Url;
use Drupal\Core\Render\Markup;
/**
* Implements hook_preprocess_HOOK() for HTML document templates.
@@ -99,3 +100,12 @@ function ouatminimal_preprocess_field_multiple_value_form__field_entite__node_co
// $t="t";
// }
// }
function ouatminimal_preprocess_toolbar(&$variables) {
unset($variables['tabs']['home']['link']['#options']['attributes']['data-toolbar-escape-admin']);
unset($variables['tabs']['home']['link']['#attributes']['data-toolbar-escape-admin']);
unset($variables['tabs']['home']['link']['#markup']);
unset($variables['tabs']['home']['link']['#children']);
$uri = $_SERVER['HTTP_REFERER'];
$variables['tabs']['home']['link']['#url'] = Url::fromUri($uri);
}

View File

@@ -0,0 +1,46 @@
{#
/**
* @file
* Theme override for the administrative toolbar.
*
* Available variables:
* - attributes: HTML attributes for the wrapper.
* - toolbar_attributes: HTML attributes to apply to the toolbar.
* - toolbar_heading: The heading or label for the toolbar.
* - tabs: List of tabs for the toolbar.
* - attributes: HTML attributes for the tab container.
* - link: Link or button for the menu tab.
* - trays: Toolbar tray list, each associated with a tab. Each tray in trays
* contains:
* - attributes: HTML attributes to apply to the tray.
* - label: The tray's label.
* - links: The tray menu links.
* - remainder: Any non-tray, non-tab elements left to be rendered.
*
* @see template_preprocess_toolbar()
*/
#}
<div{{ attributes.addClass('toolbar') }}>
<nav{{ toolbar_attributes.addClass('toolbar-bar', 'clearfix') }}>
<h2 class="visually-hidden">{{ toolbar_heading }}</h2>
{% for key, tab in tabs %}
{% set tray = trays[key] %}
<div{{ tab.attributes.addClass('toolbar-tab') }}>
{{ tab.link }}
{% apply spaceless %}
<div{{ tray.attributes }}>
{% if tray.label %}
<nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
<h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
{% else %}
<nav class="toolbar-lining clearfix" role="navigation">
{% endif %}
{{ tray.links }}
</nav>
</div>
{% endapply %}
</div>
{% endfor %}
</nav>
{{ remainder }}
</div>