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