From 5cde3e6d93140e828e71107af46dce48dd16ef78 Mon Sep 17 00:00:00 2001 From: thesedateone Date: Wed, 25 Mar 2015 22:21:54 +1300 Subject: [PATCH] Revert "Feature/manual queuing" --- assets/js/{call => }/app.js | 8 +- assets/js/{call => }/controllers.js | 21 +-- assets/js/{call => }/directives.js | 51 ++------ assets/js/{call => }/filters.js | 0 assets/js/queue/app.js | 6 - assets/js/queue/controllers.js | 48 ------- assets/js/queue/directives.js | 31 ----- assets/js/queue/services.js | 42 ------ assets/js/search/app.js | 6 - assets/js/search/controllers.js | 49 ------- assets/js/search/directives.js | 121 ------------------ assets/js/search/services.js | 11 -- assets/partials/{call => }/call.html | 0 assets/partials/call/call_empty.html | 10 -- assets/partials/{call => }/ready.html | 0 assets/styles/main.sass | 57 ++------- dump.json | 5 - easyCall/apps/call_records/admin.py | 21 +-- easyCall/apps/call_records/importer.py | 41 ++++-- .../migrations/0011_callrecord_completed.py | 20 --- .../migrations/0012_auto_20150311_0742.py | 20 --- .../migrations/0013_auto_20150313_0716.py | 20 --- .../migrations/0014_auto_20150315_1453.py | 20 --- .../migrations/0015_auto_20150323_2221.py | 20 --- easyCall/apps/call_records/models.py | 39 +----- easyCall/apps/call_records/serializers.py | 5 +- easyCall/apps/call_records/urls.py | 2 - easyCall/apps/call_records/views.py | 34 ++--- easyCall/apps/lists/admin.py | 10 -- .../migrations/0013_callresult_status.py | 20 --- .../migrations/0014_auto_20150311_0624.py | 19 --- .../migrations/0015_auto_20150315_1453.py | 20 --- easyCall/apps/lists/models.py | 14 -- easyCall/apps/lists/report.py | 33 ----- easyCall/apps/lists/serializers.py | 19 +-- easyCall/apps/lists/urls.py | 2 - easyCall/apps/lists/views.py | 28 +--- .../templates/user_interface/admin.html | 101 +++++++++++++++ .../templates/user_interface/call.html | 10 +- .../templates/user_interface/queue.html | 72 ----------- .../templates/user_interface/search.html | 47 +------ .../templates/user_interface/upload.html | 116 ----------------- easyCall/apps/user_interface/urls.py | 3 +- easyCall/apps/user_interface/views.py | 17 +-- package.json | 11 +- static/app/css/main.min.css | 2 +- static/app/js/{call => }/app.js | 8 +- static/app/js/{call => }/controllers.js | 21 +-- static/app/js/{call => }/directives.js | 51 ++------ static/app/js/{call => }/filters.js | 0 static/app/js/queue/app.js | 6 - static/app/js/queue/controllers.js | 48 ------- static/app/js/queue/directives.js | 31 ----- static/app/js/queue/services.js | 42 ------ static/app/js/search/app.js | 6 - static/app/js/search/controllers.js | 49 ------- static/app/js/search/directives.js | 121 ------------------ static/app/js/search/filters.js | 3 - static/app/js/search/services.js | 11 -- static/app/partials/{call => }/call.html | 0 static/app/partials/call/call_empty.html | 10 -- static/app/partials/{call => }/ready.html | 0 62 files changed, 214 insertions(+), 1445 deletions(-) rename assets/js/{call => }/app.js (58%) rename assets/js/{call => }/controllers.js (91%) rename assets/js/{call => }/directives.js (93%) rename assets/js/{call => }/filters.js (100%) delete mode 100644 assets/js/queue/app.js delete mode 100644 assets/js/queue/controllers.js delete mode 100644 assets/js/queue/directives.js delete mode 100644 assets/js/queue/services.js delete mode 100644 assets/js/search/app.js delete mode 100644 assets/js/search/controllers.js delete mode 100644 assets/js/search/directives.js delete mode 100644 assets/js/search/services.js rename assets/partials/{call => }/call.html (100%) delete mode 100644 assets/partials/call/call_empty.html rename assets/partials/{call => }/ready.html (100%) delete mode 100644 easyCall/apps/call_records/migrations/0011_callrecord_completed.py delete mode 100644 easyCall/apps/call_records/migrations/0012_auto_20150311_0742.py delete mode 100644 easyCall/apps/call_records/migrations/0013_auto_20150313_0716.py delete mode 100644 easyCall/apps/call_records/migrations/0014_auto_20150315_1453.py delete mode 100644 easyCall/apps/call_records/migrations/0015_auto_20150323_2221.py delete mode 100644 easyCall/apps/lists/migrations/0013_callresult_status.py delete mode 100644 easyCall/apps/lists/migrations/0014_auto_20150311_0624.py delete mode 100644 easyCall/apps/lists/migrations/0015_auto_20150315_1453.py delete mode 100644 easyCall/apps/lists/report.py create mode 100644 easyCall/apps/user_interface/templates/user_interface/admin.html delete mode 100644 easyCall/apps/user_interface/templates/user_interface/queue.html delete mode 100644 easyCall/apps/user_interface/templates/user_interface/upload.html rename static/app/js/{call => }/app.js (58%) rename static/app/js/{call => }/controllers.js (91%) rename static/app/js/{call => }/directives.js (93%) rename static/app/js/{call => }/filters.js (100%) delete mode 100644 static/app/js/queue/app.js delete mode 100644 static/app/js/queue/controllers.js delete mode 100644 static/app/js/queue/directives.js delete mode 100644 static/app/js/queue/services.js delete mode 100644 static/app/js/search/app.js delete mode 100644 static/app/js/search/controllers.js delete mode 100644 static/app/js/search/directives.js delete mode 100644 static/app/js/search/filters.js delete mode 100644 static/app/js/search/services.js rename static/app/partials/{call => }/call.html (100%) delete mode 100644 static/app/partials/call/call_empty.html rename static/app/partials/{call => }/ready.html (100%) diff --git a/assets/js/call/app.js b/assets/js/app.js similarity index 58% rename from assets/js/call/app.js rename to assets/js/app.js index 20582c3..3cc8885 100644 --- a/assets/js/call/app.js +++ b/assets/js/app.js @@ -10,17 +10,13 @@ ecApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/ready', { - templateUrl: djangoStatic + 'partials/call/ready.html', + templateUrl: djangoStatic + 'partials/ready.html', controller: 'readyCtrl' }). when('/call/:callCat', { - templateUrl: djangoStatic + 'partials/call/call.html', + templateUrl: djangoStatic + 'partials/call.html', controller: 'callCtrl' }). - when('/call/:callCat/empty', { - templateUrl: djangoStatic + 'partials/call/call_empty.html', - controller: 'callEmptyCtrl' - }). otherwise({ redirectTo: '/ready' }); diff --git a/assets/js/call/controllers.js b/assets/js/controllers.js similarity index 91% rename from assets/js/call/controllers.js rename to assets/js/controllers.js index ee2682e..a95c5d0 100644 --- a/assets/js/call/controllers.js +++ b/assets/js/controllers.js @@ -4,27 +4,19 @@ var ecAppControllers = angular.module('ecAppControllers', ['restangular']); ecAppControllers.controller('readyCtrl', - ['$scope', 'Restangular', - function($scope, Restangular) { + ['$scope', 'Restangular', '$q', + function($scope, Restangular, $q) { + 'use strict'; + Restangular.all('list_types/').getList().then(function(types) { $scope.types = types; }); }]); -ecAppControllers.controller('callEmptyCtrl', - ['$scope', '$routeParams', 'Restangular', - function($scope, $routeParams, Restangular) { - Restangular.one('list_types/' + $routeParams.callCat + '/').get().then( - function(callType) { - $scope.callType = callType; - }); - }]); - - ecAppControllers.controller('callCtrl', - ['$scope', '$routeParams', 'Restangular', '$q', '$window', - function($scope, $routeParams, Restangular, $q, $window) { + ['$scope', '$routeParams', 'Restangular', '$q', + function($scope, $routeParams, Restangular, $q) { 'use strict'; Restangular.one('list_types/' + $routeParams.callCat + '/').get().then( @@ -43,7 +35,6 @@ ecAppControllers.controller('callCtrl', }, function (response) { console.log("Error with status code", response.status); deferred.reject(); - $window.location.href = '#/call/' + $routeParams.callCat + '/empty'; }); return deferred.promise; diff --git a/assets/js/call/directives.js b/assets/js/directives.js similarity index 93% rename from assets/js/call/directives.js rename to assets/js/directives.js index a0ec661..34f7a93 100644 --- a/assets/js/call/directives.js +++ b/assets/js/directives.js @@ -230,26 +230,15 @@ ecAppDirectives.directive('ecResultSection', function() { }, template: '' + - '
' + - '
' + - ' ' + - '
' + - '
' + - '
' + - '
' + - ' Next' + - '
' + - '
' + - ' Break' + - '
' + - '
', + '', link: function (scope, element, attrs) { scope.submit = function(button) { - scope.updatefunc({'button': button.display_name, 'data': scope.call}); - }; - scope.next = function() { - scope.updatefunc({'button': 'Next', 'data': scope.call}); + scope.updatefunc({'button': button, 'data': scope.call}); }; } }; @@ -260,31 +249,13 @@ ecAppDirectives.directive('ecActionButton', function() { return { restrict: "A", scope: { - linkfunc: "&", - data: "=", + data: "&", + label: "@", }, template: '' + - '{{data.display_name}}' + - '', - - link: function (scope) { - scope.btnclass = function(cat) { - var base = "btn btn-block btn-md "; - if (cat === "gd") { - var result = base.concat("btn-success"); - } else if (cat === "bd") { - var result = base.concat("btn-danger"); - } else if (cat === "nt") { - var result = base.concat("btn-default"); - } else if (cat === "ic") { - var result = base.concat("btn-primary"); - } else { - var result = base; - }; - return result; - }; - } + 'class="btn btn-md btn-default" role="button" ng-click="data()">' + + '{{label}}' + + '' }; }); diff --git a/assets/js/call/filters.js b/assets/js/filters.js similarity index 100% rename from assets/js/call/filters.js rename to assets/js/filters.js diff --git a/assets/js/queue/app.js b/assets/js/queue/app.js deleted file mode 100644 index 42c1998..0000000 --- a/assets/js/queue/app.js +++ /dev/null @@ -1,6 +0,0 @@ -var ecQueue = angular.module('ecQueue', [ - 'restangular', - 'ecQueueControllers', - 'ecQueueDirectives', - 'ecQueueServices', -]); \ No newline at end of file diff --git a/assets/js/queue/controllers.js b/assets/js/queue/controllers.js deleted file mode 100644 index 75bd02b..0000000 --- a/assets/js/queue/controllers.js +++ /dev/null @@ -1,48 +0,0 @@ -/* 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(); - - }]); \ No newline at end of file diff --git a/assets/js/queue/directives.js b/assets/js/queue/directives.js deleted file mode 100644 index f9a6277..0000000 --- a/assets/js/queue/directives.js +++ /dev/null @@ -1,31 +0,0 @@ -/* Directives */ - -var ecQueueDirectives = angular.module('ecQueueDirectives', []); - - -ecQueueDirectives.directive('ecReportRow', function() { - return { - restrict: "A", - scope: { - 'data': "=", - 'queuefunc': "&", - }, - template: - ' {{ data.display }}' + - ' {{ data.completed }}' + - ' {{ data.dequeued }}' + - ' {{ data.inprogress }}' + - ' {{ data.new }}' + - ' {{ data.queued }}' + - ' ' + - ' ' + - ' ', - - link: function (scope, element, attrs) { - scope.queue = function() { - scope.queuefunc({'list': scope.data}); - }; - } - }; -}); diff --git a/assets/js/queue/services.js b/assets/js/queue/services.js deleted file mode 100644 index cf18b68..0000000 --- a/assets/js/queue/services.js +++ /dev/null @@ -1,42 +0,0 @@ -/* 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; - } - }; -}]); \ No newline at end of file diff --git a/assets/js/search/app.js b/assets/js/search/app.js deleted file mode 100644 index 4be3d86..0000000 --- a/assets/js/search/app.js +++ /dev/null @@ -1,6 +0,0 @@ -var ecSearch = angular.module('ecSearch', [ - 'restangular', - 'ecSearchControllers', - 'ecSearchDirectives', - 'ecSearchServices', -]); \ No newline at end of file diff --git a/assets/js/search/controllers.js b/assets/js/search/controllers.js deleted file mode 100644 index ea8cbfe..0000000 --- a/assets/js/search/controllers.js +++ /dev/null @@ -1,49 +0,0 @@ -/* Controllers */ - -var ecSearchControllers = angular.module('ecSearchControllers', []); - - -ecSearchControllers.controller('searchCtrl', - ['$scope', 'CallRecord', - function($scope, CallRecord) { - - var doSearch = function(searchstring) { - CallRecord.getList({'search': searchstring}).then( - function(call_records) { - $scope.data = call_records; - }); - }; - - $scope.dequeue = function(id) { - CallRecord.one(id).get().then( - function(rec) { - rec.status = 'dq'; - rec.put({}, {"X-CSRFToken": csrf_token}).then( - function (response) { - doSearch($scope.searchString); - }, function (response) { - console.log("Error with status code", response.status); - }); - }); - }; - - $scope.onChange = function() { - if ($scope.searchString.length > 2) { - doSearch($scope.searchString); - }; - }; - - $scope.$watch('data', function(newVal, oldVal){ - if (newVal) { - if (newVal.length < 1) { - $scope.noresults = true; - } else { - $scope.noresults = false; - }; - } else { - // First page load - $scope.noresults = true; - }; - }); - - }]); \ No newline at end of file diff --git a/assets/js/search/directives.js b/assets/js/search/directives.js deleted file mode 100644 index d5b79e5..0000000 --- a/assets/js/search/directives.js +++ /dev/null @@ -1,121 +0,0 @@ -/* Directives */ - -var ecSearchDirectives = angular.module('ecSearchDirectives', []); - - -ecSearchDirectives.directive('ecSearchResult', function() { - return { - restrict: "E", - scope: { - data: "=", - dequeue: "&", - }, - template: - '
' + - '

SN: {{ data.serial_number }}

' + - '

' + - ' {{ data.list_type_display }} {{ data.status_display }}' + - '

' + - '
' + - '

{{ full_name }}

' + - '' + - '' + - '' + - '' + - '', - - link: function (scope, element, attrs) { - - var button = angular.element(element.find('button')); - if (scope.data.status !== "nw" && scope.data.status !== "ip") { - button.attr( "disabled", "disabled" ); - }; - - scope.handleclick = function() { - scope.dequeue({'id': scope.data.id}); - }; - - scope.labelClass = function() { - if (scope.data.status === "nw") { - return "label label-success"; - } else if (scope.data.status === "ip") { - return "label label-info"; - } else if (scope.data.status === "cp") { - return "label label-primary"; - } else { - return "label label-default"; - }; - }; - - function calcname() { - var name = ''; - if (scope.data.name_prefix) name = name + scope.data.name_prefix + ' '; - if (scope.data.name_first) name = name + scope.data.name_first + ' '; - if (scope.data.name_middle) name = name + scope.data.name_middle + ' '; - if (scope.data.name_family) name = name + scope.data.name_family + ' '; - if (scope.data.name_suffix) name = name + scope.data.name_suffix; - return name; - }; - - scope.full_name = calcname(); - } - }; -}); - - -ecSearchDirectives.directive('ecTelCompressed', function() { - return { - restrict: "E", - scope: { - 'day': "=", - 'evening': "=", - 'work': "=", - 'mobile': "=", - }, - template: - '

' + - ' (DAY){{ day }}' + - ' (EVE){{ evening }}' + - ' (WORK){{ work }}' + - ' (MOB){{ mobile }}' + - '

', - - link: function (scope, element, attrs) { - scope.spanclass = 'col-xs-10 col-sm-6 col-lg-4'; - } - }; -}); - - -ecSearchDirectives.directive('ecAddressCompressed', function() { - return { - restrict: "E", - scope: { - 'addr1': "=", - 'addr2': "=", - 'addr3': "=", - 'suburb': "=", - 'city': "=", - 'postcode': "=", - }, - template: - '
' + - ' ' + - '
' - }; -}); diff --git a/assets/js/search/services.js b/assets/js/search/services.js deleted file mode 100644 index f4504c0..0000000 --- a/assets/js/search/services.js +++ /dev/null @@ -1,11 +0,0 @@ -/* Services */ - -var ecSearchServices = angular.module('ecSearchServices', ['restangular']); - - -ecSearchServices.factory('CallRecord', - ['Restangular', - function(Restangular) { - return Restangular.service('call_records'); -}]); - diff --git a/assets/partials/call/call.html b/assets/partials/call.html similarity index 100% rename from assets/partials/call/call.html rename to assets/partials/call.html diff --git a/assets/partials/call/call_empty.html b/assets/partials/call/call_empty.html deleted file mode 100644 index 1d7e42e..0000000 --- a/assets/partials/call/call_empty.html +++ /dev/null @@ -1,10 +0,0 @@ -
- -

There are no more records of type:
- '{{callType.display_name}}'.

- -

Please try another List Type or talk to your supervisor.

- - Return - -
\ No newline at end of file diff --git a/assets/partials/call/ready.html b/assets/partials/ready.html similarity index 100% rename from assets/partials/call/ready.html rename to assets/partials/ready.html diff --git a/assets/styles/main.sass b/assets/styles/main.sass index 0ba1f0d..372ba05 100644 --- a/assets/styles/main.sass +++ b/assets/styles/main.sass @@ -5,7 +5,6 @@ $font-stack: Helvetica, sans-serif $dark-grey: hsla(0, 0%, 33%, 1) $light-grey: hsla(0, 0%, 55%, 1) -$very-light-grey: hsla(0, 0%, 70%, 1) body font-family: $font-stack @@ -65,37 +64,6 @@ body margin-bottom: 40px -// search page styles - - -.search-body - - .search-input - padding-top: 30px - - .results - padding-top: 50px - - .phone-numbers, - .address, - .status - padding-top: 10px - - em - color: $light-grey - weight: bold - padding-right: 10px - - button - margin-top: -40px - - .list-group-item-sub-heading - padding-right: 15px - - .no-results - color: $very-light-grey - - // call page styles h2 @@ -104,10 +72,6 @@ h2 // margin-right: 15px color: $dark-grey -h3.sub-heading - color: $very-light-grey - - .title font-size: 90% font-weight: bolder @@ -160,17 +124,16 @@ h4 .input-group padding-bottom: 5px - .buttons - padding-top: 15px - margin-right: -5px - margin-left: -5px - - .col-xs-6, - .col-xs-4 - padding-bottom: 5px - padding-top: 5px - padding-left: 5px - padding-right: 5px + ul + padding-top: 20px + list-style-type: none + padding-left: 0 + + li + display: inline-block + + .btn + margin-right: 10px .pane-right height: 100% diff --git a/dump.json b/dump.json index a4d83ce..a9bc9a7 100644 --- a/dump.json +++ b/dump.json @@ -121,7 +121,6 @@ }, { "fields": { - "category": "gd", "deactivated": false, "display_name": "Success", "list_type": "allthings" @@ -131,7 +130,6 @@ }, { "fields": { - "category": "nt", "deactivated": false, "display_name": "Left a Message", "list_type": "allthings" @@ -597,7 +595,6 @@ }, { "fields": { - "category": "gd", "deactivated": false, "display_name": "Success", "list_type": "littlepony" @@ -607,7 +604,6 @@ }, { "fields": { - "category": "bd", "deactivated": false, "display_name": "Never Call Again", "list_type": "littlepony" @@ -617,7 +613,6 @@ }, { "fields": { - "category": "nt", "deactivated": false, "display_name": "No Answer", "list_type": "littlepony" diff --git a/easyCall/apps/call_records/admin.py b/easyCall/apps/call_records/admin.py index 98d8362..38f4f0d 100644 --- a/easyCall/apps/call_records/admin.py +++ b/easyCall/apps/call_records/admin.py @@ -1,6 +1,5 @@ from django.contrib import admin from easyCall.apps.call_records.models import CallRecord, UserNote -from easyCall.apps.call_records.models import Call, QueueEntry class UserInline(admin.TabularInline): @@ -10,24 +9,8 @@ class UserInline(admin.TabularInline): class CallRecordAdmin(admin.ModelAdmin): inlines = [UserInline] - list_display = ('serial_number', 'list_type', 'status', 'added', 'completed') + list_display = ('serial_number', 'list_type', 'status', 'added') list_filter = ('list_type', 'status', 'added') -class CallAdmin(admin.ModelAdmin): - list_display = ('id', 'caller', 'result', 'start_time', 'end_time') - list_filter = ('caller', 'result', 'start_time', 'end_time') - - -class QueueEntryAdmin(admin.ModelAdmin): - list_display = ('call_record', 'list_type', 'date_added') - list_filter = ('date_added',) - pass - - -admin.site.register(CallRecord, CallRecordAdmin) -admin.site.register(Call, CallAdmin) -admin.site.register(QueueEntry, QueueEntryAdmin) - - - +admin.site.register(CallRecord, CallRecordAdmin) \ No newline at end of file diff --git a/easyCall/apps/call_records/importer.py b/easyCall/apps/call_records/importer.py index 8834111..99c495d 100644 --- a/easyCall/apps/call_records/importer.py +++ b/easyCall/apps/call_records/importer.py @@ -5,9 +5,6 @@ from django.utils import timezone from django.conf import settings -from django.db.models import Q -from django.db import IntegrityError - from easyCall.apps.call_records.models import CallRecord from easyCall.apps.call_records.models import QueueEntry from easyCall.apps.call_records.models import ExtraInformation @@ -35,6 +32,7 @@ def import_csv(file_name, list_type): record.save() save_notes(list_type, row, record) save_extras(list_type, row, record) + _do_queue_repopulation() def create_main_record(list_type, row): @@ -230,12 +228,31 @@ def save_extras(list_type, row, record): -def populate_queue(slug): - records = CallRecord.objects.filter(Q(status=CallRecord.NEW) | Q(status=CallRecord.IN_PROGRESS)) - for record in records.filter(list_type=slug): - try: - entry = QueueEntry(call_record=record, - list_type=record.list_type) - entry.save() - except IntegrityError as ie: - pass # Nothing to do +def populate_queue(): + # TODO: things will get hairy if the queue is completely empty + queue_size = QueueEntry.objects.count() + + if queue_size > 0: + print("there is something in the queue") + # Figure out the earliest time we can repopulate + timezone.activate(pytz.timezone(settings.TIME_ZONE)) + last_update = QueueEntry.objects.last().date_added + print(last_update) + delta = timedelta(minutes=2) + now = timezone.now() + + if now < (last_update + delta): + print("too soon, can't repopulate") + return False + + # repopulate queue + _do_queue_repopulation() + return True + + +def _do_queue_repopulation(): + records = CallRecord.objects.filter(status=CallRecord.NEW) + for record in records: + entry = QueueEntry(call_record=record, + list_type=record.list_type) + entry.save() diff --git a/easyCall/apps/call_records/migrations/0011_callrecord_completed.py b/easyCall/apps/call_records/migrations/0011_callrecord_completed.py deleted file mode 100644 index 18cc42f..0000000 --- a/easyCall/apps/call_records/migrations/0011_callrecord_completed.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('call_records', '0010_callrecord_added'), - ] - - operations = [ - migrations.AddField( - model_name='callrecord', - name='completed', - field=models.DateField(null=True, blank=True), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/call_records/migrations/0012_auto_20150311_0742.py b/easyCall/apps/call_records/migrations/0012_auto_20150311_0742.py deleted file mode 100644 index 4c6f668..0000000 --- a/easyCall/apps/call_records/migrations/0012_auto_20150311_0742.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('call_records', '0011_callrecord_completed'), - ] - - operations = [ - migrations.AlterField( - model_name='callrecord', - name='completed', - field=models.DateTimeField(null=True, blank=True), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/call_records/migrations/0013_auto_20150313_0716.py b/easyCall/apps/call_records/migrations/0013_auto_20150313_0716.py deleted file mode 100644 index c9ff9a2..0000000 --- a/easyCall/apps/call_records/migrations/0013_auto_20150313_0716.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('call_records', '0012_auto_20150311_0742'), - ] - - operations = [ - migrations.AlterField( - model_name='call', - name='result', - field=models.CharField(max_length=255, null=True, blank=True), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/call_records/migrations/0014_auto_20150315_1453.py b/easyCall/apps/call_records/migrations/0014_auto_20150315_1453.py deleted file mode 100644 index 1cbda72..0000000 --- a/easyCall/apps/call_records/migrations/0014_auto_20150315_1453.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('call_records', '0013_auto_20150313_0716'), - ] - - operations = [ - migrations.AlterField( - model_name='callrecord', - name='status', - field=models.CharField(default=b'nw', max_length=2, choices=[(b'nw', b'New'), (b'ip', b'In Progress'), (b'cp', b'Completed'), (b'dq', b'Dequeued')]), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/call_records/migrations/0015_auto_20150323_2221.py b/easyCall/apps/call_records/migrations/0015_auto_20150323_2221.py deleted file mode 100644 index 45ee239..0000000 --- a/easyCall/apps/call_records/migrations/0015_auto_20150323_2221.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- 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, - ), - ] diff --git a/easyCall/apps/call_records/models.py b/easyCall/apps/call_records/models.py index 289582e..02ec2cf 100644 --- a/easyCall/apps/call_records/models.py +++ b/easyCall/apps/call_records/models.py @@ -2,7 +2,6 @@ from django.db import models from django.contrib.auth.models import User -from django.utils import timezone from easyCall.apps.lists.models import ListType, CallResult @@ -36,47 +35,19 @@ class CallRecord(models.Model): NEW = 'nw' IN_PROGRESS = 'ip' COMPLETE = 'cp' - DEQUEUED = 'dq' STATUS_CHOICES = ( (NEW, 'New'), (IN_PROGRESS, 'In Progress'), (COMPLETE, 'Completed'), - (DEQUEUED, 'Dequeued'), ) status = models.CharField(max_length=2, choices=STATUS_CHOICES, default=NEW) added = models.DateTimeField(auto_now_add=True) - completed = models.DateTimeField(blank=True, null=True) - def get_current_call(self): - calls = self.results.all() - if not calls: - return None - else: - call = calls.last() - return call.id - - def list_type_display(self): - return self.list_type.display_name - - def update_status(self, category): - if category in [CallResult.GOOD, CallResult.BAD]: - self.status = self.COMPLETE - self.completed = timezone.now() - elif category in [CallResult.NEUTRAL]: - self.status = self.IN_PROGRESS - elif category in [CallResult.INCOMPLETE]: - pass - self.save() - - def handle_dequeue(self): - if self.status == self.DEQUEUED: - try: - self.queueentry.delete() - except AttributeError: - pass # There is nothing to delete + call = self.results.first() + return call.id def __unicode__(self): """CallRecord to_string method.""" @@ -85,11 +56,11 @@ def __unicode__(self): class QueueEntry(models.Model): list_type = models.ForeignKey(ListType) - call_record = models.OneToOneField(CallRecord) + call_record = models.ForeignKey(CallRecord) date_added = models.DateTimeField(auto_now_add=True) def __unicode__(self): - """QueueEntry to_string method.""" + """CallRecord to_string method.""" return "{} ({})".format(self.call_record.id, self.list_type.slug) @@ -209,7 +180,7 @@ def note3_display(self): class Call(models.Model): call_record = models.ForeignKey(CallRecord, related_name='results') caller = models.ForeignKey(User, related_name='calls') - result = models.CharField(max_length=255, blank=True, null=True) + result = models.ForeignKey(CallResult, blank=True, null=True) start_time = models.DateTimeField(auto_now_add=True) end_time = models.DateTimeField(blank=True, null=True) data1 = models.CharField(max_length=255, blank=True) diff --git a/easyCall/apps/call_records/serializers.py b/easyCall/apps/call_records/serializers.py index 685c1b5..f09396d 100644 --- a/easyCall/apps/call_records/serializers.py +++ b/easyCall/apps/call_records/serializers.py @@ -10,13 +10,10 @@ class CallRecordSerializer(serializers.ModelSerializer): call = serializers.CharField(source='get_current_call', allow_null=True, read_only=True) - list_type_display = serializers.CharField(allow_null=True, read_only=True) - status_display = serializers.CharField(source='get_status_display', - allow_null=True, read_only=True) class Meta: model = CallRecord - read_only_fields = ('list_type', 'serial_number') + read_only_fields = ('list_type', 'serial_number', 'status') class CallRecordExtraSerializer(serializers.ModelSerializer): diff --git a/easyCall/apps/call_records/urls.py b/easyCall/apps/call_records/urls.py index d24a23c..0425512 100644 --- a/easyCall/apps/call_records/urls.py +++ b/easyCall/apps/call_records/urls.py @@ -3,8 +3,6 @@ from easyCall.apps.call_records import views urlpatterns = [ - url(r'^call_records/$', - views.CallRecordList.as_view()), url(r'^call_records/(?P[0-9]+)$', views.CallRecordDetail.as_view()), url(r'^call_records/(?P[0-9a-zA-Z]+)/next/$', diff --git a/easyCall/apps/call_records/views.py b/easyCall/apps/call_records/views.py index ecb9e46..3a4658b 100644 --- a/easyCall/apps/call_records/views.py +++ b/easyCall/apps/call_records/views.py @@ -16,6 +16,7 @@ from easyCall.apps.call_records.models import UserNote from easyCall.apps.call_records.models import Call from easyCall.apps.lists.models import CallResult +from easyCall.apps.call_records.importer import populate_queue from easyCall.apps.call_records.serializers import CallRecordSerializer from easyCall.apps.call_records.serializers import UserNoteSerializer from easyCall.apps.call_records.serializers import SystemNoteSerializer @@ -114,22 +115,6 @@ def _get_object(self, call_pk): raise Http404 -class CallRecordList(APIView): - - """Retrieve all CallRecords with optional queryparam. """ - - permission_classes = (permissions.IsAuthenticated,) - - def get(self, request, format=None): - searchstring = self.request.QUERY_PARAMS.get('search', None) - call_records = CallRecord.objects.all() - if searchstring: - call_records = CallRecord.objects.filter( - serial_number__startswith=searchstring) - serializer = CallRecordSerializer(call_records, many=True) - return Response(serializer.data) - - class CallRecordDetail(APIView): """Retrieve details of a CallRecord. """ @@ -147,7 +132,6 @@ def put(self, request, pk, format=None): serializer = CallRecordSerializer(record, data=data) if serializer.is_valid(): serializer.save() - record.handle_dequeue() return Response(serializer.data) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) @@ -191,25 +175,22 @@ def put(self, request, pk, format=None): timezone.activate(pytz.timezone(settings.TIME_ZONE)) call = self._get_object(pk) data = request.data - result, result_cat = self._get_result(data, call) - data['result'] = result + result = self._get_result(data, call) + data['result'] = result.pk data['end_time'] = timezone.now() serializer = CallSerializer(call, data=data) if serializer.is_valid(): serializer.save() - call.call_record.update_status(result_cat) return Response(serializer.data) return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) def _get_result(self, data, call): - result_in = data['result'] - if result_in == "Next": - return ("Next", CallResult.INCOMPLETE) try: + result_in = data['result'] list_type = call.call_record.list_type result = CallResult.objects.get(display_name=result_in, list_type=list_type) - return (result.display_name, result.category) + return result except CallResult.DoesNotExist: raise Http404 @@ -231,6 +212,7 @@ def get(self, request, list_type, format=None): caller = User.objects.get(id=request.user.id) call = Call(call_record=record, caller=caller) call.save() + print(call.id) serializer = CallRecordSerializer(record) return Response(serializer.data) @@ -249,4 +231,6 @@ def _get_object(self, list_type): # kind of expected, try again pass except QueueEntry.DoesNotExist: - raise Http404 + could_repopulate = populate_queue() + if not could_repopulate: + raise Http404 diff --git a/easyCall/apps/lists/admin.py b/easyCall/apps/lists/admin.py index 8cbe4a4..5e1b085 100644 --- a/easyCall/apps/lists/admin.py +++ b/easyCall/apps/lists/admin.py @@ -12,16 +12,6 @@ class ResultInline(admin.TabularInline): model = CallResult extra = 1 can_delete = False - fields = ('display_name', 'category', 'deactivated') - - def formfield_for_choice_field(self, db_field, request, **kwargs): - if db_field.name == "category": - kwargs['choices'] = ( - ('gd', 'Good'), - ('bd', 'Bad'), - ('nt', 'Neutral'), - ) - return super(ResultInline, self).formfield_for_choice_field(db_field, request, **kwargs) class ExtraInline(admin.StackedInline): diff --git a/easyCall/apps/lists/migrations/0013_callresult_status.py b/easyCall/apps/lists/migrations/0013_callresult_status.py deleted file mode 100644 index d6f9e55..0000000 --- a/easyCall/apps/lists/migrations/0013_callresult_status.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('lists', '0012_auto_20150307_1738'), - ] - - operations = [ - migrations.AddField( - model_name='callresult', - name='status', - field=models.CharField(default=b'nt', max_length=2, choices=[(b'gd', b'Good'), (b'bd', b'Bad'), (b'nt', b'Neutral'), (b'ic', b'Incomplete'), (b'dq', b'Dequeued')]), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/lists/migrations/0014_auto_20150311_0624.py b/easyCall/apps/lists/migrations/0014_auto_20150311_0624.py deleted file mode 100644 index 2712a35..0000000 --- a/easyCall/apps/lists/migrations/0014_auto_20150311_0624.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('lists', '0013_callresult_status'), - ] - - operations = [ - migrations.RenameField( - model_name='callresult', - old_name='status', - new_name='category', - ), - ] diff --git a/easyCall/apps/lists/migrations/0015_auto_20150315_1453.py b/easyCall/apps/lists/migrations/0015_auto_20150315_1453.py deleted file mode 100644 index d20fe3e..0000000 --- a/easyCall/apps/lists/migrations/0015_auto_20150315_1453.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('lists', '0014_auto_20150311_0624'), - ] - - operations = [ - migrations.AlterField( - model_name='callresult', - name='category', - field=models.CharField(default=b'nt', max_length=2, choices=[(b'gd', b'Good'), (b'bd', b'Bad'), (b'nt', b'Neutral'), (b'ic', b'Incomplete')]), - preserve_default=True, - ), - ] diff --git a/easyCall/apps/lists/models.py b/easyCall/apps/lists/models.py index d423c5e..62d27bf 100644 --- a/easyCall/apps/lists/models.py +++ b/easyCall/apps/lists/models.py @@ -153,20 +153,6 @@ class CallResult(models.Model): display_name = models.CharField(max_length=50) deactivated = models.BooleanField(default=False) - GOOD = 'gd' - BAD = 'bd' - NEUTRAL = 'nt' - INCOMPLETE = 'ic' - STATUS_CHOICES = ( - (GOOD, 'Good'), - (BAD, 'Bad'), - (NEUTRAL, 'Neutral'), - (INCOMPLETE, 'Incomplete'), - ) - category = models.CharField(max_length=2, - choices=STATUS_CHOICES, - default=NEUTRAL) - def __unicode__(self): """CallResult to_string method.""" return self.display_name diff --git a/easyCall/apps/lists/report.py b/easyCall/apps/lists/report.py deleted file mode 100644 index 103e3fc..0000000 --- a/easyCall/apps/lists/report.py +++ /dev/null @@ -1,33 +0,0 @@ -from easyCall.apps.call_records.models import CallRecord, QueueEntry - - -class TypeReport: - - """Retrieve record counts to provide to the report serializer.""" - - def __init__(self, list_type): - self.call_record_set = CallRecord.objects.filter(list_type=list_type) - self.list_type = list_type - self.new_qs = self.call_record_set.filter(status=CallRecord.NEW) - self.in_progress_qs = self.call_record_set.filter(status=CallRecord.IN_PROGRESS) - self.completed_qs = self.call_record_set.filter(status=CallRecord.COMPLETE) - self.dequeued_qs = self.call_record_set.filter(status=CallRecord.DEQUEUED) - self.queue_entry_qs = QueueEntry.objects.filter(list_type=list_type) - - def slug(self): - return self.list_type - - def completed(self): - return self.completed_qs.count() - - def dequeued(self): - return self.dequeued_qs.count() - - def inprogress(self): - return self.in_progress_qs.count() - - def new(self): - return self.new_qs.count() - - def queued(self): - return self.queue_entry_qs.count() \ No newline at end of file diff --git a/easyCall/apps/lists/serializers.py b/easyCall/apps/lists/serializers.py index fd10999..59f77b1 100644 --- a/easyCall/apps/lists/serializers.py +++ b/easyCall/apps/lists/serializers.py @@ -1,27 +1,10 @@ from rest_framework import serializers from easyCall.apps.lists.models import ListType -from easyCall.apps.lists.models import ListType, CallResult - - -class ResultSerializer(serializers.ModelSerializer): - - class Meta: - model = CallResult - fields = ('display_name', 'category', 'deactivated') class ListTypeSerializer(serializers.ModelSerializer): - results = ResultSerializer(many=True, read_only=True) + results = serializers.StringRelatedField(many=True) class Meta: model = ListType fields = ('slug', 'display_name', 'results') - - -class ListTypeReportSerializer(serializers.Serializer): - slug = serializers.CharField(read_only=True) - completed = serializers.IntegerField(read_only=True) - dequeued = serializers.IntegerField(read_only=True) - inprogress = serializers.IntegerField(read_only=True) - new = serializers.IntegerField(read_only=True) - queued = serializers.IntegerField(read_only=True) diff --git a/easyCall/apps/lists/urls.py b/easyCall/apps/lists/urls.py index 51f355c..e1605b0 100644 --- a/easyCall/apps/lists/urls.py +++ b/easyCall/apps/lists/urls.py @@ -6,8 +6,6 @@ url(r'^list_types/$', views.ListTypeList.as_view()), url(r'^list_types/(?P[0-9a-zA-Z]+)/$', views.CallResultList.as_view()), - url(r'^list_types/(?P[0-9a-zA-Z]+)/report/$', - views.ListTypeReport.as_view()), ] urlpatterns = format_suffix_patterns(urlpatterns) diff --git a/easyCall/apps/lists/views.py b/easyCall/apps/lists/views.py index 084ce55..9f4a1ed 100644 --- a/easyCall/apps/lists/views.py +++ b/easyCall/apps/lists/views.py @@ -4,9 +4,7 @@ from django.http import Http404 from easyCall.apps.lists.models import ListType -from easyCall.apps.lists.report import TypeReport -from easyCall.apps.lists.serializers import ListTypeSerializer, ListTypeReportSerializer -from easyCall.apps.call_records.importer import populate_queue +from easyCall.apps.lists.serializers import ListTypeSerializer class ListTypeList(APIView): @@ -41,27 +39,3 @@ def get(self, request, slug, format=None): list_type = self.get_object(slug) serializer = ListTypeSerializer(list_type) return Response(serializer.data) - - -class ListTypeReport(APIView): - - """Return the counts by status for a List Type.""" - - permission_classes = (permissions.IsAuthenticated,) - - def get(self, request, slug, format=None): - record = self._get_object(slug) - serializer = ListTypeReportSerializer(record) - return Response(serializer.data) - - def put(self, request, slug, format=None): - record = self._get_object(slug) - populate_queue(slug) - serializer = ListTypeReportSerializer(record) - return Response(serializer.data) - - def _get_object(self, slug): - try: - return TypeReport(list_type=slug) - except CallRecord.DoesNotExist: - raise Http404 diff --git a/easyCall/apps/user_interface/templates/user_interface/admin.html b/easyCall/apps/user_interface/templates/user_interface/admin.html new file mode 100644 index 0000000..6063797 --- /dev/null +++ b/easyCall/apps/user_interface/templates/user_interface/admin.html @@ -0,0 +1,101 @@ +{% extends "base.html" %} +{% load staticfiles %} +{% load widget_tweaks %} + +{% block title %}Easy Call - Call{% endblock %} + +{% block globals %} +var userName = '{{user}}'; +{% endblock %} + +{% block nav %} +{% if 'Caller' in groups %}
  • Call
  • {% endif %} +{% if 'Inbound' in groups %}
  • Search
  • {% endif %} +{% if 'Admin' in groups %}
  • Admin
  • {% endif %} +{% endblock %} + +{% block nav-right %} +
  • Log out ({{user}})
  • +{% endblock%} + +{% block content %} +
    +
    +
    +

    Upload new Call Records

    +
    +
    +
    + +
    +
    +
    + {% csrf_token %} + + {% if form.non_field_errors %} + {% for error in form.non_field_errors %} +
    +
    + {{ error|escape }} +
    +
    + {% endfor %} + {% endif %} + + {% if message %} +
    +
    + {{ message|escape }} +
    +
    + {% endif %} + + {% if form.list_type.errors %} +
    + + {% for error in form.list_type.errors %} +
    +
    + {{ error|escape }} +
    +
    + {% endfor %} + {% else %} +
    + + {% endif %} + {{ form.list_type|add_class:"form-control" }} +
    + + {% if form.file.errors %} +
    + + {% for error in form.file.errors %} +
    +
    + {{ error|escape }} +
    +
    + {% endfor %} + {% else %} +
    + + {% endif %} + {{ form.file|add_class:"form-control" }} +
    + +
    + +
    + + + +
    +
    +
    +{% endblock %} + +{% block extrajs %}{% endblock %} \ No newline at end of file diff --git a/easyCall/apps/user_interface/templates/user_interface/call.html b/easyCall/apps/user_interface/templates/user_interface/call.html index df763dd..ca3e3df 100644 --- a/easyCall/apps/user_interface/templates/user_interface/call.html +++ b/easyCall/apps/user_interface/templates/user_interface/call.html @@ -10,7 +10,7 @@ {% block nav %} {% if 'Caller' in groups %}
  • Call
  • {% endif %} {% if 'Inbound' in groups %}
  • Search
  • {% endif %} -{% if 'Admin' in groups %}
  • Admin
  • {% endif %} +{% if 'Admin' in groups %}
  • Admin
  • {% endif %} {% endblock %} {% block nav-right %} @@ -26,8 +26,8 @@ {% endblock %} {% block extrajs %} - - - - + + + + {% endblock %} \ No newline at end of file diff --git a/easyCall/apps/user_interface/templates/user_interface/queue.html b/easyCall/apps/user_interface/templates/user_interface/queue.html deleted file mode 100644 index 90cee43..0000000 --- a/easyCall/apps/user_interface/templates/user_interface/queue.html +++ /dev/null @@ -1,72 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load widget_tweaks %} - -{% block title %}Easy Call - Call{% endblock %} - -{% block globals %} -var userName = '{{user}}'; -{% endblock %} - -{% block nav %} -{% if 'Caller' in groups %}
  • Call
  • {% endif %} -{% if 'Inbound' in groups %}
  • Search
  • {% endif %} -{% if 'Admin' in groups %}
  • Admin
  • {% endif %} -{% endblock %} - -{% block nav-right %} -
  • Log out ({{user}})
  • -{% endblock%} - -{% block content %} -
    -
    - -
    - -
    - -
    - {% verbatim %} -
    - -

    Call Record Data

    - - - - - - - - - - - - - - - -
    List TypeCompletedDequeuedIn ProgressNewQueued -
    -
    - {% endverbatim %} -
    - -
    -
    -{% endblock %} - -{% block extrajs %} - - - - -{% endblock %} \ No newline at end of file diff --git a/easyCall/apps/user_interface/templates/user_interface/search.html b/easyCall/apps/user_interface/templates/user_interface/search.html index 5136fe5..38b2d5b 100644 --- a/easyCall/apps/user_interface/templates/user_interface/search.html +++ b/easyCall/apps/user_interface/templates/user_interface/search.html @@ -10,7 +10,7 @@ {% block nav %} {% if 'Caller' in groups %}
  • Call
  • {% endif %} {% if 'Inbound' in groups %}
  • Search
  • {% endif %} -{% if 'Admin' in groups %}
  • Admin
  • {% endif %} +{% if 'Admin' in groups %}
  • Admin
  • {% endif %} {% endblock %} {% block nav-right %} @@ -18,48 +18,7 @@ {% endblock%} {% block content %} - {% verbatim %} -
    -
    - -
    -
    -
    - - - - -
    -
    -
    - -
    - -
    -

    No Results Found

    -
    - -
    -
    - - -
    -
    - -
    - -
    -
    - {% endverbatim %} +

    Search

    {% endblock %} -{% block extrajs %} - - - - -{% endblock %} \ No newline at end of file +{% block extrajs %}{% endblock %} \ No newline at end of file diff --git a/easyCall/apps/user_interface/templates/user_interface/upload.html b/easyCall/apps/user_interface/templates/user_interface/upload.html deleted file mode 100644 index ef33d48..0000000 --- a/easyCall/apps/user_interface/templates/user_interface/upload.html +++ /dev/null @@ -1,116 +0,0 @@ -{% extends "base.html" %} -{% load staticfiles %} -{% load widget_tweaks %} - -{% block title %}Easy Call - Call{% endblock %} - -{% block globals %} -var userName = '{{user}}'; -{% endblock %} - -{% block nav %} -{% if 'Caller' in groups %}
  • Call
  • {% endif %} -{% if 'Inbound' in groups %}
  • Search
  • {% endif %} -{% if 'Admin' in groups %}
  • Admin
  • {% endif %} -{% endblock %} - -{% block nav-right %} -
  • Log out ({{user}})
  • -{% endblock%} - -{% block content %} -
    -
    - -
    - -
    - -
    -
    -
    -

    Upload new Call Records

    -
    -
    -
    - -
    -
    -
    - {% csrf_token %} - - {% if form.non_field_errors %} - {% for error in form.non_field_errors %} -
    -
    - {{ error|escape }} -
    -
    - {% endfor %} - {% endif %} - - {% if message %} -
    -
    - {{ message|escape }} -
    -
    - {% endif %} - - {% if form.list_type.errors %} -
    - - {% for error in form.list_type.errors %} -
    -
    - {{ error|escape }} -
    -
    - {% endfor %} - {% else %} -
    - - {% endif %} - {{ form.list_type|add_class:"form-control" }} -
    - - {% if form.file.errors %} -
    - - {% for error in form.file.errors %} -
    -
    - {{ error|escape }} -
    -
    - {% endfor %} - {% else %} -
    - - {% endif %} - {{ form.file|add_class:"form-control" }} -
    - -
    - -
    - - - -
    -
    -
    - -
    -
    -{% endblock %} - -{% block extrajs %}{% endblock %} \ No newline at end of file diff --git a/easyCall/apps/user_interface/urls.py b/easyCall/apps/user_interface/urls.py index d2802dd..8412fff 100644 --- a/easyCall/apps/user_interface/urls.py +++ b/easyCall/apps/user_interface/urls.py @@ -4,6 +4,5 @@ url(r'^$', 'easyCall.apps.user_interface.views.index', name='index'), url(r'^call/$', 'easyCall.apps.user_interface.views.call', name='call'), url(r'^search/$', 'easyCall.apps.user_interface.views.search', name='search'), - url(r'^ecadmin/upload$', 'easyCall.apps.user_interface.views.upload', name='upload'), - url(r'^ecadmin/queue$', 'easyCall.apps.user_interface.views.queue', name='queue'), + url(r'^ecadmin/$', 'easyCall.apps.user_interface.views.admin', name='admin'), ) \ No newline at end of file diff --git a/easyCall/apps/user_interface/views.py b/easyCall/apps/user_interface/views.py index 4ce3933..4bb2284 100644 --- a/easyCall/apps/user_interface/views.py +++ b/easyCall/apps/user_interface/views.py @@ -13,7 +13,7 @@ def index(request): groups = request.user.groups.values_list('name',flat=True) if ('Admin' in groups): - return redirect('ui:upload') + return redirect('ui:admin') elif ('Inbound' in groups): return redirect('ui:search') elif ('Caller' in groups): @@ -45,18 +45,7 @@ def search(request): @login_required -def queue(request): - groups = request.user.groups.values_list('name',flat=True) - if ('Admin' not in groups): - return redirect('logout') - context = { - 'groups': groups - } - return render(request, 'user_interface/queue.html', context) - - -@login_required -def upload(request): +def admin(request): groups = request.user.groups.values_list('name',flat=True) if ('Admin' not in groups): return redirect('logout') @@ -85,7 +74,7 @@ def upload(request): 'form': form, 'message': message, } - return render(request, 'user_interface/upload.html', context) + return render(request, 'user_interface/admin.html', context) def handle_uploaded_file(the_file, list_type, just_headings): diff --git a/package.json b/package.json index e9a5ba1..3f8c2c9 100644 --- a/package.json +++ b/package.json @@ -40,12 +40,10 @@ "static": "venv/bin/python manage.py collectstatic --noinput", - "open:stage": "heroku open --remote staging", - "open:prod": "heroku open --remote production", + "open:stage": "heroku open", "open:dev": "opener http://localhost:5000", - "deploy:stage": "git push staging develop:master", - "deploy:prod": "git push production master", + "deploy:stage": "git push heroku master", "dev": "npm run open:dev -s & parallelshell 'npm run serve -s' 'npm run watch -s'", "stage": "npm run deploy:stage -s & npm run open:stage -s", @@ -53,11 +51,10 @@ "db:migrate:make": "venv/bin/python manage.py makemigrations", "db:migrate:dev": "venv/bin/python manage.py migrate", - "db:migrate:stage": "heroku run --remote staging python manage.py migrate", - "db:migrate:prod": "heroku run --remote production python manage.py migrate", + "db:migrate:stage": "heroku run python manage.py migrate", "db:reset:dev": "rm -rf db.sqlite3", - "db:reset:stage": "heroku pg:reset --remote staging DATABASE_URL --confirm intense-island-9839", + "db:reset:stage": "heroku pg:reset DATABASE_URL --confirm intense-island-9839", "db:dumpdata:dev": "venv/bin/python manage.py dumpdata lists --indent=4 --natural-foreign > dump.json", "db:loaddata:dev": "venv/bin/python manage.py loaddata dump.json", "db:loadgroups:dev": "venv/bin/python manage.py loaddata groups.json" diff --git a/static/app/css/main.min.css b/static/app/css/main.min.css index 8114a8b..fabc2b9 100644 --- a/static/app/css/main.min.css +++ b/static/app/css/main.min.css @@ -1 +1 @@ -body{font-family:Helvetica,sans-serif}.login-body{padding-top:40px;padding-bottom:40px}.form-signin{max-width:330px;padding:15px;margin:0 auto}.form-signin .form-signin-heading{margin-bottom:10px}.form-signin .alert{margin-top:10px;margin-bottom:10px}.form-signin .form-control{position:relative;height:auto;padding:10px;font-size:16px}.form-signin .form-control:focus{z-index:2}.form-signin input[type="text"]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.form-signin input[type="password"]{margin-bottom:10px;border-top-right-radius:0;border-top-left-radius:0}.type-list{padding-top:20px;max-width:330px;margin:0 auto}.type-list .type-selection-heading{margin-bottom:40px}.type-list .btn{padding:10px;font-size:16px;margin-bottom:40px}.search-body .search-input{padding-top:30px}.search-body .results{padding-top:50px}.search-body .results .phone-numbers,.search-body .results .address,.search-body .results .status{padding-top:10px}.search-body .results .phone-numbers em,.search-body .results .address em,.search-body .results .status em{color:#8c8c8c;weight:bold;padding-right:10px}.search-body .results button{margin-top:-40px}.search-body .results .list-group-item-sub-heading{padding-right:15px}.search-body .results .no-results{color:#b3b3b3}h2{margin-top:0;color:#545454}h3.sub-heading{color:#b3b3b3}.title{font-size:90%;font-weight:bolder;color:#8c8c8c;text-transform:uppercase;text-align:right}.item-heading{display:inline-block;color:#8c8c8c;font-size:80%;font-weight:bolder;text-transform:uppercase;text-align:right;vertical-align:bottom}h4{color:#545454}.call-body .pane-left .call-demographics{margin-bottom:20px}.call-body .pane-left .call-demographics .name{font-size:130%;font-weight:bold;padding-bottom:10px;color:#545454}.call-body .pane-left .call-demographics .btn.edit{margin-right:17px}.call-body .pane-left .call-demographics .view-mode .title{padding-top:1px}.call-body .pane-left .call-demographics .view-mode .data{white-space:pre-line}.call-body .pane-left .call-demographics .view-mode .demo-set{padding-top:10px}.call-body .pane-left .call-results .input-group{padding-bottom:5px}.call-body .pane-left .call-results .buttons{padding-top:15px;margin-right:-5px;margin-left:-5px}.call-body .pane-left .call-results .buttons .col-xs-6,.call-body .pane-left .call-results .buttons .col-xs-4{padding-bottom:5px;padding-top:5px;padding-left:5px;padding-right:5px}.call-body .pane-right{height:100%}.call-body .pane-right .extra-block em{text-transform:uppercase}.call-body .pane-right .extra-block .row{padding-bottom:10px}.call-body .pane-right .list-group-item{border:0;padding:10px}.call-body .pane-right .list-group-item .note-text{white-space:pre-line}.call-body .pane-right .list-group-item .button-group{padding-left:25px;padding-right:0}.call-body .pane-right .list-group-item .row{padding-top:15px}.call-body .pane-right .panel-heading button{display:inline-box;float:right;margin-right:-5px} \ No newline at end of file +body{font-family:Helvetica,sans-serif}.login-body{padding-top:40px;padding-bottom:40px}.form-signin{max-width:330px;padding:15px;margin:0 auto}.form-signin .form-signin-heading{margin-bottom:10px}.form-signin .alert{margin-top:10px;margin-bottom:10px}.form-signin .form-control{position:relative;height:auto;padding:10px;font-size:16px}.form-signin .form-control:focus{z-index:2}.form-signin input[type="text"]{margin-bottom:-1px;border-bottom-right-radius:0;border-bottom-left-radius:0}.form-signin input[type="password"]{margin-bottom:10px;border-top-right-radius:0;border-top-left-radius:0}.type-list{padding-top:20px;max-width:330px;margin:0 auto}.type-list .type-selection-heading{margin-bottom:40px}.type-list .btn{padding:10px;font-size:16px;margin-bottom:40px}h2{margin-top:0;color:#545454}.title{font-size:90%;font-weight:bolder;color:#8c8c8c;text-transform:uppercase;text-align:right}.item-heading{display:inline-block;color:#8c8c8c;font-size:80%;font-weight:bolder;text-transform:uppercase;text-align:right;vertical-align:bottom}h4{color:#545454}.call-body .pane-left .call-demographics{margin-bottom:20px}.call-body .pane-left .call-demographics .name{font-size:130%;font-weight:bold;padding-bottom:10px;color:#545454}.call-body .pane-left .call-demographics .btn.edit{margin-right:17px}.call-body .pane-left .call-demographics .view-mode .title{padding-top:1px}.call-body .pane-left .call-demographics .view-mode .data{white-space:pre-line}.call-body .pane-left .call-demographics .view-mode .demo-set{padding-top:10px}.call-body .pane-left .call-results .input-group{padding-bottom:5px}.call-body .pane-left .call-results ul{padding-top:20px;list-style-type:none;padding-left:0}.call-body .pane-left .call-results ul li{display:inline-block}.call-body .pane-left .call-results .btn{margin-right:10px}.call-body .pane-right{height:100%}.call-body .pane-right .extra-block em{text-transform:uppercase}.call-body .pane-right .extra-block .row{padding-bottom:10px}.call-body .pane-right .list-group-item{border:0;padding:10px}.call-body .pane-right .list-group-item .note-text{white-space:pre-line}.call-body .pane-right .list-group-item .button-group{padding-left:25px;padding-right:0}.call-body .pane-right .list-group-item .row{padding-top:15px}.call-body .pane-right .panel-heading button{display:inline-box;float:right;margin-right:-5px} \ No newline at end of file diff --git a/static/app/js/call/app.js b/static/app/js/app.js similarity index 58% rename from static/app/js/call/app.js rename to static/app/js/app.js index 20582c3..3cc8885 100644 --- a/static/app/js/call/app.js +++ b/static/app/js/app.js @@ -10,17 +10,13 @@ ecApp.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/ready', { - templateUrl: djangoStatic + 'partials/call/ready.html', + templateUrl: djangoStatic + 'partials/ready.html', controller: 'readyCtrl' }). when('/call/:callCat', { - templateUrl: djangoStatic + 'partials/call/call.html', + templateUrl: djangoStatic + 'partials/call.html', controller: 'callCtrl' }). - when('/call/:callCat/empty', { - templateUrl: djangoStatic + 'partials/call/call_empty.html', - controller: 'callEmptyCtrl' - }). otherwise({ redirectTo: '/ready' }); diff --git a/static/app/js/call/controllers.js b/static/app/js/controllers.js similarity index 91% rename from static/app/js/call/controllers.js rename to static/app/js/controllers.js index ee2682e..a95c5d0 100644 --- a/static/app/js/call/controllers.js +++ b/static/app/js/controllers.js @@ -4,27 +4,19 @@ var ecAppControllers = angular.module('ecAppControllers', ['restangular']); ecAppControllers.controller('readyCtrl', - ['$scope', 'Restangular', - function($scope, Restangular) { + ['$scope', 'Restangular', '$q', + function($scope, Restangular, $q) { + 'use strict'; + Restangular.all('list_types/').getList().then(function(types) { $scope.types = types; }); }]); -ecAppControllers.controller('callEmptyCtrl', - ['$scope', '$routeParams', 'Restangular', - function($scope, $routeParams, Restangular) { - Restangular.one('list_types/' + $routeParams.callCat + '/').get().then( - function(callType) { - $scope.callType = callType; - }); - }]); - - ecAppControllers.controller('callCtrl', - ['$scope', '$routeParams', 'Restangular', '$q', '$window', - function($scope, $routeParams, Restangular, $q, $window) { + ['$scope', '$routeParams', 'Restangular', '$q', + function($scope, $routeParams, Restangular, $q) { 'use strict'; Restangular.one('list_types/' + $routeParams.callCat + '/').get().then( @@ -43,7 +35,6 @@ ecAppControllers.controller('callCtrl', }, function (response) { console.log("Error with status code", response.status); deferred.reject(); - $window.location.href = '#/call/' + $routeParams.callCat + '/empty'; }); return deferred.promise; diff --git a/static/app/js/call/directives.js b/static/app/js/directives.js similarity index 93% rename from static/app/js/call/directives.js rename to static/app/js/directives.js index a0ec661..34f7a93 100644 --- a/static/app/js/call/directives.js +++ b/static/app/js/directives.js @@ -230,26 +230,15 @@ ecAppDirectives.directive('ecResultSection', function() { }, template: '' + - '
    ' + - '
    ' + - ' ' + - '
    ' + - '
    ' + - '
    ' + - '
    ' + - ' Next' + - '
    ' + - '
    ' + - ' Break' + - '
    ' + - '
    ', + '
      ' + + '
    • ' + + ' ' + + '
    • ' + + '
    ', link: function (scope, element, attrs) { scope.submit = function(button) { - scope.updatefunc({'button': button.display_name, 'data': scope.call}); - }; - scope.next = function() { - scope.updatefunc({'button': 'Next', 'data': scope.call}); + scope.updatefunc({'button': button, 'data': scope.call}); }; } }; @@ -260,31 +249,13 @@ ecAppDirectives.directive('ecActionButton', function() { return { restrict: "A", scope: { - linkfunc: "&", - data: "=", + data: "&", + label: "@", }, template: '' + - '{{data.display_name}}' + - '', - - link: function (scope) { - scope.btnclass = function(cat) { - var base = "btn btn-block btn-md "; - if (cat === "gd") { - var result = base.concat("btn-success"); - } else if (cat === "bd") { - var result = base.concat("btn-danger"); - } else if (cat === "nt") { - var result = base.concat("btn-default"); - } else if (cat === "ic") { - var result = base.concat("btn-primary"); - } else { - var result = base; - }; - return result; - }; - } + 'class="btn btn-md btn-default" role="button" ng-click="data()">' + + '{{label}}' + + '' }; }); diff --git a/static/app/js/call/filters.js b/static/app/js/filters.js similarity index 100% rename from static/app/js/call/filters.js rename to static/app/js/filters.js diff --git a/static/app/js/queue/app.js b/static/app/js/queue/app.js deleted file mode 100644 index 42c1998..0000000 --- a/static/app/js/queue/app.js +++ /dev/null @@ -1,6 +0,0 @@ -var ecQueue = angular.module('ecQueue', [ - 'restangular', - 'ecQueueControllers', - 'ecQueueDirectives', - 'ecQueueServices', -]); \ No newline at end of file diff --git a/static/app/js/queue/controllers.js b/static/app/js/queue/controllers.js deleted file mode 100644 index 75bd02b..0000000 --- a/static/app/js/queue/controllers.js +++ /dev/null @@ -1,48 +0,0 @@ -/* 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(); - - }]); \ No newline at end of file diff --git a/static/app/js/queue/directives.js b/static/app/js/queue/directives.js deleted file mode 100644 index f9a6277..0000000 --- a/static/app/js/queue/directives.js +++ /dev/null @@ -1,31 +0,0 @@ -/* Directives */ - -var ecQueueDirectives = angular.module('ecQueueDirectives', []); - - -ecQueueDirectives.directive('ecReportRow', function() { - return { - restrict: "A", - scope: { - 'data': "=", - 'queuefunc': "&", - }, - template: - ' {{ data.display }}' + - ' {{ data.completed }}' + - ' {{ data.dequeued }}' + - ' {{ data.inprogress }}' + - ' {{ data.new }}' + - ' {{ data.queued }}' + - ' ' + - ' ' + - ' ', - - link: function (scope, element, attrs) { - scope.queue = function() { - scope.queuefunc({'list': scope.data}); - }; - } - }; -}); diff --git a/static/app/js/queue/services.js b/static/app/js/queue/services.js deleted file mode 100644 index cf18b68..0000000 --- a/static/app/js/queue/services.js +++ /dev/null @@ -1,42 +0,0 @@ -/* 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; - } - }; -}]); \ No newline at end of file diff --git a/static/app/js/search/app.js b/static/app/js/search/app.js deleted file mode 100644 index 4be3d86..0000000 --- a/static/app/js/search/app.js +++ /dev/null @@ -1,6 +0,0 @@ -var ecSearch = angular.module('ecSearch', [ - 'restangular', - 'ecSearchControllers', - 'ecSearchDirectives', - 'ecSearchServices', -]); \ No newline at end of file diff --git a/static/app/js/search/controllers.js b/static/app/js/search/controllers.js deleted file mode 100644 index ea8cbfe..0000000 --- a/static/app/js/search/controllers.js +++ /dev/null @@ -1,49 +0,0 @@ -/* Controllers */ - -var ecSearchControllers = angular.module('ecSearchControllers', []); - - -ecSearchControllers.controller('searchCtrl', - ['$scope', 'CallRecord', - function($scope, CallRecord) { - - var doSearch = function(searchstring) { - CallRecord.getList({'search': searchstring}).then( - function(call_records) { - $scope.data = call_records; - }); - }; - - $scope.dequeue = function(id) { - CallRecord.one(id).get().then( - function(rec) { - rec.status = 'dq'; - rec.put({}, {"X-CSRFToken": csrf_token}).then( - function (response) { - doSearch($scope.searchString); - }, function (response) { - console.log("Error with status code", response.status); - }); - }); - }; - - $scope.onChange = function() { - if ($scope.searchString.length > 2) { - doSearch($scope.searchString); - }; - }; - - $scope.$watch('data', function(newVal, oldVal){ - if (newVal) { - if (newVal.length < 1) { - $scope.noresults = true; - } else { - $scope.noresults = false; - }; - } else { - // First page load - $scope.noresults = true; - }; - }); - - }]); \ No newline at end of file diff --git a/static/app/js/search/directives.js b/static/app/js/search/directives.js deleted file mode 100644 index d5b79e5..0000000 --- a/static/app/js/search/directives.js +++ /dev/null @@ -1,121 +0,0 @@ -/* Directives */ - -var ecSearchDirectives = angular.module('ecSearchDirectives', []); - - -ecSearchDirectives.directive('ecSearchResult', function() { - return { - restrict: "E", - scope: { - data: "=", - dequeue: "&", - }, - template: - '
    ' + - '

    SN: {{ data.serial_number }}

    ' + - '

    ' + - ' {{ data.list_type_display }} {{ data.status_display }}' + - '

    ' + - '
    ' + - '

    {{ full_name }}

    ' + - '' + - '' + - '' + - '' + - '', - - link: function (scope, element, attrs) { - - var button = angular.element(element.find('button')); - if (scope.data.status !== "nw" && scope.data.status !== "ip") { - button.attr( "disabled", "disabled" ); - }; - - scope.handleclick = function() { - scope.dequeue({'id': scope.data.id}); - }; - - scope.labelClass = function() { - if (scope.data.status === "nw") { - return "label label-success"; - } else if (scope.data.status === "ip") { - return "label label-info"; - } else if (scope.data.status === "cp") { - return "label label-primary"; - } else { - return "label label-default"; - }; - }; - - function calcname() { - var name = ''; - if (scope.data.name_prefix) name = name + scope.data.name_prefix + ' '; - if (scope.data.name_first) name = name + scope.data.name_first + ' '; - if (scope.data.name_middle) name = name + scope.data.name_middle + ' '; - if (scope.data.name_family) name = name + scope.data.name_family + ' '; - if (scope.data.name_suffix) name = name + scope.data.name_suffix; - return name; - }; - - scope.full_name = calcname(); - } - }; -}); - - -ecSearchDirectives.directive('ecTelCompressed', function() { - return { - restrict: "E", - scope: { - 'day': "=", - 'evening': "=", - 'work': "=", - 'mobile': "=", - }, - template: - '

    ' + - ' (DAY){{ day }}' + - ' (EVE){{ evening }}' + - ' (WORK){{ work }}' + - ' (MOB){{ mobile }}' + - '

    ', - - link: function (scope, element, attrs) { - scope.spanclass = 'col-xs-10 col-sm-6 col-lg-4'; - } - }; -}); - - -ecSearchDirectives.directive('ecAddressCompressed', function() { - return { - restrict: "E", - scope: { - 'addr1': "=", - 'addr2': "=", - 'addr3': "=", - 'suburb': "=", - 'city': "=", - 'postcode': "=", - }, - template: - '
    ' + - '
      ' + - '
    • {{ addr1 }}
    • ' + - '
    • {{ addr2 }}
    • ' + - '
    • {{ addr3 }}
    • ' + - '
    • {{ suburb }}
    • ' + - '
    • ' + - ' {{ city }}' + - ' , {{ postcode }}' + - '
    • ' + - '
    ' + - '
    ' - }; -}); diff --git a/static/app/js/search/filters.js b/static/app/js/search/filters.js deleted file mode 100644 index 071b56d..0000000 --- a/static/app/js/search/filters.js +++ /dev/null @@ -1,3 +0,0 @@ -/* Filters */ - -var ecASearchFilters = angular.module('ecASearchFilters', []); \ No newline at end of file diff --git a/static/app/js/search/services.js b/static/app/js/search/services.js deleted file mode 100644 index f4504c0..0000000 --- a/static/app/js/search/services.js +++ /dev/null @@ -1,11 +0,0 @@ -/* Services */ - -var ecSearchServices = angular.module('ecSearchServices', ['restangular']); - - -ecSearchServices.factory('CallRecord', - ['Restangular', - function(Restangular) { - return Restangular.service('call_records'); -}]); - diff --git a/static/app/partials/call/call.html b/static/app/partials/call.html similarity index 100% rename from static/app/partials/call/call.html rename to static/app/partials/call.html diff --git a/static/app/partials/call/call_empty.html b/static/app/partials/call/call_empty.html deleted file mode 100644 index 1d7e42e..0000000 --- a/static/app/partials/call/call_empty.html +++ /dev/null @@ -1,10 +0,0 @@ -
    - -

    There are no more records of type:
    - '{{callType.display_name}}'.

    - -

    Please try another List Type or talk to your supervisor.

    - - Return - -
    \ No newline at end of file diff --git a/static/app/partials/call/ready.html b/static/app/partials/ready.html similarity index 100% rename from static/app/partials/call/ready.html rename to static/app/partials/ready.html