Commit 3f13fbf2 authored by Sylvain's avatar Sylvain

Création de Template 4

parent 09afd864
...@@ -21,7 +21,7 @@ Laravel 5.8 uses Package Auto-Discovery, so doesn't require you to manually add ...@@ -21,7 +21,7 @@ Laravel 5.8 uses Package Auto-Discovery, so doesn't require you to manually add
```php ```php
// Exemple sur une liste d'utilisateurs // Exemple sur une liste d'utilisateurs
{!! Template::list3([ {!! Template::list4([
'table_id' => null, 'table_id' => null,
'table_class' => 'table-sortable', 'table_class' => 'table-sortable',
'route_prefix' => $route_prefix, 'route_prefix' => $route_prefix,
...@@ -36,33 +36,47 @@ Laravel 5.8 uses Package Auto-Discovery, so doesn't require you to manually add ...@@ -36,33 +36,47 @@ Laravel 5.8 uses Package Auto-Discovery, so doesn't require you to manually add
'source' => $items, 'source' => $items,
'columns' => array([ 'columns' => array([
'label' => '#', 'label' => '#',
'value' => ['id'], 'value' => ':id',
'sortable' => 'id' 'sortable' => 'id'
],[ ],[
'label' => 'Dossier', 'label' => 'Dossier',
'value' => ['folder_html'], 'value' => ':folder_html',
'sortable' => 'ged_folders.title' 'sortable' => 'ged_folders.title'
],[ ],[
'label' => 'Nom', 'label' => 'Nom',
'value' => ['name'], 'value' => ':name',
'sortable' => 'name', 'sortable' => 'name',
],[ ],[
'label' => 'Version', 'label' => 'Version',
'value' => ['template' => 'v%s', 'key' => 'version'], 'value' => ['template' => [
'format' => 'v%s',
'args' => ':version'
]],
'sortable' => 'version', 'sortable' => 'version',
'class' => 'text-center' 'class' => 'text-center'
],[ ],[
'label' => 'Position',
'class' => 'text-center',
'value' => ['callback' => [
'function' => 'pos_sort',
'args' => [':id', ':position']
]],
'sortable' => 'position'
],[
'label' => 'Statut', 'label' => 'Statut',
'value' => ['validation_html'], 'value' => ':validation_html',
'class' => 'text-center' 'class' => 'text-center'
],[ ],[
'label' => 'Visibilité', 'label' => 'Visibilité',
'class' => 'text-center', 'class' => 'text-center',
'value' => ['key' => 'status', 'callback' => 'published_html'], 'value' => ['callback' => [
'function' => 'published_html',
'args' => ':status'
]],
'sortable' => 'status', 'sortable' => 'status',
],[ ],[
'label' => 'Date', 'label' => 'Date',
'value' => ['updated_at->diffForHumans()'], 'value' => ':updated_at->diffForHumans()',
'sortable' => 'updated_at' 'sortable' => 'updated_at'
] ]
) )
......
...@@ -20,33 +20,39 @@ ...@@ -20,33 +20,39 @@
'source' => $items, 'source' => $items,
'columns' => array([ 'columns' => array([
'label' => '#', 'label' => '#',
'value' => ['id'], 'value' => ':id',
'sortable' => 'id' 'sortable' => 'id'
],[ ],[
'label' => 'Dossier', 'label' => 'Dossier',
'value' => ['folder_html'], 'value' => ':folder_html',
'sortable' => 'ged_folders.title' 'sortable' => 'ged_folders.title'
],[ ],[
'label' => 'Nom', 'label' => 'Nom',
'value' => ['name'], 'value' => ':name',
'sortable' => 'name', 'sortable' => 'name',
],[ ],[
'label' => 'Version', 'label' => 'Version',
'value' => ['template' => 'v%s', 'key' => 'version'], 'value' => ['template' => [
'format' => 'v%s',
'args' => ':version'
]],
'sortable' => 'version', 'sortable' => 'version',
'class' => 'text-center' 'class' => 'text-center'
],[ ],[
'label' => 'Statut', 'label' => 'Statut',
'value' => ['validation_html'], 'value' => ':validation_html',
'class' => 'text-center' 'class' => 'text-center'
],[ ],[
'label' => 'Visibilité', 'label' => 'Visibilité',
'class' => 'text-center', 'class' => 'text-center',
'value' => ['key' => 'status', 'callback' => 'published_html'], 'value' => ['callback' => [
'function' => 'published_html',
'args' => ':status'
]],
'sortable' => 'status', 'sortable' => 'status',
],[ ],[
'label' => 'Date', 'label' => 'Date',
'value' => ['updated_at->diffForHumans()'], 'value' => ':updated_at->diffForHumans()',
'sortable' => 'updated_at' 'sortable' => 'updated_at'
] ]
) )
...@@ -67,14 +73,19 @@ ...@@ -67,14 +73,19 @@
'is_editable' => true, 'is_editable' => true,
'is_deletable' => true, 'is_deletable' => true,
'is_duplicable' => false, 'is_duplicable' => false,
'tags' => array( 'tags' => [
['template' => '[ module|ged|document|%s ]', 'key' => 'id'] ['template' => ['format' => '[ module|ged|document|%s ]', 'args' => ':id']],
), ['template' => ['format' => '[ module|ged|document|%s ]', 'args' => ['callback' => [
'function' => 'Str::slug', 'args' => ':name']]
]],
]
'more' => array([ 'more' => array([
'label' => '<i class="fa fa-unlock mr-1"></i> RAZ validation', 'label' => '<i class="fa fa-unlock mr-1"></i> RAZ validation',
'href' => [ 'href' => [
'template' => url('backend/module/ged/file/status/%s/0?' . current_query_to_string()), 'template' => [
'key' => 'files->sortBy()->last()->id' 'format' => url('backend/module/ged/file/status/%s/0?' . current_query_to_string()),
'args' => ':files->sortBy()->last()->id'
],
], ],
] ]
) )
...@@ -82,54 +93,75 @@ ...@@ -82,54 +93,75 @@
'source' => $items, 'source' => $items,
'rows' => array( 'rows' => array(
'class' => [ 'class' => [
'value' => 'text-bold',
'condition' => [ 'condition' => [
'key' => 'file_current_version.status', 'value' => ':id',
'operator' => '==', 'operator' => '==',
'value' => -1 'comparator' => 1,
'true' => ':name',
'false' => 'text-danger'
] ]
], ],
), ),
'columns' => array([ 'columns' => array(
'label' => '', [
'id' => 'mon-id', 'label' => '#',
'class' => 'ma-class', 'value' => ':id',
'value' => [ 'sortable' => 'id'
'template' => '<img class="thumb-list" src="%s" alt="image" width=50 />', ],[
'key' => 'image_type_url'] 'label' => 'Poster',
],[ 'value' => ['template' => [
'label' => '#', 'format' => '<img class="thumb-list" src="%s" alt="%s"',
'value' => ['id'], 'args' => [':poster', ':name']
'sortable' => 'id' ]],
],[ 'sortable' => 'poster'
'label' => 'Dossier', ],[
'value' => ['key' => 'folder_html'], 'label' => 'Nom',
'sortable' => 'ged_folders.title' 'value' => ':name',
],[ 'sortable' => 'name'
'label' => 'Nom', ],[
'value' => ['name'], 'label' => 'Description',
'sortable' => 'name', 'sortable' => 'description',
],[ 'value' => [
'label' => 'Version', 'callback' => [
'value' => ['template' => 'v%s', 'key' => 'version'], 'function' => 'str_limit',
'sortable' => 'version', 'args' => [
'class' => 'text-center' 'callback' => [
],[ 'function' => 'strip_tags',
'label' => 'Statut', 'args' => [
'value' => ['validation_html'], 'callback' => [
'class' => 'text-center' 'function' => 'html_entity_decode',
],[ 'args' => ':description'
'label' => 'Visibilité', ]
'class' => 'text-center', ]
'value' => ['key' => 'status', 'callback' => 'published_html'], ],
'sortable' => 'status', 20
],[ ]
'label' => 'Date', ]
'value' => ['updated_at->diffForHumans()'], ],
'sortable' => 'updated_at' ],[
],[ 'label' => 'Position',
'value' => ['download_file_html'], 'class' => 'text-center',
] 'value' => ['callback' => [
'function' => 'pos_sort',
'args' => [':id', ':position']
]],
'sortable' => 'position'
], [
'label' => 'Categories',
'value' => ':categories_html',
],[
'label' => 'Visibilité',
'class' => 'text-center',
'value' => ['callback' => [
'function' => 'published_html',
'args' => ':status'
]],
'sortable' => 'status',
],[
'label' => 'Date',
'value' => ':updated_at->diffForHumans()',
'sortable' => 'updated_at'
]
) )
]) !!} ]) !!}
``` ```
This diff is collapsed.
...@@ -5,7 +5,7 @@ namespace Goldenscarab\Modulus\Service\Template; ...@@ -5,7 +5,7 @@ namespace Goldenscarab\Modulus\Service\Template;
use Goldenscarab\Modulus\Service\Template\Compose\Template1Bt4; use Goldenscarab\Modulus\Service\Template\Compose\Template1Bt4;
use Goldenscarab\Modulus\Service\Template\Compose\Template2Bt4; use Goldenscarab\Modulus\Service\Template\Compose\Template2Bt4;
use Goldenscarab\Modulus\Service\Template\Compose\Template3Bt4; use Goldenscarab\Modulus\Service\Template\Compose\Template3Bt4;
use Goldenscarab\Modulus\Service\Template\Compose\Template4Bt4;
class Template class Template
...@@ -37,6 +37,14 @@ class Template ...@@ -37,6 +37,14 @@ class Template
$template = new Template3Bt4($attrs); $template = new Template3Bt4($attrs);
$render = $template->renderList(); $render = $template->renderList();
return $template->renderHTML($render);
}
public function list4($attrs = []): string
{
$template = new Template4Bt4($attrs);
$render = $template->renderList();
return $template->renderHTML($render); return $template->renderHTML($render);
} }
} }
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