Fix asset url in order to work with legacy and new code

pull/2715/head
Julio Montoya 7 years ago
parent 5bd0ab12f2
commit 14dbb82afb
  1. 17
      main/template/default/layout/welcome_to_course.html.twig
  2. 3
      src/CoreBundle/Resources/config/routing.yml
  3. 2
      src/ThemeBundle/Resources/views/Layout/base-layout.html.twig
  4. 10
      src/ThemeBundle/Resources/views/Layout/head.html.twig
  5. 4
      src/ThemeBundle/Resources/views/Layout/legacy_js.html.twig
  6. 2
      src/ThemeBundle/Resources/views/Layout/no_layout.html.twig
  7. 2
      src/ThemeBundle/Resources/views/Layout/topbar.html.twig
  8. 24
      src/ThemeBundle/Resources/views/Layout/welcome_to_course.html.twig
  9. 26
      src/ThemeBundle/Resources/views/default/layout/welcome_to_course.html.twig

@ -1,17 +0,0 @@
<div class="normal-message">
{{ "HelloXAsYouCanSeeYourCourseListIsEmpty"|get_lang | format(_u.complete_name) }}
{% if count_courses == 0 %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
{% else %}
{% if "allow_students_to_browse_courses"|api_get_setting == 'true' %}
{{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }}
<a class="btn btn-primary btn-large" href="{{ course_catalog_url }}">
{{ "CourseCatalog"|get_lang }}
</a>
{% else %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
{% endif %}
{% endif %}
</div>

@ -1,4 +1,7 @@
# Legacy routes # Legacy routes
legacy_public:
path: ../public/
legacy_index: legacy_index:
path: ../ path: ../

@ -52,7 +52,7 @@
<div class="peers ai-c fxw-nw"> <div class="peers ai-c fxw-nw">
<div class="peer"> <div class="peer">
<div class="logo"> <div class="logo">
<img src="{{ asset('build/css/themes/'~ theme ~'/images/logo_chamilo.svg') }}"/> <img src="{{ url('legacy_public') ~ 'build/css/themes/'~ theme ~'/images/logo_chamilo.svg' }}"/>
</div> </div>
</div> </div>
</div> </div>

@ -4,7 +4,7 @@
<link href="https://chamilo.org/chamilo-lms/" rel="help"/> <link href="https://chamilo.org/chamilo-lms/" rel="help"/>
<link href="https://chamilo.org/the-association/" rel="author"/> <link href="https://chamilo.org/the-association/" rel="author"/>
<link href="https://chamilo.org/the-association/" rel="copyright"/> <link href="https://chamilo.org/the-association/" rel="copyright"/>
<link rel="apple-touch-icon" href="{{ asset('apple-touch-icon.png') }}"/> <link rel="apple-touch-icon" href="{{ url('legacy_public') ~ 'apple-touch-icon.png' }}"/>
{% autoescape false %} {% autoescape false %}
{{ favico }} {{ favico }}
{% endautoescape %} {% endautoescape %}
@ -28,13 +28,13 @@
{% set message_link = '' %} {% set message_link = '' %}
{# Files app.css is generated from "assets/css/app.scss" file using the file webpack.config.js #} {# Files app.css is generated from "assets/css/app.scss" file using the file webpack.config.js #}
<link rel="stylesheet" href="{{ asset('build/css/app.css') }}"/> <link rel="stylesheet" href="{{ url('legacy_public') ~ 'build/css/app.css' }}"/>
<link rel="stylesheet" href="{{ asset('build/css/themes/'~ theme ~'/default.css') }}"/> <link rel="stylesheet" href="{{ url('legacy_public') ~ 'build/css/themes/'~ theme ~'/default.css' }}"/>
<link rel="stylesheet" media="print" href="{{ asset('build/css/print.css') }}"/> <link rel="stylesheet" media="print" href="{{ url('legacy_public') ~ 'build/css/print.css' }}"/>
{# Add third party js libraries that can't be loaded using webpack #} {# Add third party js libraries that can't be loaded using webpack #}
{% include "@ChamiloTheme/Layout/legacy_js.html.twig" %} {% include "@ChamiloTheme/Layout/legacy_js.html.twig" %}
{# app.js is generated using the file webpack.config.js and using yarn read /assets/README.md for more info #} {# app.js is generated using the file webpack.config.js and using yarn read /assets/README.md for more info #}
<script src="{{ asset('build/app.js') }}"></script> <script src="{{ url('legacy_public') ~ 'build/app.js' }}"></script>
{# Check chamilo_js key in assetic.yml #} {# Check chamilo_js key in assetic.yml #}
{% block javascripts %} {% block javascripts %}

@ -1,6 +1,6 @@
{# Files that can't be loaded using webpack #} {# Files that can't be loaded using webpack #}
<script src="{{ asset('libs/ckeditor/ckeditor.js') }}"></script> <script src="{{ url('legacy_public') ~ 'libs/ckeditor/ckeditor.js' }}"></script>
{#<script src="{{ asset('libs/readmore-js/readmore.js') }}"></script>#} {#<script src="{{ asset('libs/readmore-js/readmore.js') }}"></script>#}
<script src="{{ asset('libs/js-cookie/src/js.cookie.js') }}"></script> <script src="{{ url('legacy_public') ~ 'libs/js-cookie/src/js.cookie.js' }}"></script>

@ -2,7 +2,7 @@
{# overrides everything inside body no-footer no-header #} {# overrides everything inside body no-footer no-header #}
{% block chamilo_wrap %} {% block chamilo_wrap %}
{% autoescape false %} {% autoescape false %}
<link rel="stylesheet" href="{{ asset('build/css/scorm.css') }}"/> <link rel="stylesheet" href="{{ url('legacy_public') ~ 'build/css/scorm.css' }}"/>
<section id="content-scorm"> <section id="content-scorm">
{{ content }} {{ content }}
</section> </section>

@ -70,7 +70,7 @@
}); });
/** /**
* Wait untill sidebar fully toggled (animated in/out) * Wait until sidebar fully toggled (animated in/out)
* then trigger window resize event in order to recalculate * then trigger window resize event in order to recalculate
* masonry layout widths and gutters. * masonry layout widths and gutters.
*/ */

@ -0,0 +1,24 @@
{% autoescape false %}
{{ "HelloXAsYouCanSeeYourCourseListIsEmpty" | trans | format(app.user.completeName) }}
{% if count_courses == 0 %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|trans }}
{% else %}
{% if chamilo_settings_get("display.allow_students_to_browse_courses") == 'true' %}
{{
"GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX" | trans |
format(
'<a href="' ~ url('main', {'name': 'auth/courses.php'}) ~ '"/> '~ "here" | trans ~'</a>',
'<a href="' ~ url('userportal') ~ '"/> '~ "here" | trans ~'</a>'
)
}}
<a class="btn btn-primary btn-large" href="{{ url('main', {'name': 'auth/courses.php'}) }}">
{{ "CourseCatalog"|trans }}
</a>
{% else %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|trans }}
{% endif %}
{% endif %}
{% endautoescape %}

@ -1,26 +0,0 @@
{% autoescape false %}
{{ "HelloXAsYouCanSeeYourCourseListIsEmpty" | trans | format(app.user.completeName) }}
{% if count_courses == 0 %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|trans }}
{% else %}
{% if chamilo_settings_get("display.allow_students_to_browse_courses") == 'true' %}
{{
"GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX" | trans |
format(
'<a href="' ~ url('main', {'name': 'auth/courses.php'}) ~ '"/> '~ "here" | trans ~'</a>',
'<a href="' ~ url('userportal') ~ '"/> '~ "here" | trans ~'</a>'
)
}}
<a class="btn btn-primary btn-large" href="{{ url('main', {'name': 'auth/courses.php'}) }}">
{{ "CourseCatalog"|trans }}
</a>
{% else %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|trans }}
{% endif %}
{% endif %}
{% endautoescape %}
Loading…
Cancel
Save