Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #9 from thesedateone/revert-8-feature/manual_queuing
Browse files Browse the repository at this point in the history
Revert "Feature/manual queuing"
  • Loading branch information
jacquesbeukes committed Mar 25, 2015
2 parents 5e7af83 + 5cde3e6 commit 08aa929
Show file tree
Hide file tree
Showing 62 changed files with 214 additions and 1,445 deletions.
8 changes: 2 additions & 6 deletions assets/js/call/app.js → assets/js/app.js
Expand Up @@ -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'
});
Expand Down
21 changes: 6 additions & 15 deletions assets/js/call/controllers.js → assets/js/controllers.js
Expand Up @@ -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(
Expand All @@ -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;
Expand Down
51 changes: 11 additions & 40 deletions assets/js/call/directives.js → assets/js/directives.js
Expand Up @@ -230,26 +230,15 @@ ecAppDirectives.directive('ecResultSection', function() {
},
template:
'<ec-result-input-list call="call"></ec-result-input-list>' +
'<div class="row buttons">' +
' <div class="col-xs-4" ng-repeat="button in buttons">' +
' <a ec-action-button linkfunc="submit(button)" data="button"></a>' +
' </div> ' +
'</div>' +
'<div class="row buttons">' +
' <div class="col-xs-6">' +
' <a class="btn btn-block btn-primary" ng-click="next()" role="button">Next</a>' +
' </div>' +
' <div class="col-xs-6">' +
' <a class="btn btn-block btn-primary" href="#/ready" role="button">Break</a>' +
' </div>' +
'</div>',
'<ul>' +
' <li ng-repeat="button in buttons">' +
' <a ec-action-button data="submit(button)" label="{{button}}"></a>' +
' </li> ' +
'</ul>',

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});
};
}
};
Expand All @@ -260,31 +249,13 @@ ecAppDirectives.directive('ecActionButton', function() {
return {
restrict: "A",
scope: {
linkfunc: "&",
data: "=",
data: "&",
label: "@",
},
template: '<a ' +
'ng-class="btnclass(data.category)" role="button" ng-click="linkfunc()">' +
'{{data.display_name}}' +
'</a>',

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}}' +
'</a>'
};
});

Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions assets/js/queue/app.js

This file was deleted.

48 changes: 0 additions & 48 deletions assets/js/queue/controllers.js

This file was deleted.

31 changes: 0 additions & 31 deletions assets/js/queue/directives.js

This file was deleted.

42 changes: 0 additions & 42 deletions assets/js/queue/services.js

This file was deleted.

6 changes: 0 additions & 6 deletions assets/js/search/app.js

This file was deleted.

49 changes: 0 additions & 49 deletions assets/js/search/controllers.js

This file was deleted.

0 comments on commit 08aa929

Please sign in to comment.