From f661233766dc301c16daa18271c218838e032afe Mon Sep 17 00:00:00 2001 From: David mattei Date: Thu, 4 Jul 2024 18:27:58 +0200 Subject: [PATCH] feat(demo): add dashboards media library browsing (#944) --- configs/admin/dashboard/default-search.json | 2 +- .../dashboard/media-lib-browse-file.json | 22 +++++++++++++++++++ .../dashboard/media-lib-browse-image.json | 22 +++++++++++++++++++ .../dashboard/media-lib-browse-object.json | 22 +++++++++++++++++++ configs/admin/dashboard/media-library.json | 4 ++-- configs/admin/dashboard/sitemap.json | 2 +- configs/admin/dashboard/tasks.json | 2 +- skeleton/template/structure/by_path.html.twig | 1 + 8 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 configs/admin/dashboard/media-lib-browse-file.json create mode 100644 configs/admin/dashboard/media-lib-browse-image.json create mode 100644 configs/admin/dashboard/media-lib-browse-object.json diff --git a/configs/admin/dashboard/default-search.json b/configs/admin/dashboard/default-search.json index e73797a..44a1a69 100644 --- a/configs/admin/dashboard/default-search.json +++ b/configs/admin/dashboard/default-search.json @@ -14,7 +14,7 @@ "options": { "body": "{{ block(\"ems_body\", \"@EMSCH/template_ems/dashboard/default_search.twig\") }}" }, - "orderKey": 2 + "orderKey": 1 }, "replaced": [] } \ No newline at end of file diff --git a/configs/admin/dashboard/media-lib-browse-file.json b/configs/admin/dashboard/media-lib-browse-file.json new file mode 100644 index 0000000..7e21619 --- /dev/null +++ b/configs/admin/dashboard/media-lib-browse-file.json @@ -0,0 +1,22 @@ +{ + "class": "EMS\\CoreBundle\\Entity\\Dashboard", + "arguments": [], + "properties": { + "name": "media-lib-browse-file", + "icon": "fa fa-file-text", + "label": "Browse media library", + "sidebarMenu": false, + "notificationMenu": false, + "definition": "browser_file", + "type": "ems_core.dashboard.template", + "role": "ROLE_AUTHOR", + "color": null, + "options": { + "body": "{{ block(\"body\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "header": "{{ block(\"css\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "footer": "{{ block(\"javascript\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}" + }, + "orderKey": 5 + }, + "replaced": [] +} \ No newline at end of file diff --git a/configs/admin/dashboard/media-lib-browse-image.json b/configs/admin/dashboard/media-lib-browse-image.json new file mode 100644 index 0000000..52db381 --- /dev/null +++ b/configs/admin/dashboard/media-lib-browse-image.json @@ -0,0 +1,22 @@ +{ + "class": "EMS\\CoreBundle\\Entity\\Dashboard", + "arguments": [], + "properties": { + "name": "media-lib-browse-image", + "icon": "fa fa-image", + "label": "Browse media library", + "sidebarMenu": false, + "notificationMenu": false, + "definition": "browser_image", + "type": "ems_core.dashboard.template", + "role": "ROLE_AUTHOR", + "color": null, + "options": { + "body": "{{ block(\"body\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "header": "{{ block(\"css\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "footer": "{{ block(\"javascript\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}" + }, + "orderKey": 7 + }, + "replaced": [] +} \ No newline at end of file diff --git a/configs/admin/dashboard/media-lib-browse-object.json b/configs/admin/dashboard/media-lib-browse-object.json new file mode 100644 index 0000000..e1024db --- /dev/null +++ b/configs/admin/dashboard/media-lib-browse-object.json @@ -0,0 +1,22 @@ +{ + "class": "EMS\\CoreBundle\\Entity\\Dashboard", + "arguments": [], + "properties": { + "name": "media-lib-browse-object", + "icon": "glyphicon glyphicon-pushpin", + "label": "Browse media library", + "sidebarMenu": false, + "notificationMenu": false, + "definition": "browser_object", + "type": "ems_core.dashboard.template", + "role": "ROLE_AUTHOR", + "color": null, + "options": { + "body": "{{ block(\"body\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "header": "{{ block(\"css\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", + "footer": "{{ block(\"javascript\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}" + }, + "orderKey": 6 + }, + "replaced": [] +} \ No newline at end of file diff --git a/configs/admin/dashboard/media-library.json b/configs/admin/dashboard/media-library.json index 2eebe58..d0fd628 100644 --- a/configs/admin/dashboard/media-library.json +++ b/configs/admin/dashboard/media-library.json @@ -7,7 +7,7 @@ "label": "Media library", "sidebarMenu": true, "notificationMenu": false, - "definition": "browser_file", + "definition": null, "type": "ems_core.dashboard.template", "role": "ROLE_AUTHOR", "color": null, @@ -16,7 +16,7 @@ "header": "{{ block(\"css\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}", "footer": "{{ block(\"javascript\", \"@EMSCH/template_ems/dashboard/media_library.twig\") }}" }, - "orderKey": 3 + "orderKey": 4 }, "replaced": [] } \ No newline at end of file diff --git a/configs/admin/dashboard/sitemap.json b/configs/admin/dashboard/sitemap.json index 5186bc0..4eaac23 100644 --- a/configs/admin/dashboard/sitemap.json +++ b/configs/admin/dashboard/sitemap.json @@ -16,7 +16,7 @@ "footer": "{{ block(\"ems_footer\", \"@EMSCH/template_ems/dashboard/sitemap.twig\") }}", "header": "{{ block(\"ems_header\", \"@EMSCH/template_ems/dashboard/sitemap.twig\") }}" }, - "orderKey": 1 + "orderKey": 2 }, "replaced": [] } \ No newline at end of file diff --git a/configs/admin/dashboard/tasks.json b/configs/admin/dashboard/tasks.json index c7a9276..4f17aab 100644 --- a/configs/admin/dashboard/tasks.json +++ b/configs/admin/dashboard/tasks.json @@ -12,7 +12,7 @@ "role": "ROLE_USER", "color": null, "options": [], - "orderKey": 4 + "orderKey": 3 }, "replaced": [] } \ No newline at end of file diff --git a/skeleton/template/structure/by_path.html.twig b/skeleton/template/structure/by_path.html.twig index d228a80..022e929 100644 --- a/skeleton/template/structure/by_path.html.twig +++ b/skeleton/template/structure/by_path.html.twig @@ -2,6 +2,7 @@ {% set path = app.request.get('path') %} {% set locale = app.request.get('_locale') %} +{% set locales = app.request.server.all['EMSCH_LOCALES']|default('[]')|ems_json_decode %} {% set searchSection = emsch_search('section', { "size": 1,