Skip to content
Snippets Groups Projects
Commit 19d343b1 authored by Erik Seifert's avatar Erik Seifert
Browse files

Fix: add some layouts

parent f046d145
No related branches found
No related tags found
No related merge requests found
.layouts-dashboards-1 {
display: flex;
justify-content: space-between;
}
.layouts-dashboards-1 .row {
display: flex;
flex-direction: column;
}
.layouts-dashboards-1 .row:first-child {
flex: 1 3
}
.layouts-dashboards-1 .row:last-child {
flex: 2 3;
}
.layouts-dashboards-2 .row > div,
.layouts-dashboards-1 .row > div {
flex: 1;
padding: 1em;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 4px 10px 0 rgba(0, 0, 0, 0.19);
margin-right: 1em;
margin-bottom: 1em;
}
.layouts-dashboards-2 {
display: flex;
}
.layouts-dashboards-2 .row {
flex: 1;
display: flex;
flex-direction: column;
}
.layouts-dashboards-2 .row > div {
flex-grow: 1;
}
@media only screen and (max-width: 600px) {
.layouts-dashboards-1,
.layouts-dashboards-2 {
flex-direction: column;
}
}
layout_1:
label: 'BC three column'
label: '2 and one column'
path: templates/layouts
template: layouts--1
category: 'Dashboards'
......@@ -14,3 +14,19 @@ layout_1:
label: Left Bottom
three:
label: Right
layout_2:
label: '3 columns'
path: templates/layouts
template: layouts--2
category: 'Dashboards'
icon_map:
- [one, two, three]
library: dashboards/layouts
regions:
one:
label: Left
two:
label: Middle
three:
label: Right
......@@ -95,9 +95,7 @@ class DashboardViewBuilder extends EntityViewBuilder {
$cacheability = new CacheableMetadata();
$storage = $this->sectionStorageManager->findByContext($contexts, $cacheability);
if (is_a($storage, UserDashboardSectionStorage::class)) {
if ($entity->isOverriden()) {
$entity->loadOverrides();
}
$entity->loadOverrides();
$contexts[Dashboard::CONTEXT_TYPE] = $contexts['layout_builder.entity'] = EntityContext::fromEntity($entity);
}
$this->moduleHandler->alter('layout_builder_view_context', $contexts, $storage);
......
<section {{ attributes }}>
<section {{ attributes.addClass('layouts-dashboards-1') }}>
<div class="row">
{% if content.one %}
<div {{ region_attributes.one }}>
{{ content.one }}
</div>
{% endif %}
{% if content.two %}
<div {{ region_attributes.two }}>
{{ content.two }}
</div>
{% endif %}
</div>
{% if content.three %}
<div class="row">
<div {{ region_attributes.three }}>
{{ content.three }}
</div>
</div>
{% endif %}
</section>
<section {{ attributes.addClass('layouts-dashboards-2') }}>
{% if content.one %}
<div class="row">
<div {{ region_attributes.one }}>
{{ content.one }}
</div>
</div>
{% endif %}
{% if content.two %}
<div class="row">
<div {{ region_attributes.two }}>
{{ content.two }}
</div>
</div>
{% endif %}
{% if content.three %}
<div class="row">
<div {{ region_attributes.three }}>
{{ content.three }}
</div>
</div>
{% endif %}
</section>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment