Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Template
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Modulus
Services
Template
Commits
3f13fbf2
Commit
3f13fbf2
authored
Apr 17, 2020
by
Sylvain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Création de Template 4
parent
09afd864
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
632 additions
and
65 deletions
+632
-65
README.md
README.md
+22
-8
example.md
example.md
+88
-56
src/Compose/Template4Bt4.php
src/Compose/Template4Bt4.php
+513
-0
src/Template.php
src/Template.php
+9
-1
No files found.
README.md
View file @
3f13fbf2
...
...
@@ -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
::
list
3
([
{
!!
Template
::
list
4
([
'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'
]
)
...
...
example.md
View file @
3f13fbf2
...
...
@@ -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'
]
)
])
!!
}
```
src/Compose/Template4Bt4.php
0 → 100644
View file @
3f13fbf2
This diff is collapsed.
Click to expand it.
src/Template.php
View file @
3f13fbf2
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment