Skip to content
Snippets Groups Projects
Commit ac7f171a authored by jaden's avatar jaden
Browse files

removed last of reportController code, make it the bootstrapper, #41

parent f94e1dc9
No related branches found
No related tags found
1 merge request!223Reports overhaul
......@@ -21,33 +21,7 @@
*/
/* reportController
*
* This controller retrieves data from the reportFactory/experimentFactory through the REST API and associates it with the $scope.
* The $scope is ultimately bound to the report view.
*
* This controller is "deprecated" - it needs to be completely removed, and should not be expanded/built upon.
* bootstraps the reports angular code by requiring the ReportService.
* NOTE: DONT add any code to this controller.
*/
angular.module('reportApp').controller('reportController',['$scope', 'reportFactory', 'ReportService', function ($scope, reportFactory, ReportService){
$scope.user;
$scope.report_id;
$scope.url_prefix;
$scope.reportFactory = reportFactory;
$scope.report = {};
$scope.report_experiments = {};
$scope.num_report_items = 0;
$scope.max_num = 0;
$scope.item_content = [];
$scope.table_item_content = [];
$scope.selectedObject = {};
$scope.init = function(user, report_id, url_prefix){
$scope.user = user;
$scope.report_id = report_id;
$scope.url_prefix = url_prefix;
};
$scope.initWithReportNumber = function(report_number, url_prefix){
$scope.report_number = report_number;
$scope.url_prefix = url_prefix;
};
}]);
angular.module('reportApp').controller('reportController',['ReportService', function (ReportService){}]);
......@@ -140,10 +140,7 @@
{% block content %}
<div ng-app="reportApp" ng-controller="reportController"
{% if author and not report_number %}ng-init="init('{{ author }}', '{{report_name}}', '{{ URL_PREFIX }}')"{% endif %}
{% if report_number and not author %}ng-init="initWithReportNumber('{{report_number}}', '{{ URL_PREFIX }}')"{% endif %}
>
<div ng-app="reportApp" ng-controller="reportController">
{% csrf_token %}
{% if report %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment