Add file to load free-jqgrid #2803

Rename session_list.js to free-jqgrid.js
pull/2819/head
Angel Fernando Quiroz Campos 6 years ago
parent 95449ebfa0
commit bdebd0e4aa
  1. 3
      assets/js/app.js
  2. 17
      assets/js/free-jqgrid.js
  3. 7
      assets/js/session_list.js
  4. 4
      main/session/session_list.php
  5. 6
      webpack.config.js

@ -4,6 +4,8 @@ import Routing from '../../vendor/friendsofsymfony/jsrouting-bundle/Resources/pu
Routing.setRoutingData(routes);
const locale = document.querySelector('html').lang;
require('./vendor');
require('./main');
@ -213,7 +215,6 @@ $(function() {
$('.scrollbar-inner').scrollbar();
var locale = $('html').attr('lang');
// Date time settings.
moment.locale(locale);
$.datepicker.setDefaults($.datepicker.regional[locale]);

@ -0,0 +1,17 @@
import 'free-jqgrid';
import 'free-jqgrid/css/ui.jqgrid.bootstrap4.css';
let locale = document.querySelector('html').lang;
const langs = [
'ar', 'bg', 'bs', 'ca', 'cn', 'cs', 'da', 'de', 'el', 'en', 'es', 'fa', 'fi', 'fr', 'gl', 'he', 'hr', 'hu', 'id',
'is', 'it', 'ja', 'kr', 'lt', 'me', 'nl', 'no', 'pl', 'pt-br', 'pt', 'ro', 'ru', 'sk', 'sl', 'sr', 'sv', 'th', 'tr',
'tw', 'ua', 'vi',
];
locale = langs.indexOf(locale) !== -1 ? locale : 'en';
import(
/* webpackChunkName: "free-jqgrid/i18n/" */
'free-jqgrid/js/i18n/grid.locale-' + locale
);

@ -1,7 +0,0 @@
import 'free-jqgrid';
import 'free-jqgrid/css/ui.jqgrid.bootstrap4.css';
import(
/* webpackChunkName: "free-jqgrid/i18n/" */
'free-jqgrid/js/i18n/grid.locale-' + window.lang
);

@ -16,8 +16,8 @@ $this_section = SECTION_PLATFORM_ADMIN;
$routePublic = Container::getRouter()->generate('legacy_public');
$htmlHeadXtra[] = "<script>window.lang = '".api_get_language_isocode()."';</script>";
$htmlHeadXtra[] = api_get_css($routePublic.'build/session_list.css');
$htmlHeadXtra[] = api_get_js_simple($routePublic.'build/session_list.js');
$htmlHeadXtra[] = api_get_css($routePublic.'build/free-jqgrid.css');
$htmlHeadXtra[] = api_get_js_simple($routePublic.'build/free-jqgrid.js');
SessionManager::protectSession(null, false);

@ -5,15 +5,15 @@ Encore
.setOutputPath('public/build/')
.setManifestKeyPrefix('public/build/')
// If chamilo is installed in localhost/chamilo2
.setPublicPath('../')
// .setPublicPath('../')
// If chamilo is installed in a domain my.chamilo.net
//.setPublicPath('/build')
.setPublicPath('/public/build')
.cleanupOutputBeforeBuild()
.addEntry('app', './assets/js/app.js')
.addEntry('bootstrap', './assets/js/bootstrap.js')
.addEntry('session_list', './assets/js/session_list.js')
.addEntry('free-jqgrid', './assets/js/free-jqgrid.js')
.addStyleEntry('css/app', './assets/css/app.scss')
.addStyleEntry('css/bootstrap', './assets/css/bootstrap.scss')

Loading…
Cancel
Save