complément de doc : les crayons et les filtrages par URL d'appel
This commit is contained in:
parent
686acc8452
commit
d924e4ad9a
2 changed files with 53 additions and 22 deletions
73
README.md
73
README.md
|
@ -68,7 +68,6 @@ Choisir entre la version minifiée de vuejs (sans le debug) ou la version de dev
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Utiliser les actions :
|
## Utiliser les actions :
|
||||||
```html
|
```html
|
||||||
[(#SET{statut,
|
[(#SET{statut,
|
||||||
|
@ -90,6 +89,25 @@ Choisir entre la version minifiée de vuejs (sans le debug) ou la version de dev
|
||||||
|
|
||||||
|
|
||||||
## Utiliser les crayons :
|
## Utiliser les crayons :
|
||||||
|
```json
|
||||||
|
[{
|
||||||
|
"header":{
|
||||||
|
"id": "ID",
|
||||||
|
"activite": "Activité",
|
||||||
|
"massif": "Massif",
|
||||||
|
"sommet": "Sommet",
|
||||||
|
"voie": "Voie",
|
||||||
|
"participants_max": "Participants max",
|
||||||
|
"tarif_prive": "Prix"
|
||||||
|
},
|
||||||
|
"crayons":{
|
||||||
|
"tarif_prive" : "activite"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Dans cet exemple :
|
||||||
|
- `activite` est le raccourci du nom de la table (spip_activites)
|
||||||
|
- `tarif_prive` est **obligatoirement** l'intitulé du champs dans cette table (si besoin il faut modifier la clé du champ...)
|
||||||
|
|
||||||
|
|
||||||
### Caches
|
### Caches
|
||||||
l'invalidation du cache ne se fait que pour les objets publiés
|
l'invalidation du cache ne se fait que pour les objets publiés
|
||||||
|
@ -113,24 +131,24 @@ Il faut surcharger cette autorisation : autoriser_crayonner_dist() `inc/crayons`
|
||||||
|
|
||||||
### @Deprecated
|
### @Deprecated
|
||||||
=> integre par default dans la 3.4.2 pour tous les objets
|
=> integre par default dans la 3.4.2 pour tous les objets
|
||||||
>- il faut utiliser le pipeline `crayons_vue_affichage_final`
|
- il faut utiliser le pipeline `crayons_vue_affichage_final`
|
||||||
>```php
|
```php
|
||||||
>/**
|
/**
|
||||||
> * injection du reload de vuejs pour les crayons de l'objet souscription
|
* injection du reload de vuejs pour les crayons de l'objet souscription
|
||||||
> *
|
*
|
||||||
> */
|
*/
|
||||||
>function prefixPlugin_crayons_vue_affichage_final($flux){
|
function prefixPlugin_crayons_vue_affichage_final($flux){
|
||||||
> if ($flux['args']['type'] === 'souscription') {
|
if ($flux['args']['type'] === 'souscription') {
|
||||||
> $id = $flux['args']['id'];
|
$id = $flux['args']['id'];
|
||||||
> if ($id = intval($id)) {
|
if ($id = intval($id)) {
|
||||||
> $flux['data'] .= ' <script type="text/javascript"> app.rechargerJson('.$id.'); </script>';
|
$flux['data'] .= ' <script type="text/javascript"> app.rechargerJson('.$id.'); </script>';
|
||||||
> } else {
|
} else {
|
||||||
> $flux['data'] .= ' <script type="text/javascript"> app.rechargerJson(); </script>';
|
$flux['data'] .= ' <script type="text/javascript"> app.rechargerJson(); </script>';
|
||||||
> }
|
}
|
||||||
> }
|
}
|
||||||
> return $flux;
|
return $flux;
|
||||||
>}
|
}
|
||||||
>```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Utiliser une mediabox ou modalbox :
|
## Utiliser une mediabox ou modalbox :
|
||||||
|
@ -185,5 +203,18 @@ Il faut surcharger cette autorisation : autoriser_crayonner_dist() `inc/crayons`
|
||||||
}>
|
}>
|
||||||
</div>
|
</div>
|
||||||
```
|
```
|
||||||
## Liens
|
|
||||||
>https://unpkg.com/browse/vue-next-select@2.10.4/
|
|
||||||
|
## URLs avec filtrage :
|
||||||
|
Concatener le filtrage dans l'url d'appel du json :
|
||||||
|
```html
|
||||||
|
http://guides.spip/?page=grille_tarifs&activite=Alpinisme
|
||||||
|
```
|
||||||
|
ou
|
||||||
|
```html
|
||||||
|
<a class="btn" href="[(#URL_PAGE{commandes}|parametre_url{annee,2021})]">2021</a>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Refs
|
||||||
|
https://unpkg.com/browse/vue-next-select@2.10.4/
|
||||||
|
|
|
@ -20,7 +20,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
||||||
|
|
||||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||||
|
|
||||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
||||||
|
|
||||||
jQuery(function () {
|
jQuery(function () {
|
||||||
$('#app').on('click', '.url_action', function (e) {
|
$('#app').on('click', '.url_action', function (e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue