[TWIG][CSS] Found solution to show details content by default in desktop view. However, post_form is being rendered multiple times, it was already rendered in the Posting Component. Needs to be fixed.

This commit is contained in:
Eliseu Amaro 2021-07-21 00:17:05 +01:00 committed by Diogo Peralta Cordeiro
parent a48e699133
commit c18879b02f
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0
4 changed files with 144 additions and 118 deletions

View File

@ -208,3 +208,15 @@ details[open] > div {
transform: none; transform: none;
} }
} }
/* SIDE PANELS OPEN BY DEFAULT ON DESKTOP */
@media (min-width: 900px) {
.panel-mobile {
display: none;
}
}
@media (max-width: 900px) {
.panel-desktop {
display: none;
}
}

View File

@ -40,15 +40,34 @@
{% endblock header %} {% endblock header %}
<div class="container"> <div class="container">
{% block leftpanel %} <details class="panel" id="left-container">
{% endblock leftpanel %} <summary>
{{ icon('menu', 'icon icon-left') | raw }}
<div class="panel-desktop">
{{ block("leftpanel", "stdgrid.html.twig") }}
</div>
</summary>
<div class="panel-mobile">
{{ block("leftpanel", "stdgrid.html.twig") }}
</div>
</details>
{% block nav %}{% endblock %} {% block nav %}{% endblock %}
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% block javascripts %}{% endblock javascripts %} {% block javascripts %}{% endblock javascripts %}
{% block rightpanel %} <details class="panel" id="right-container">
{% endblock rightpanel %} <summary>
{{ icon('drop', 'icon icon-right') | raw }}
<div class="panel-desktop">
{{ block("rightpanel", "stdgrid.html.twig") }}
</div>
</summary>
<div class="panel-mobile">
{{ block("rightpanel", "stdgrid.html.twig") }}
</div>
</details>
</div> </div>
</body> </body>

View File

@ -1,6 +1,3 @@
<details class="panel" id="left-container">
<summary>{{ icon('menu', 'icon icon-left') | raw }}</summary>
{% if app.user %} {% if app.user %}
<div id='left-panel'> <div id='left-panel'>
<div class='navbar'> <div class='navbar'>
@ -67,5 +64,3 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
</details>

View File

@ -1,8 +1,9 @@
<details class="panel" id="right-container">
<summary>{{ icon('drop', 'icon icon-right') | raw }}</summary>
<div id='right-panel'> <div id='right-panel'>
{% if post_form is defined %} {% if post_form is defined %}
{{ form_start(post_form) }} {{ post_form }}
{#{{ form_start(post_form) }}
<div class="create-notice"> <div class="create-notice">
<div class="target"> <div class="target">
<div class="target-top"> <div class="target-top">
@ -41,7 +42,7 @@
</div> </div>
</div> </div>
</div> </div>
{{ form_end(post_form) }} {{ form_end(post_form) }}#}
{% endif %} {% endif %}
{% set current_path = app.request.get('_route') %} {% set current_path = app.request.get('_route') %}
@ -55,4 +56,3 @@
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div> </div>
</details>