Skip to content

Commit

Permalink
Approve button on details screen
Browse files Browse the repository at this point in the history
  • Loading branch information
donker committed May 9, 2017
1 parent 37a280a commit dcc65f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Binary file modified Controllers/Projects/ProjectsController_Services.vb
Binary file not shown.
1 change: 1 addition & 0 deletions Views/Partials/ProjectDetails.vbhtml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<a href="#/Projects" class="btn btn-default dnnSecondaryAction">@Html.GetLocalizedString("Return")</a>
<a href="#/Project/Edit/{{projectId}}" class="dnnSecondaryAction" data-ng-if="security.moderator == true || project.CreatedByUserID == @Dnn.User.UserID">@Html.GetLocalizedString("Edit")</a>
<a href="@(GetModuleUrl("API/Projects/Pdf"))/{{projectId}}[email protected]&[email protected]" class="dnnSecondaryAction">PDF</a>
<a href="#/Project/{{projectId}}" data-ng-if="project.Visible == false && security.moderator == true" data-ng-click="approveProject(projectId)" class="dnnSecondaryAction">@Html.GetLocalizedString("Approve")</a>

<div class="cp_audit">
{{'@Html.GetLocalizedString("Audit")' | stringFormat:[project. CreatedByUser, dateFormat(project.CreatedOnDate, 'short'), project.LastModifiedByUser, dateFormat(project.LastModifiedOnDate, 'short')]}}
Expand Down
8 changes: 8 additions & 0 deletions js/connect.projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ mod.factory('projectsFactory', [function () {
}
dataCall(moduleId, 'Projects', 'Project', { id: projectId }, success, fail);
},
approveProject: function (moduleId, projectId, success, fail) {
apiPostCall(moduleId, 'Projects', 'ApproveProject', projectId, { }, success, fail);
},
updateProject: function (moduleId, project, success, fail) {
apiPostCall(moduleId, 'Projects', 'Put', null, {
project: JSON.stringify(project)
Expand Down Expand Up @@ -241,6 +244,11 @@ mod.controller('ProjectDetailCtrl', ['$scope', '$filter', '$routeParams', 'proje
});
};
};
$scope.approveProject = function (projectId) {
projectsFactory.approveProject($scope.moduleId, $scope.projectId, function (data) {
window.location.reload();
});
};
$scope.selection = [];
$scope.$watch('project.ProjectTypes|filter:{IsSelected:true}', function (nv) {
$scope.selection = nv.map(function (pt) {
Expand Down

0 comments on commit dcc65f2

Please sign in to comment.