From 02470aa78a296e403586d9cca8b43e6c930add88 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 12 Nov 2015 14:35:19 +0100 Subject: [PATCH] Now use own templates (not from layout ref). --- .../javascripts/app/controllers/chat.coffee | 12 +++++------ .../views/customer_chat/chat_loader.jst.eco | 7 +++++++ .../views/customer_chat/chat_message.jst.eco | 1 + .../customer_chat/chat_status_message.jst.eco | 1 + .../customer_chat/chat_timestamp.jst.eco | 1 + .../views/customer_chat/chat_window.jst.eco | 20 +++++++++++++++++++ 6 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/app/views/customer_chat/chat_loader.jst.eco create mode 100644 app/assets/javascripts/app/views/customer_chat/chat_message.jst.eco create mode 100644 app/assets/javascripts/app/views/customer_chat/chat_status_message.jst.eco create mode 100644 app/assets/javascripts/app/views/customer_chat/chat_timestamp.jst.eco create mode 100644 app/assets/javascripts/app/views/customer_chat/chat_window.jst.eco diff --git a/app/assets/javascripts/app/controllers/chat.coffee b/app/assets/javascripts/app/controllers/chat.coffee index b16afb616..151370c94 100644 --- a/app/assets/javascripts/app/controllers/chat.coffee +++ b/app/assets/javascripts/app/controllers/chat.coffee @@ -220,7 +220,7 @@ class chatWindow extends App.Controller ) render: -> - @html App.view('layout_ref/customer_chat_window') + @html App.view('customer_chat/chat_window') name: @options.name @el.one 'transitionend', @onTransitionend @@ -353,7 +353,7 @@ class chatWindow extends App.Controller @lastAddedType = sender - @body.append App.view('layout_ref/customer_chat_message') + @body.append App.view('customer_chat/chat_message') message: message sender: sender isNew: isNew @@ -365,7 +365,7 @@ class chatWindow extends App.Controller if !@isTyping @isTyping = true @maybeAddTimestamp() - @body.append App.view('layout_ref/customer_chat_loader')() + @body.append App.view('customer_chat/chat_loader')() @scrollToBottom() # clear old delay, set new @@ -397,7 +397,7 @@ class chatWindow extends App.Controller @lastAddedType = 'timestamp' addTimestamp: (label, time) => - @body.append App.view('layout_ref/customer_chat_timestamp') + @body.append App.view('customer_chat/chat_timestamp') label: label time: time @@ -405,12 +405,12 @@ class chatWindow extends App.Controller @body .find('.js-timestamp') .last() - .replaceWith App.view('layout_ref/customer_chat_timestamp') + .replaceWith App.view('customer_chat/chat_timestamp') label: label time: time addStatusMessage: (message) -> - @body.append App.view('layout_ref/customer_chat_status_message') + @body.append App.view('customer_chat/chat_status_message') message: message @scrollToBottom() diff --git a/app/assets/javascripts/app/views/customer_chat/chat_loader.jst.eco b/app/assets/javascripts/app/views/customer_chat/chat_loader.jst.eco new file mode 100644 index 000000000..bc76c0e36 --- /dev/null +++ b/app/assets/javascripts/app/views/customer_chat/chat_loader.jst.eco @@ -0,0 +1,7 @@ +
+
+ <%- @Icon('loading') %> + <%- @Icon('loading') %> + <%- @Icon('loading') %> +
+
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/customer_chat/chat_message.jst.eco b/app/assets/javascripts/app/views/customer_chat/chat_message.jst.eco new file mode 100644 index 000000000..096477697 --- /dev/null +++ b/app/assets/javascripts/app/views/customer_chat/chat_message.jst.eco @@ -0,0 +1 @@ +
<%- @message %>
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/customer_chat/chat_status_message.jst.eco b/app/assets/javascripts/app/views/customer_chat/chat_status_message.jst.eco new file mode 100644 index 000000000..eff398aa6 --- /dev/null +++ b/app/assets/javascripts/app/views/customer_chat/chat_status_message.jst.eco @@ -0,0 +1 @@ +
<%- @message %>
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/customer_chat/chat_timestamp.jst.eco b/app/assets/javascripts/app/views/customer_chat/chat_timestamp.jst.eco new file mode 100644 index 000000000..c3b688a8e --- /dev/null +++ b/app/assets/javascripts/app/views/customer_chat/chat_timestamp.jst.eco @@ -0,0 +1 @@ +
<%= @label %> <%= @time %>
\ No newline at end of file diff --git a/app/assets/javascripts/app/views/customer_chat/chat_window.jst.eco b/app/assets/javascripts/app/views/customer_chat/chat_window.jst.eco new file mode 100644 index 000000000..183d31f4d --- /dev/null +++ b/app/assets/javascripts/app/views/customer_chat/chat_window.jst.eco @@ -0,0 +1,20 @@ +
+
+
+ <%- @Icon('status') %> + <%- @Icon('status-modified-outer-circle') %> + <%- @Icon('status-modified-inner-circle') %> +
+
+
<%- @name %>
+
+ <%- @Icon('diagonal-cross') %> +
+
+
+
+
+
+
+
<%= @T('Send') %>
+
\ No newline at end of file