Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/vlead/outreach-portal in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
madhavipuliraju committed Dec 28, 2019
2 parents 8208091 + cf85b43 commit e3e86ec
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 243 deletions.
24 changes: 16 additions & 8 deletions src/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
})
Expand All @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
62 changes: 36 additions & 26 deletions src/static/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '<button id="editBtn" type="button" class="btn btn-small \
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="editBtn" type="button" class="btn btn-small \
btn-primary" ng-click="grid.appScope.view(row.entity)" >View</button>'}
],
enableGridMenu: true,
Expand Down Expand Up @@ -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: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.viewReports(row.entity)"><i class="fa fa-eye"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.viewReports(row.entity)"><i class="fa fa-eye"></i></button>'}

],
enableGridMenu: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn btn-small \
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn btn-small \
btn-primary" ng-click="grid.appScope.viewNC(row.entity)">View</button>'}
],
enableGridMenu: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editOC(row.entity)"><i class="fa fa-edit"></i></button><button id="deleteBtn" type="button" class="btn btn-small btn-danger" ng-click="grid.appScope.deleteOC(row.entity)"><i class="fa fa-trash"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editOC(row.entity)"><i class="fa fa-edit"></i></button><button id="deleteBtn" type="button" class="btn btn-small btn-danger" ng-click="grid.appScope.deleteOC(row.entity)"><i class="fa fa-trash"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="uploadBtn" style="width\
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="uploadBtn" style="width\
:33px;" type="button" class="btn" ng-click="grid.appScope.uploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
],
enableGridMenu: true,
Expand Down Expand Up @@ -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: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.uploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.uploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.view(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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;
}
Expand All @@ -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){
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editNodalCoordinator(row.entity)"><i class="fa fa-edit"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editNodalCoordinator(row.entity)"><i class="fa fa-edit"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editCentre(row.entity)"><i class="fa fa-edit"></i></button><button id="deleteBtn" type="button" class="btn" ng-click="grid.appScope.del_centre(row.entity)"><i class="fa fa-trash"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.editCentre(row.entity)"><i class="fa fa-edit"></i></button><button id="deleteBtn" type="button" class="btn" ng-click="grid.appScope.del_centre(row.entity)"><i class="fa fa-trash"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.ocUploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
{ field: 'status.name', displayName:'Status', width:122},
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.ocUploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.reviewReports(row.entity)"><i class="fa fa-eye"></button>'}
{ field: 'status.name', displayName:'Status', width:122},
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.reviewReports(row.entity)"><i class="fa fa-eye"></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.viewReports(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="uploadBtn" type="button" class="btn" ng-click="grid.appScope.uploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
{name: 'actions', enableFiltering: false, displayName: 'Actions', width:122, cellTemplate: '<button id="viewBtn" type="button" class="btn" ng-click="grid.appScope.viewReports(row.entity)"><i class="fa fa-eye"></i></button><button id="editBtn" type="button" class="btn" ng-click="grid.appScope.editWorkshop(row.entity)"><i class="fa fa-edit"></i></button><button id="uploadBtn" type="button" class="btn" ng-click="grid.appScope.uploadReports(row.entity)"><i class="fa fa-upload"></i></button>'}
],
enableGridMenu: true,
enableSelectAll: true,
Expand Down Expand Up @@ -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;
Expand All @@ -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){
Expand Down
4 changes: 2 additions & 2 deletions src/static/partials/add-workshop.html
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@
<br><br>
<div class="col-md-4"></div>
<div class="col-md-4">
<input type="submit" value="Submit" class="btn btn-primary" ng-disabled="myForm.$invalid">
<a href="#/manage-workshops"><input type="submit" value="Cancel" class="btn btn-primary"></a>
<input type="submit" value="Submit" class="btn btn-primary" ng-disabled="myForm.$invalid">
<!-- <a href="#/manage-workshops"><input type="submit" value="Cancel" class="btn btn-primary"></a> -->
<!-- <input type="submit" value="submit" class="btn btn-primary" ng-disabled="myForm.$invalid">&emsp;&emsp;&emsp;<a href="#/manage-workshops">Cancel</a> -->
</div>
</fieldset>
Expand Down
3 changes: 0 additions & 3 deletions src/static/partials/edit-workshop.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<form class="well form-horizontal" name="myForm" novalidate ng-submit="submit(myForm.$valid)">
<!-- <button style="align:right;" onclick="goBack()">Go Back</button> -->
<fieldset>
<!-- <div class="text-right"> -->
<!-- <a align="right" href="#/manage-workshops/workshop-history">Go Back</a> -->
<!-- </div> -->
<legend>Edit Workshop Details </legend>

<span class="error"> {{ status }}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/static/partials/manage-workshops.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#manage-workshops">Upcoming Workshops</a></li>
<li><a style="color:#ffffff;" data-toggle="tab" href="#manage-workshops/pending-action">Pending Action Workshops</a></li>
<li><a style="color:#ffffff;" data-toggle="tab" href="#manage-workshops/pending-workshops">Pending Workshops</a></li>
<li><a style="color:#ffffff;" data-toggle="tab" href="#manage-workshops/workshop-history">Workshop History</a></li>
<li><a style="color:#ffffff;" data-toggle="tab" href="#/add-workshop" role="button">ADD WORKSHOP</a></li>
<!-- <li> <input placeholder="search workshop" type = "text" ng-model = "workshopName"></li> -->
Expand Down
Loading

0 comments on commit e3e86ec

Please sign in to comment.