?? GreyFile — Mystic File Browser

Current path: home/webdevt/prestashop17/src/PrestaShopBundle/Resources/views/Admin/Configure/AdvancedParameters/



?? Go up: /home/webdevt/prestashop17/src/PrestaShopBundle/Resources/views/Admin/Configure

?? Viewing: performance.html.twig

{#**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 *#}
{% extends '@PrestaShop/Admin/layout.html.twig' %}
{% trans_default_domain "Admin.Advparameters.Feature" %}
{% import '@PrestaShop/Admin/macros.html.twig' as ps %}
{% form_theme smartyForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}
{% form_theme debugModeForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}
{% form_theme optionalFeaturesForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}
{% form_theme combineCompressCacheForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}
{% form_theme mediaServersForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}
{% form_theme cachingForm 'PrestaShopBundle:Admin/TwigTemplateForm:prestashop_ui_kit.html.twig' %}

{% block content %}
  {{ form_start(smartyForm, {attr : {class: 'form'}, action: path('admin_performance_smarty_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_smarty_cache %}
        <div class="col">
          <div class="card">
            <h3 class="card-header">
              <i class="material-icons">business_center</i> {{ 'Smarty'|trans }}
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_smarty_cache_form %}
                  {{ form_widget(smartyForm) }}
                {% endblock %}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(smartyForm) }}

  {{ form_start(debugModeForm, {attr : {class: 'form'}, action: path('admin_performance_debug_mode_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_debug_mode %}
        <div class="col">
          <div class="card">
            <h3 class="card-header">
              <i class="material-icons">bug_report</i> {{ 'Debug mode'|trans }}
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_debug_mode_form %}
                  {{ form_widget(debugModeForm) }}
                {% endblock %}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(debugModeForm) }}

  {{ form_start(optionalFeaturesForm, {attr : {class: 'form'}, action: path('admin_performance_optional_features_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_optional_features %}
        <div class="col">
          <div class="card" id="optional_features">
            <h3 class="card-header">
              <i class="material-icons">extension</i> {{ 'Optional features'|trans }}

              <span
                class="help-box"
                data-container="body"
                data-toggle="popover"
                data-trigger="hover"
                data-placement="right"
                data-content="{{ 'Some features can be disabled in order to improve performance.'|trans({}, 'Admin.Advparameters.Help') }}"
                title=""
              >
              </span>
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_optional_features_form %}
                  {{ form_widget(optionalFeaturesForm) }}
                {% endblock %}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(optionalFeaturesForm) }}

  {{ form_start(combineCompressCacheForm, {attr : {class: 'form'}, action: path('admin_performance_combine_compress_cache_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_ccc %}
        <div class="col">
          <div class="card">
            <h3 class="card-header">
              <i class="material-icons">zoom_out_map</i> {{ 'CCC (Combine, Compress and Cache)'|trans }}


            <span
              class="help-box"
              data-container="body"
              data-toggle="popover"
              data-trigger="hover"
              data-placement="right"
              data-content="{{ 'CCC allows you to reduce the loading time of your page. With these settings you will gain performance without even touching the code of your theme. Make sure, however, that your theme is compatible with PrestaShop 1.7+. Otherwise, CCC will cause problems.'|trans({}, 'Admin.Advparameters.Help') }}"
              title=""
            >
            </span>
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_ccc_form %}
                  {{ form_widget(combineCompressCacheForm) }}
                {% endblock %}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(combineCompressCacheForm) }}

  {{ form_start(mediaServersForm, {attr : {class: 'form'}, action: path('admin_performance_media_servers_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_media_servers %}
        <div class="col">
          <div class="card">
            <h3 class="card-header">
              <i class="material-icons">link</i> {{ 'Media servers (use only with CCC)'|trans }}

              <span
                class="help-box"
                data-container="body"
                data-toggle="popover"
                data-trigger="hover"
                data-placement="right"
                data-content="{{ 'You must enter another domain, or subdomain, in order to use cookieless static content.'|trans({}, 'Admin.Advparameters.Feature') }}"
                title=""
              >
              </span>
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_media_servers_form %}
                  {{ form_widget(mediaServersForm) }}
                {% endblock %}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(mediaServersForm) }}

  {{ form_start(cachingForm, {attr : {class: 'form'}, action: path('admin_performance_caching_save') }) }}
    <div class="row justify-content-center">
      {% block perfs_form_caching %}
        <div class="col">
          <div class="card">
            <h3 class="card-header">
              <i class="material-icons">link</i> {{ 'Caching'|trans }}
            </h3>
            <div class="card-block row">
              <div class="card-text">
                {% block perfs_form_caching_form %}
                  {{ form_widget(cachingForm) }}
                {% endblock %}

                {{ include('@AdvancedParameters/memcache_servers.html.twig', {'form': memcacheForm}) }}
              </div>
            </div>
            <div class="card-footer">
              <div class="d-flex justify-content-end">
                <button class="btn btn-primary">{{ 'Save'|trans({}, 'Admin.Actions') }}</button>
              </div>
            </div>
          </div>
        </div>
      {% endblock %}
    </div>
  {{ form_end(cachingForm) }}
{% endblock %}

{% block javascripts %}
  {{ parent() }}
  <script src="{{ asset('themes/default/js/bundle/admin_parameters/performancePage.js') }}"></script>
  <script>
    var configuration = {
      'addServerUrl': '{{ url('admin_servers_add')|e('js') }}',
      'removeServerUrl': '{{ url('admin_servers_delete')|e('js') }}',
      'testServerUrl': '{{ url('admin_servers_test')|e('js') }}'
    };
    var app = new PerformancePage(
      configuration.addServerUrl,
      configuration.removeServerUrl,
      configuration.testServerUrl
    );

    window.addEventListener('load', function() {
      var addServerBtn = document.getElementById('add-server-btn');
      var testServerBtn = document.getElementById('test-server-btn');

      addServerBtn.addEventListener('click', function(event) {
        event.preventDefault();
        app.addServer();
      });

      testServerBtn.addEventListener('click', function(event) {
        event.preventDefault();
        app.testServer();
      });
    });
  </script>

  <script src="{{ asset('themes/default/js/bundle/admin_parameters/performancePageUI.js') }}"></script>
{% endblock %}


??

??