forked from sitcomlab/Ethics-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,940 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
cd /path/to/temp/doc | ||
cd public/files/temp/ | ||
|
||
for i in 1 2 3 4 5 6 7 | ||
do | ||
|
201 changes: 201 additions & 0 deletions
201
public/user-client/js/controllers/document/_showSubmissionController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
var app = angular.module("ethics-app"); | ||
|
||
|
||
// Document submission controller | ||
app.controller("documentShowSubmissionController", function($scope, $rootScope, $routeParams, $translate, $location, config, $window, $authenticationService, $documentService) { | ||
|
||
/************************************************* | ||
FUNCTIONS | ||
*************************************************/ | ||
|
||
/** | ||
* [redirect description] | ||
* @param {[type]} path [description] | ||
* @return {[type]} [description] | ||
*/ | ||
$scope.redirect = function(path){ | ||
$location.url(path); | ||
}; | ||
|
||
/** | ||
* [cancel description] | ||
* @return {[type]} [description] | ||
*/ | ||
$scope.cancel = function(){ | ||
$scope.redirect("/documents/" + $documentService.getId() + "/status/" + $documentService.getStatus()); | ||
}; | ||
|
||
/** | ||
* [toggleConcernHistory description] | ||
* @param {[type]} language [description] | ||
* @return {[type]} [description] | ||
*/ | ||
$scope.toggle = function(category, property, language){ | ||
switch (category) { | ||
case 'general': { | ||
switch (property){ | ||
case 'display': { | ||
$scope.status.general.display = !$scope.status.general.display; | ||
break; | ||
} | ||
case 'history': { | ||
$scope.status.general.history = !$scope.status.general.history; | ||
if($scope.status.general.history){ | ||
$scope.status.general.limit = $scope.document.revisions.length; | ||
} else { | ||
$scope.status.general.limit = 1; | ||
} | ||
break; | ||
} | ||
} | ||
break; | ||
} | ||
case 'descriptions': { | ||
switch (property) { | ||
case 'language': { | ||
switch (language) { | ||
case 'en': { | ||
$scope.status.descriptions.language.en = !$scope.status.descriptions.language.en; | ||
break; | ||
} | ||
case 'de': { | ||
$scope.status.descriptions.language.de = !$scope.status.descriptions.language.de; | ||
break; | ||
} | ||
case 'pt': { | ||
$scope.status.descriptions.language.pt = !$scope.status.descriptions.language.pt; | ||
break; | ||
} | ||
} | ||
break; | ||
} | ||
case 'history': { | ||
switch (language) { | ||
case 'en': { | ||
$scope.status.descriptions.history.en.display = !$scope.status.descriptions.history.en.display; | ||
|
||
if($scope.status.descriptions.history.en.display){ | ||
$scope.status.descriptions.history.en.limit = $scope.document.revisions.length; | ||
} else { | ||
$scope.status.descriptions.history.en.limit = 1; | ||
} | ||
break; | ||
} | ||
case 'de': { | ||
$scope.status.descriptions.history.de.display = !$scope.status.descriptions.history.de.display; | ||
|
||
if($scope.status.descriptions.history.de.display){ | ||
$scope.status.descriptions.history.de.limit = $scope.document.revisions.length; | ||
} else { | ||
$scope.status.descriptions.history.de.limit = 1; | ||
} | ||
break; | ||
} | ||
case 'pt': { | ||
$scope.status.descriptions.history.pt.display = !$scope.status.descriptions.history.pt.display; | ||
|
||
if($scope.status.descriptions.history.pt.display){ | ||
$scope.status.descriptions.history.pt.limit = $scope.document.revisions.length; | ||
} else { | ||
$scope.status.descriptions.history.pt.limit = 1; | ||
} | ||
break; | ||
} | ||
} | ||
break; | ||
} | ||
case 'comments': { | ||
switch (language) { | ||
case 'en': { | ||
$scope.status.descriptions.comments.en = !$scope.status.descriptions.comments.en; | ||
break; | ||
} | ||
case 'de': { | ||
$scope.status.descriptions.comments.de = !$scope.status.descriptions.comments.de; | ||
break; | ||
} | ||
case 'pt': { | ||
$scope.status.descriptions.comments.pt = !$scope.status.descriptions.comments.pt; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
break; | ||
} | ||
case 'concerns': { | ||
switch (property) { | ||
case 'display': { | ||
$scope.status.concerns.display = !$scope.status.concerns.display; | ||
break; | ||
} | ||
case 'history': { | ||
$scope.status.concerns.history = !$scope.status.concerns.history; | ||
|
||
if($scope.status.concerns.history){ | ||
$scope.status.concerns.limit = $scope.document.revisions.length; | ||
} else { | ||
$scope.status.concerns.limit = 1; | ||
} | ||
|
||
break; | ||
} | ||
case 'comments': { | ||
$scope.status.concerns.comments = !$scope.status.concerns.comments; | ||
break; | ||
} | ||
} | ||
break; | ||
} | ||
} | ||
}; | ||
|
||
/************************************************* | ||
INIT | ||
*************************************************/ | ||
$scope.$parent.loading = { status: true, message: "Loading submission" }; | ||
$scope.document = $documentService.get(); | ||
$scope.latest_revision = $documentService.getLatestRevision(); | ||
|
||
// Show/hide comments and history | ||
$scope.status = { | ||
general: { | ||
display: true, | ||
history: false, | ||
limit: 1 | ||
}, | ||
descriptions: { | ||
language: { | ||
en: true, | ||
de: $scope.latest_revision.descriptions.de_used, | ||
pt: $scope.latest_revision.descriptions.pt_used | ||
}, | ||
history: { | ||
en: { | ||
display: false, | ||
limit: 1 | ||
}, | ||
de: { | ||
display: false, | ||
limit: 1 | ||
}, | ||
pt: { | ||
display: false, | ||
limit: 1 | ||
} | ||
}, | ||
comments: { | ||
en: true, | ||
de: $scope.latest_revision.descriptions.de_used, | ||
pt: $scope.latest_revision.descriptions.pt_used | ||
} | ||
}, | ||
concerns: { | ||
display: true, | ||
history: false, | ||
limit: 1, | ||
comments: true | ||
} | ||
}; | ||
$scope.$parent.loading = { status: false, message: "" }; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.