From 08f544f6ea76f05c917ec3049288633d104c4bd0 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 9 Feb 2022 16:27:13 +0100 Subject: [PATCH] add btn-wopilink button ; fix OpenWopiLink when options is null --- .../views/AccompanyingCourseDocument/show.html.twig | 7 ++----- .../Resources/public/chill/scss/buttons.scss | 4 ++++ .../Resources/public/module/wopi-link/index.js | 2 +- .../Resources/public/vuejs/_components/OpenWopiLink.vue | 6 ++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig index 7cf331f2b..28f984e01 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/show.html.twig @@ -20,6 +20,7 @@ {% block content %}

{{ block('title') }}

+ {{ mm.mimeIcon(document.object.type) }}
@@ -54,11 +55,7 @@ {% if chill_document_is_editable(document.object) %}
  • - {{ document.object|chill_document_edit_button({ - 'changeIcon': 'fa-paragraph', - 'changeClass': 'btn-update', - 'noText': false - }) }} + {{ document.object|chill_document_edit_button }}
  • {% endif %} {% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %} diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss index 2c3459d39..3a9b6df80 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/buttons.scss @@ -15,6 +15,7 @@ $chill-theme-buttons: ( "action": $chill-orange, "edit": $chill-orange, "update": $chill-orange, + "wopilink": $chill-orange, "show": $chill-blue, "view": $chill-blue, "misc": $gray-300, @@ -54,6 +55,7 @@ $chill-theme-buttons: ( &.btn-action, &.btn-edit, &.btn-tpchild, + &.btn-wopilink, &.btn-update { &, &:hover { color: $light; @@ -66,6 +68,7 @@ $chill-theme-buttons: ( &.btn-create::before, &.btn-edit::before, &.btn-update::before, + &.btn-wopilink::before, &.btn-show::before, &.btn-view::before, &.btn-save::before, @@ -98,6 +101,7 @@ $chill-theme-buttons: ( &.btn-create::before { content: "\f067"; } // fa-plus &.btn-edit::before, &.btn-update::before { content: "\f040"; } // fa-pencil + &.btn-wopilink::before { content: "\f1dd"; } // fa-paragraph &.btn-show::before, &.btn-view::before { content: "\f06e"; } // fa-eye &.btn-save::before { content: "\f0c7"; } // fa-floppy-o diff --git a/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js b/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js index f39b6c83b..94c243412 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/module/wopi-link/index.js @@ -17,7 +17,7 @@ window.addEventListener('DOMContentLoaded', function (e) { wopiUrl: el.dataset.wopiUrl, title: el.dataset.docTitle, type: el.dataset.docType, - button: el.dataset.button ? JSON.parse(el.dataset.button) : {} + button: el.dataset.button !== 'null' ? JSON.parse(el.dataset.button) : {} } } }) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue index ced0edd2b..46124c179 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OpenWopiLink.vue @@ -1,9 +1,11 @@