From ef119402cf4655906bb7a1dc328f8f92ce9d7d2d Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 19 Feb 2018 16:34:24 +0000 Subject: [PATCH 1/4] Add Front chat widget. --- services/web/app/views/front-chat.pug | 4 ++++ services/web/app/views/project/list.pug | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 services/web/app/views/front-chat.pug diff --git a/services/web/app/views/front-chat.pug b/services/web/app/views/front-chat.pug new file mode 100644 index 0000000000..0f5c5fa861 --- /dev/null +++ b/services/web/app/views/front-chat.pug @@ -0,0 +1,4 @@ +- if (settings.overleaf && settings.front.chat_room_id != null) + script. + window.FCSP = '#{settings.front.chat_room_id}'; + script(src="https://chat-assets.frontapp.com/v1/chat.bundle.js") \ No newline at end of file diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index dc5f2c16b2..8f175c2cd5 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -86,3 +86,5 @@ block content include ./list/empty-project-list include ./list/modals + + include front-chat From 978a8eae59c30e4bfb90bc6d2a7c8d4c3a4d4ead Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 19 Feb 2018 16:47:58 +0000 Subject: [PATCH 2/4] Move files around. --- services/web/app/views/project/list.pug | 2 +- services/web/app/views/{ => project/list}/front-chat.pug | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename services/web/app/views/{ => project/list}/front-chat.pug (100%) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 8f175c2cd5..3abcde9ba7 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -87,4 +87,4 @@ block content include ./list/modals - include front-chat + include ./list/front-chat diff --git a/services/web/app/views/front-chat.pug b/services/web/app/views/project/list/front-chat.pug similarity index 100% rename from services/web/app/views/front-chat.pug rename to services/web/app/views/project/list/front-chat.pug From f1a36919f9936b3b5fffc32a3fb894f97a24a012 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 19 Feb 2018 17:07:45 +0000 Subject: [PATCH 3/4] Make sure the widget does not overlap the footer. --- services/web/public/stylesheets/_ol_style_includes.less | 1 + services/web/public/stylesheets/app/front-chat-widget.less | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 services/web/public/stylesheets/app/front-chat-widget.less diff --git a/services/web/public/stylesheets/_ol_style_includes.less b/services/web/public/stylesheets/_ol_style_includes.less index f2832bd219..921b20f727 100644 --- a/services/web/public/stylesheets/_ol_style_includes.less +++ b/services/web/public/stylesheets/_ol_style_includes.less @@ -1 +1,2 @@ @import "app/sidebar-v2-dash-pane.less"; +@import "app/front-chat-widget.less"; diff --git a/services/web/public/stylesheets/app/front-chat-widget.less b/services/web/public/stylesheets/app/front-chat-widget.less new file mode 100644 index 0000000000..84da28ca7a --- /dev/null +++ b/services/web/public/stylesheets/app/front-chat-widget.less @@ -0,0 +1,3 @@ +#front-chat-holder > div[role=button] { + margin-bottom: @footer-height; +} \ No newline at end of file From 12233a23c963afddb8d14ce854cda037108ec6d8 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Wed, 21 Feb 2018 13:29:11 +0000 Subject: [PATCH 4/4] Avoid erroring if the front object is undefined. --- services/web/app/views/project/list/front-chat.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/web/app/views/project/list/front-chat.pug b/services/web/app/views/project/list/front-chat.pug index 0f5c5fa861..765bddc42a 100644 --- a/services/web/app/views/project/list/front-chat.pug +++ b/services/web/app/views/project/list/front-chat.pug @@ -1,4 +1,4 @@ -- if (settings.overleaf && settings.front.chat_room_id != null) +- if (settings.overleaf && settings.front && settings.front.chat_room_id != null) script. window.FCSP = '#{settings.front.chat_room_id}'; script(src="https://chat-assets.frontapp.com/v1/chat.bundle.js") \ No newline at end of file