Skip to content

Commit 0bddc69

Browse files
authored
Display: Fix duplicated app container + remove unnecessary from_vue value #5680 (#5691)
1 parent 972406f commit 0bddc69

File tree

8 files changed

+21
-51
lines changed

8 files changed

+21
-51
lines changed

public/main/inc/lib/template.lib.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ public static function setVueParams(&$params)
718718
$encoded = json_encode($user);
719719
}
720720
$params['user'] = $encoded;*/
721-
$params['from_vue'] = isset($_REQUEST['from_vue']) ? 1 : 0;
722721
}
723722

724723
/**

src/CoreBundle/Controller/IndexController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class IndexController extends BaseController
3333
#[Route('/p/{slug}', name: 'public_page')]
3434
public function index(): Response
3535
{
36-
return $this->render('@ChamiloCore/Index/vue.html.twig');
36+
return $this->render('@ChamiloCore/Layout/no_layout.html.twig', ['content' => '']);
3737
}
3838

3939
/**

src/CoreBundle/EventListener/ExceptionListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function __invoke(ExceptionEvent $event): void
5757
$message = $this->twig->render(
5858
'@ChamiloCore/Exception/error.html.twig',
5959
[
60-
'from_vue' => false,
6160
'exception' => $exception,
6261
]
6362
);

src/CoreBundle/EventListener/TwigListener.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public function __invoke(ControllerEvent $event): void
4545
$languages = $this->languageRepository->getAllAvailable()->getQuery()->getArrayResult();
4646

4747
// $this->twig->addGlobal('text_direction', api_get_text_direction());
48-
$this->twig->addGlobal('from_vue', $request->request->get('from_vue') ? 1 : 0);
4948
$this->twig->addGlobal('is_authenticated', json_encode($isAuth));
5049
$this->twig->addGlobal('user_json', $data ?? json_encode([]));
5150
$this->twig->addGlobal('access_url_id', $request->getSession()->get('access_url_id'));
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
{% extends "@ChamiloCore/Layout/no_layout.html.twig" %}
2-
3-
{%- block content %}
4-
{% include '@ChamiloCore/Layout/vue_setup.html.twig' %}
5-
{# {{ encore_entry_script_tags('vue') }}#}
6-
{% endblock %}

src/CoreBundle/Resources/views/Layout/base-layout.html.twig

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,24 @@
44
{% import "@ChamiloCore/Macros/image.html.twig" as macro_image %}
55
{% import '@ChamiloCore/Macros/headers.html.twig' as macro_headers %}
66
{% import '@ChamiloCore/Macros/modals.html.twig' as macro_modals %}
7-
87
{% set modals_block = macro_modals.global_modal('') %}
9-
{% if not from_vue %}
10-
<!DOCTYPE html>
11-
<html lang="{{ app.request.locale }}" class="no-js h-100">
12-
{% block chamilo_head %}
13-
{%- include "@ChamiloCore/Layout/head.html.twig" %}
8+
<!DOCTYPE html>
9+
<html lang="{{ app.request.locale }}" class="no-js h-100">
10+
{% block chamilo_head %}
11+
{%- include "@ChamiloCore/Layout/head.html.twig" %}
12+
{% endblock %}
13+
<body class="font-sans antialiased {{ section_name }}">
14+
<noscript>{{ "Your browser does not support Javascript"|trans }}</noscript>
15+
{%- block chamilo_wrap -%}
16+
{%- block page_content %}
1417
{% endblock %}
15-
<body class="font-sans antialiased {{ section_name }}">
16-
<noscript>{{ "Your browser does not support Javascript"|trans }}</noscript>
17-
{%- block chamilo_wrap -%}
18-
{%- block page_content %}
19-
{% endblock %}
20-
{% endblock -%}
21-
{%- block chamilo_footer -%}
22-
{% endblock -%}
23-
{{ modals_block }}
18+
{% endblock -%}
19+
20+
{%- block chamilo_footer -%}
21+
{% endblock -%}
22+
23+
{{ modals_block }}
2424

25-
{% include "@ChamiloCore/Layout/foot.html.twig" %}
26-
</body>
27-
</html>
28-
{% else %}
29-
{{ block('page_content') }}
30-
{{ modals_block }}
31-
{% endif %}
25+
{% include "@ChamiloCore/Layout/foot.html.twig" %}
26+
</body>
27+
</html>

src/CoreBundle/Resources/views/Layout/layout_one_col.html.twig

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
{% extends '@ChamiloCore/Layout/base-layout.html.twig' %}
22
{%- block page_content %}
3-
{% if from_vue %}
4-
{# Loading legacy js using the $htmlHeadXtra array #}
5-
{% autoescape false %}
6-
{% for js in legacy_javascript %}
7-
{{~ js }}
8-
{% endfor %}
9-
{% endautoescape %}
10-
{% endif %}
11-
123
{%- autoescape false %}
134
{% if js is defined %}
145
{%- for item in js %}
@@ -36,17 +27,11 @@
3627
{% endautoescape -%}
3728

3829
{%- autoescape %}
39-
{% if not from_vue %}
4030
{%- include '@ChamiloCore/Layout/vue_setup.html.twig' %}
41-
{% endif %}
4231
{% endautoescape -%}
4332

44-
{% set hideContent = 'display: none' %}
45-
{% if from_vue %}
46-
{% set hideContent = '' %}
47-
{% endif %}
4833
{%- autoescape false %}
49-
<section id="sectionMainContent" class="section-content" style="{{ hideContent }}">
34+
<section id="sectionMainContent" class="section-content" style="display: none;">
5035
{% if introduction is defined %}
5136
{{ introduction }}
5237
{% endif %}

src/CoreBundle/Resources/views/Layout/no_layout.html.twig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
{# overrides everything inside body no-footer no-header #}
33
{% block chamilo_wrap %}
44
{%- autoescape %}
5-
{% if not from_vue %}
6-
<div id="app" data-flashes="{{ app.flashes()|json_encode }}"></div>
7-
{% endif %}
5+
{%- include '@ChamiloCore/Layout/vue_setup.html.twig' %}
86
{% endautoescape -%}
97
{% autoescape false %}
108
<section id="sectionMainContent" class="section-content">

0 commit comments

Comments
 (0)