This repository has been archived by the owner on Apr 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from thesedateone/feature/manual_queuing
Feature/manual queuing
- Loading branch information
Showing
37 changed files
with
647 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var ecQueue = angular.module('ecQueue', [ | ||
'restangular', | ||
'ecQueueControllers', | ||
'ecQueueDirectives', | ||
'ecQueueServices', | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* Controllers */ | ||
|
||
var ecQueueControllers = angular.module('ecQueueControllers', []); | ||
|
||
|
||
ecQueueControllers.controller('queueCtrl', | ||
['$scope', 'ListType', 'ListTypeReport', | ||
function($scope, ListType, ListTypeReport) { | ||
|
||
$scope.refresh = function() { | ||
ListType.getData().then( | ||
function(list_types) { | ||
$scope.listtypes = {}; | ||
list_types.forEach(function(element) { | ||
ListTypeReport.getData(element.slug).then(function(result) { | ||
var typeInfo = { | ||
'slug': element.slug, | ||
'display': element.display_name, | ||
'completed': result.completed, | ||
'dequeued': result.dequeued, | ||
'inprogress': result.inprogress, | ||
'new': result.new, | ||
'queued': result.queued | ||
}; | ||
$scope.listtypes[typeInfo.slug] = typeInfo; | ||
}); | ||
}); | ||
}); | ||
}; | ||
|
||
$scope.doqueue = function(data) { | ||
var slug = data.slug; | ||
ListTypeReport.doQueue(slug).then( | ||
function(result) { | ||
data.completed = result.completed; | ||
data.dequeued = result.dequeued; | ||
data.inprogress = result.inprogress; | ||
data.new = result.new; | ||
data.queued = result.queued; | ||
|
||
$scope.listtypes[slug] = data; | ||
}); | ||
}; | ||
|
||
$scope.listtypes = []; | ||
$scope.refresh(); | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Directives */ | ||
|
||
var ecQueueDirectives = angular.module('ecQueueDirectives', []); | ||
|
||
|
||
ecQueueDirectives.directive('ecReportRow', function() { | ||
return { | ||
restrict: "A", | ||
scope: { | ||
'data': "=", | ||
'queuefunc': "&", | ||
}, | ||
template: | ||
' <th>{{ data.display }}</th>' + | ||
' <td>{{ data.completed }}</td>' + | ||
' <td>{{ data.dequeued }}</td>' + | ||
' <td>{{ data.inprogress }}</td>' + | ||
' <td>{{ data.new }}</td>' + | ||
' <td class="info">{{ data.queued }}</td>' + | ||
' <td>' + | ||
' <button class="btn btn-sm btn-primary pull-right" type="button"' + | ||
' ng-click="queue()">Queue</button>' + | ||
' </td>', | ||
|
||
link: function (scope, element, attrs) { | ||
scope.queue = function() { | ||
scope.queuefunc({'list': scope.data}); | ||
}; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* Services and Factories */ | ||
|
||
var ecQueueServices = angular.module('ecQueueServices', ['restangular']); | ||
|
||
|
||
ecQueueServices.factory('ListType', | ||
['$q', 'Restangular', | ||
function($q, Restangular) { | ||
return { | ||
getData: function() { | ||
var deferred = $q.defer(); | ||
Restangular.all('list_types/').getList().then(function(result) { | ||
deferred.resolve(result); | ||
}); | ||
return deferred.promise; | ||
} | ||
}; | ||
}]); | ||
|
||
|
||
ecQueueServices.factory('ListTypeReport', | ||
['$q', 'Restangular', | ||
function($q, Restangular) { | ||
return { | ||
getData: function(slug) { | ||
var deferred = $q.defer(); | ||
Restangular.all('list_types/').one(slug + '/report/').get().then(function(result) { | ||
deferred.resolve(result); | ||
}); | ||
return deferred.promise; | ||
}, | ||
|
||
doQueue: function(slug) { | ||
var deferred = $q.defer(); | ||
Restangular.all('list_types/').one(slug + '/report/') | ||
.put({}, {"X-CSRFToken": csrf_token}).then(function(result) { | ||
deferred.resolve(result); | ||
}); | ||
return deferred.promise; | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Controllers */ | ||
/* Services */ | ||
|
||
var ecSearchServices = angular.module('ecSearchServices', ['restangular']); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="col-sm-6 col-sm-offset-3 text-center" > | ||
|
||
<h2>There are no more records of type:<br> | ||
'{{callType.display_name}}'.</h2> | ||
|
||
<h3 class="sub-heading">Please try another List Type or talk to your supervisor.</h3> | ||
|
||
<a class="btn btn-lg btn-primary" href="#/ready" role="button">Return</a> | ||
|
||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
easyCall/apps/call_records/migrations/0015_auto_20150323_2221.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import models, migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('call_records', '0014_auto_20150315_1453'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='queueentry', | ||
name='call_record', | ||
field=models.OneToOneField(to='call_records.CallRecord'), | ||
preserve_default=True, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.