diff --git a/src/static/js/app.js b/src/static/js/app.js index df66240..9b79300 100755 --- a/src/static/js/app.js +++ b/src/static/js/app.js @@ -65,10 +65,6 @@ app.config(function($routeProvider){ templateUrl : "/static/partials/edit-nc.html", controller : "edit-nc" }) - .when("/manage-workshops", { - templateUrl : "/static/partials/manage-workshops.html", - controller : "manage-workshops" - }) .when("/contact-oc", { templateUrl : "/static/partials/contact-oc.html", controller : "contact-oc" @@ -81,11 +77,15 @@ app.config(function($routeProvider){ templateUrl : "/static/partials/nodal-centres.html", controller : "nodal-centers" }) - .when("/add-workshop", { + .when("/manage-workshops", { + templateUrl : "/static/partials/upcoming-workshops.html", + controller : "manage-workshops" + }) + .when("/manage-workshops/add-workshop", { templateUrl : "/static/partials/add-workshop.html", controller : "add-workshop" }) - .when("/oc-manage-workshops/pending-workshops",{ + .when("/manage-workshops/pending-workshops",{ templateUrl: "/static/partials/pending-workshops.html", controller : "pending-workshops" }) @@ -97,6 +97,10 @@ app.config(function($routeProvider){ templateUrl : "/static/partials/edit-workshop.html", controller : "edit-workshop" }) + .when("/oc-manage-workshops/oc-pending-workshops",{ + templateUrl: "/static/partials/oc-pending-workshops.html", + controller : "pending-workshops" + }) .when("/upload-reports/:id", { templateUrl : "/static/partials/upload-reports.html", controller : "upload-reports" @@ -130,8 +134,12 @@ app.config(function($routeProvider){ controller : "edit-centre" }) .when("/oc-manage-workshops", { - templateUrl : "/static/partials/oc-manage-workshops.html", - controller : "oc-manage-workshops" + templateUrl : "/static/partials/oc-upcoming-workshops.html", + controller : "manage-workshops" + }) + .when("/oc-manage-workshops/oc-add-workshop", { + templateUrl : "/static/partials/add-workshop.html", + controller : "add-workshop" }) .when("/oc-documents", { templateUrl : "/static/partials/oc-docs.html", diff --git a/src/static/js/controllers.js b/src/static/js/controllers.js index 57d3b9a..1e80ecd 100755 --- a/src/static/js/controllers.js +++ b/src/static/js/controllers.js @@ -249,7 +249,7 @@ app.controller("workshop", function($scope, dataFactory, $http, $routeParams, $l { field: 'version' }, { field: 'date'}, { field: 'participants_attended'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} ], enableGridMenu: true, @@ -313,7 +313,7 @@ app.controller("admin-workshop", function($scope, dataFactory, $http, $routePara { field: 'experiments_conducted', displayName: 'Usage' }, { field: 'date'}, { field: 'participants_attended'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, @@ -408,7 +408,7 @@ app.controller("nc-ctrl", function($scope, $http, $routeParams, dataFactory,$rou columnDefs: [ { field: 'institute', displayName: 'Institute', sort: { direction: uiGridConstants.ASC, priority: 1 }}, { field: 'total_ncs', displayName: 'Total Nodal Coordinators', enableFiltering:false}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} ], enableGridMenu: true, @@ -474,7 +474,7 @@ app.controller("admin-ctrl", function($scope, dataFactory, $http, $routeParams, { field: 'institute_name',displayName:'Institute Name' }, { field: 'last_active', displayName:'Last Active'}, { field: 'created', displayName:'Created On'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -821,9 +821,9 @@ app.controller("workshop-history", function($scope, $http, $routeParams, dataFac { field: 'participants_attended' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, + { field: 'status.name', displayName:'Status', width:170}, { field: 'experiments_conducted', displayName:'Usage'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} ], enableGridMenu: true, @@ -913,9 +913,9 @@ app.controller("pending-workshops", function($scope, $http, $routeParams, dataFa { field: 'participants_attended' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, + { field: 'status.name', displayName:'Status', width:170}, { field: 'experiments_conducted', displayName:'Usage'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', width:250, cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -991,9 +991,9 @@ app.controller("manage-workshops", function($scope, $http, $routeParams, dataFac { field: 'participants_attended' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, + { field: 'status.name', displayName:'Status', width:170}, { field: 'experiments_conducted', displayName:'Usage'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -1361,11 +1361,11 @@ app.controller("edit-workshop", function($scope, dataFactory, $http, $routeParam var status_id = $scope.message.status.id; if((today > workshopDate) & !(today.toDateString() == workshopDate.toDateString())){ if($scope.message.user.role.id == 2 & $scope.photos.length != 0){ - console.log("========================"); - console.log($scope.photos.length); status_id = 3; } - else{status_id=2;} + else if($scope.message.user.role.id == 3 & $scope.photos.length != 0){ + status_id=2; + } }else{ status_id = 1; } @@ -1386,9 +1386,8 @@ app.controller("edit-workshop", function($scope, dataFactory, $http, $routeParam "status" : {"id": status_id}, "date" : $scope.message.date, "experiments_conducted": $scope.message.experiments_conducted}). success(function(data, status, headers, config){ - $scope.status = "Success"; - window.location.href = "#/oc-manage-workshops/oc-workshop-history"; - // history.back(); + $scope.status = "Success"; + history.back(); }). error(function(data, status, headers, config){ if(status == 500){ @@ -1490,7 +1489,7 @@ app.controller("manage-nc", function($scope, $http, $routeParams, dataFactory, $ { field: 'phone' }, { field: 'user_status'}, { field: 'last_active', displayName:'Last Active'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -1729,7 +1728,7 @@ app.controller("manage-centres", function($scope, $http, dataFactory, $routePara { field: 'location' }, { field: 'pincode' }, { field: 'centre_status', displayName:'Status'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -1925,8 +1924,8 @@ app.controller("oc-manage-workshops", function($scope, $http, $routeParams, data { field: 'no_of_participants_expected' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + { field: 'status.name', displayName:'Status', width:122}, + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -2052,8 +2051,8 @@ app.controller("nc-workshops", function($scope, $http, $routeParams, dataFactory { field: 'not_approval_reason' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', cellTemplate: ''} + { field: 'status.name', displayName:'Status', width:122}, + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -2181,9 +2180,9 @@ app.controller("oc-workshop-history", function($scope, $http, $routeParams, data { field: 'participants_attended' }, { field: 'date'}, { field: 'workshop_status', displayName:'Workshop Status'}, - { field: 'status.name', displayName:'Status'}, + { field: 'status.name', displayName:'Status', width:122}, { field: 'experiments_conducted', displayName:'Usage', sort:'asc'}, - {name: 'actions', enableFiltering: false, displayName: 'Actions', width:200, cellTemplate: ''} + {name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: ''} ], enableGridMenu: true, enableSelectAll: true, @@ -2270,7 +2269,18 @@ app.controller("upload-reports", function($scope, $http, $routeParams, dataFacto $scope.photos = photos; $scope.attendance = attendance; $scope.reports = reports; -// if($scope.photos.length !== 0 || $scope.attendance.length !== 0 || $scope.reports.length !== 0){ + // if($scope.message.user.role.id == 3 & $scope.photos.length != 0){ + // status_id=2; + // } + // if($scope.message.user.role.id == 2 & $scope.photos.length != 0){ + // status_id = 3; + // } + // else if($scope.message.user.role.id == 3 & $scope.photos.length != 0){ + // status_id=2; + // } + +}); + // if($scope.photos.length !== 0 || $scope.attendance.length !== 0 || $scope.reports.length !== 0){ // dataFactory.fetch('/workshops/'+$routeParams.id). // success(function(data, status, headers, config){ // $scope.message= data; @@ -2287,7 +2297,7 @@ app.controller("upload-reports", function($scope, $http, $routeParams, dataFacto // {'status': {'id': $scope.status_id}}).success(function(data, status){ // console.log('Status success'); // }); -}); + app.controller("ws_details", function($scope, $http, $routeParams, dataFactory, $route, $window){ dataFactory.fetch("/workshops?version=online&status_id=3").success(function(data,status,headers,config){ diff --git a/src/static/partials/add-workshop.html b/src/static/partials/add-workshop.html index 6d5271c..b492342 100755 --- a/src/static/partials/add-workshop.html +++ b/src/static/partials/add-workshop.html @@ -164,8 +164,8 @@

- - + +
diff --git a/src/static/partials/edit-workshop.html b/src/static/partials/edit-workshop.html index c8bba25..3c53e0b 100755 --- a/src/static/partials/edit-workshop.html +++ b/src/static/partials/edit-workshop.html @@ -1,9 +1,6 @@
- - - Edit Workshop Details {{ status }} diff --git a/src/static/partials/manage-workshops.html b/src/static/partials/manage-workshops.html index 8d55d7c..01d9ae4 100755 --- a/src/static/partials/manage-workshops.html +++ b/src/static/partials/manage-workshops.html @@ -1,6 +1,6 @@