diff --git a/client/components/mentorChat/mentorChat.html b/client/components/mentorChat/mentorChat.html new file mode 100644 index 00000000..cd731ba8 --- /dev/null +++ b/client/components/mentorChat/mentorChat.html @@ -0,0 +1,29 @@ + diff --git a/client/components/mentorChat/mentorChat.js b/client/components/mentorChat/mentorChat.js new file mode 100644 index 00000000..de50f2a9 --- /dev/null +++ b/client/components/mentorChat/mentorChat.js @@ -0,0 +1,28 @@ +Template.mentorChat.onCreated(function(){ + this.subscribe("userTickets"); +}); + +Template.mentorChat.helpers({ + // Return the current open or claimed Ticket held by the user, if it exists + currentTicket: function(){ + return Tickets.findOne({ + userId: Meteor.userId(), + status: { + $in: ["OPEN", "CLAIMED"] + } + }) + }, + statusIs: function(status){ + return this.status === status; + }, + queueEnabled: function(){ + var settings = Settings.findOne({}); + if (settings){ + return settings.queueEnabled; + } + } +}); + +Template.mentorChat.rendered = function(){ + $(this.find('.mentorChat')).addClass('animated bounceIn') +}; diff --git a/client/components/tickets/ticket/ticket.html b/client/components/tickets/ticket/ticket.html index 3dce5c43..d0bc9069 100644 --- a/client/components/tickets/ticket/ticket.html +++ b/client/components/tickets/ticket/ticket.html @@ -35,6 +35,20 @@ Contact: {{contact}} +
+
+
+

{{name}}: I am sitting at table #3

+
+
+

You: Ok, be right there

+
+
+
+ +
Send
+
+
{{#if statusIs "OPEN"}} @@ -67,4 +81,4 @@
- \ No newline at end of file + diff --git a/client/views/home/home.html b/client/views/home/home.html index 5ad12588..c9b7dd33 100644 --- a/client/views/home/home.html +++ b/client/views/home/home.html @@ -24,6 +24,14 @@ +
+
+ {{> mentorChat }} +
+
+ +
+