Commit 813ccd8f authored by tguillon's avatar tguillon
Browse files

Modification : factorisation des appels JS et CSS

parent 2979b9c6
......@@ -610,7 +610,7 @@ $(document).ready(function () {
}
$('.multiSelect').select2({
placeholder: 'Sélectionnez une option',
placeholder: 'Sélectionnez une ou plusieurs options',
allowClear: true
});
......
<?php
use Libriciel\Utility\Password\PasswordStrengthMeterAnssi;
echo $this->Html->css('password-force.css');
$thresholds = array_flip(PasswordStrengthMeterAnssi::thresholds());
$title = 'add' === $this->request->params['action']
......
<?php
echo $this->Html->script('filtre.js');
echo $this->Html->css('filtre.css');
if (!empty($articles)) {
// Bouton du filtre de la liste
echo $this->Form->button('<span class="fa fa-filter fa-lg"><!----></span>' . __d('article', 'article.btnFiltrerArticle'), [
'type' => 'button',
'class' => 'btn btn btn-default-primary pull-right',
'class' => 'btn btn-default-default pull-right',
'id' => 'filtrage'
]);
......@@ -330,12 +333,6 @@ if (!empty($articles)) {
// <![CDATA[
$(document).ready(function () {
$("#divFiltrage").hide();
$("#filtrage").click(function () {
$("#divFiltrage").slideToggle(400);
});
$('.articleEntiteCheckbox')
.attr('checked', false);
......
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
?>
<!-- Onglet Information sur l'entité -->
<div id="infos" class="tab-pane">
<br/>
......
<?php
echo $this->Html->script([
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
]);
echo $this->Html->css('/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min');
$col = 1;
$line = 1;
?>
......@@ -209,10 +215,10 @@ $line = 1;
<!-- Fin onglet Formulaire -->
<script type="text/javascript">
$(document).ready(function () {
$('.multiSelect').select2({
// placeholder: "Sélectionnez une ou plusieurs options",
placeholder: 'Sélectionnez une ou plusieurs options',
allowClear: true
});
......@@ -228,5 +234,4 @@ $line = 1;
}
});
</script>
\ No newline at end of file
......@@ -173,10 +173,14 @@ foreach ($champs as $key => $value) {
?>
<script type="text/javascript">
$(document).ready(function () {
var champsDate = <?php echo json_encode($calendrier)?>;
$('.multiSelect').select2({
placeholder: 'Sélectionnez une ou plusieurs options',
allowClear: true
});
var champsDate = <?php echo json_encode($calendrier)?>;
jQuery.each(champsDate, function(key, val){
$('#' + val).datetimepicker({
viewMode: 'year',
......@@ -188,10 +192,5 @@ foreach ($champs as $key => $value) {
});
});
$('.multiSelect').select2({
placeholder: "Sélectionnez une option",
allowClear: true
});
});
</script>
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
if (isset($this->validationErrors['Fiche']) && !empty($this->validationErrors['Fiche'])) {
?>
<div class="alert alert-danger" role="alert">
......
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
if (isset($this->validationErrors['Fiche']) && !empty($this->validationErrors['Fiche'])) {
?>
<div class="alert alert-danger" role="alert">
......
......@@ -446,10 +446,5 @@ echo $this->WebcilForm->end();
$('#aOngletCoresponsable').attr('role', '');
$('#aOngletCoresponsable').attr('data-toggle', '');
}
$('.multiSelect').select2({
placeholder: "Sélectionnez une ou plusieurs options",
allowClear: true
});
});
</script>
......@@ -2,12 +2,15 @@
echo $this->Html->script([
'FormGenerator.jquery-ui.min',
'FormGenerator.createForm',
'scroll'
'scroll',
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
]);
echo $this->Html->css([
'FormGenerator.jquery-ui.min',
'jquery-ui.structure.min'
'jquery-ui.structure.min',
'/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min'
]);
?>
......
......@@ -2,12 +2,15 @@
echo $this->Html->script([
'FormGenerator.jquery-ui.min',
'FormGenerator.createForm',
'scroll'
'scroll',
'smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min',
'smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js'
]);
echo $this->Html->css([
'FormGenerator.jquery-ui.min',
'jquery-ui.structure.min'
'jquery-ui.structure.min',
'/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min'
]);
?>
......
......@@ -128,21 +128,4 @@ echo $this->WebcilForm->create('Formulaire', [
</div>
<?php
echo $this->WebcilForm->end();
?>
<!-- Affichage d'un calendrier en JS sur le champ date -->
<script type="text/javascript">
$(document).ready(function () {
$(":input").prop("disabled", true);
$(".boutonDl").prop("disabled", false);
$('.multiSelect').select2({
placeholder: "Sélectionnez une option",
allowClear: true
});
});
</script>
\ No newline at end of file
echo $this->WebcilForm->end();
\ No newline at end of file
......@@ -31,25 +31,19 @@
//JS
echo $this->Html->script('jquery/dist/jquery.min.js');
echo $this->Html->script('bootstrap/dist/js/bootstrap.min.js');
echo $this->Html->script('formulaire.js');
echo $this->Html->script('fadeflash.js', ['inline' => false]);
echo $this->Html->script('bootstrap-filestyle/src/bootstrap-filestyle.min.js', ['inline' => false]);
echo $this->Html->script('chosen/chosen.jquery.min.js');
echo $this->Html->script('jquery-ui/jquery-ui.js');
echo $this->Html->script('main.js');
echo $this->Html->script('smalot-bootstrap-datetimepicker/js/bootstrap-datetimepicker.min');
echo $this->Html->script('smalot-bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.fr.js');
echo $this->Html->script('select2/dist/js/select2.full.min.js');
echo $this->Html->script('select2/dist/js/select2.min.js');
echo $this->Html->script('seiyria-bootstrap-slider/dist/bootstrap-slider.js');
echo $this->Html->script('seiyria-bootstrap-slider/dist/bootstrap-slider.min.js');
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
echo $this->Html->script('tinymce/tinymce.js');
echo $this->Html->script('tinymce/jquery.tinymce.js');
echo $this->Html->script('formulaire.js');
echo $this->Html->script('main.js');
echo $this->Html->script('fadeflash.js', ['inline' => false]);
echo $this->Html->meta('icon');
......@@ -58,15 +52,14 @@
echo $this->Html->css('/js/bootstrap/dist/css/bootstrap-theme.min.css');
echo $this->Html->css('/js/bootstrap/dist/css/bootstrap.min.css');
echo $this->Html->css('/js/chosen/chosen.min.css');
echo $this->Html->css('main.css');
echo $this->Html->css('/js/jquery-ui/themes/base/jquery-ui.css');
echo $this->Html->css('/js/components-font-awesome/css/font-awesome.min.css');
echo $this->Html->css('style.css');
echo $this->Html->css('/js/smalot-bootstrap-datetimepicker/css/bootstrap-datetimepicker.min');
echo $this->Html->css('/js/select2/dist/css/select2.min.css');
echo $this->Html->css('/js/seiyria-bootstrap-slider/dist/css/bootstrap-slider.min.css');
echo $this->Html->css('/js/seiyria-bootstrap-slider/dist/css/bootstrap-slider.css');
echo $this->Html->css('main.css');
echo $this->Html->css('style.css');
echo $this->fetch('meta');
echo $this->fetch('css');
......
<?php
echo $this->Html->script('users.js');
echo $this->Html->script('filtre.js');
echo $this->Html->css('filtre.css');
$filters = $this->request->data;
unset($filters['sort'], $filters['direction'], $filters['page']);
......@@ -9,12 +10,12 @@
echo $this->Form->button('<span class="fa fa-filter fa-lg"><!----></span>' . __d('norme', 'norme.btnFiltrerNorme'), [
'type' => 'button',
'class' => 'btn btn-default-default pull-right',
'id' => 'filtrageUsers'
'id' => 'filtrage'
]);
?>
<!-- Filtre -->
<div id="filtreUsers" <?php if(true === empty($filters)) {echo 'style="display: none;"';}?>>
<div id="divFiltrage" <?php if(true === empty($filters)) {echo 'style="display: none;"';}?>>
<?php
echo $this->Form->create('normes', ['url' => [
'controller' => $this->request->params['controller'],
......@@ -100,6 +101,21 @@
<?php echo $this->Form->end();?>
</div>
<div class="text-left">
<?php
//Si les droits de l'utilisateur le permet, affichage du bouton "+ Ajouter un profil"
if ($this->Autorisation->isDpo()) {
echo $this->Html->link('<span class="fa fa-plus-circle fa-lg"><!----></span>' . __d('norme', 'norme.btnAjouterNorme'), [
'controller' => 'normes',
'action' => 'add'
], [
'class' => 'btn btn-default-primary sender',
'escapeTitle' => false
]);
}
?>
</div>
<?php
if (!empty($normes)) {
$this->Paginator->options([
......
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
echo $this->Html->script('organisations.js');
if (isset($this->validationErrors['Organisation']) && !empty($this->validationErrors['Organisation'])) {
?>
......
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
echo $this->Html->script('organisations.js');
if (isset($this->validationErrors['Organisation']) && !empty($this->validationErrors['Organisation'])) {
......
<?php
echo $this->Html->script('jquery-mask-plugin/dist/jquery.mask.min.js');
echo $this->Html->script('organisations.js');
if (isset($this->validationErrors['Organisation']) && !empty($this->validationErrors['Organisation'])) {
......
<?php
echo $this->Html->script('organisations.js');
echo $this->Html->script('filtre.js');
echo $this->Html->css('filtre.css');
?>
<?php
// Bouton du filtre de la liste
echo $this->Form->button('<span class="fa fa-filter fa-lg"><!----></span>' . __d('soustraitant', 'soustraitant.btnFiltrerSoustraitant'), [
'type' => 'button',
'class' => 'btn btn btn-default-primary pull-right',
'id' => 'filtrage'
]);
$filters = $this->request->data;
unset($filters['sort'], $filters['direction'], $filters['page'], $filters['Soustraitant']['nbAffichage']);
if(empty($filters['Soustraitant'])) {
unset($filters['Soustraitant']);
}
// Bouton du filtre de la liste
echo $this->Form->button('<span class="fa fa-filter fa-lg"><!----></span>' . __d('soustraitant', 'soustraitant.btnFiltrerSoustraitant'), [
'type' => 'button',
'class' => 'btn btn-default-default pull-right',
'id' => 'filtrage'
]);
$filters = $this->request->data;
unset($filters['sort'], $filters['direction'], $filters['page'], $filters['Soustraitant']['nbAffichage']);
if(empty($filters['Soustraitant'])) {
unset($filters['Soustraitant']);
}
?>
<div id="divFiltrage" <?php if(true === empty($filters)) {echo 'style="display: none;"';}?>>
......@@ -189,18 +190,4 @@ echo $pagination;
]);
}
?>
</div>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$("#divFiltrage").hide();
$("#filtrage").click(function () {
$("#divFiltrage").slideToggle(400);
});
});
// ]]>
</script>
\ No newline at end of file
</div>
\ No newline at end of file
<?php
use Libriciel\Utility\Password\PasswordStrengthMeterAnssi;
echo $this->Html->css('password-force.css');
if (isset($this->validationErrors['Organisation']) && !empty($this->validationErrors['Organisation'])) {
?>
......
......@@ -2,12 +2,12 @@
// JS
echo $this->Html->script('jquery/dist/jquery.min.js');
echo $this->Html->script('chosen/chosen.jquery.min.js');
echo $this->Html->script('login.js');
echo $this->Html->script('select.js');
// CSS
echo $this->Html->css('/js/bootstrap/dist/css/bootstrap.min.css');
echo $this->Html->css('/js/chosen/chosen.min.css');
echo $this->Html->css('login.css');
echo $this->Html->css('select.css');
?>
<ls-lib-login-model
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment