diff --git a/controllers/documents/change_status.js b/controllers/documents/change_status.js index 2881524..2953ba4 100644 --- a/controllers/documents/change_status.js +++ b/controllers/documents/change_status.js @@ -61,7 +61,7 @@ exports.request = function(req, res) { } else { if(decoded.member || req.body.status == 1){ callback(null, client, done); - } else { + } else { callback(new Error("Authorization failed"), 401); } } @@ -340,6 +340,14 @@ exports.request = function(req, res) { var status_description_2 = ""; switch (updated_document.status) { + case 1: { + icon = "fa-pencil-square-o"; + status_description_1 = "You reverted your document and can now modify it. Please note that a reverted document has to be submitted and approved again."; + status_description_2 = "If you have problems with your document, please get in touch with a committee member of your institute."; + updated_document._status_label = "badge-info"; + updated_document._status_description = "unsubmitted"; + break; + } case 4: { icon = "fa-eye"; status_description_1 = "Your document is under review now. You will get another email as soon as the Ethics-committee has reviewed it completely."; diff --git a/controllers/documents/get_v2.js b/controllers/documents/get_v2.js new file mode 100644 index 0000000..f28f1a5 --- /dev/null +++ b/controllers/documents/get_v2.js @@ -0,0 +1,416 @@ +var async = require('async'); +var colors = require('colors'); +var pg = require('pg'); +var types = require('pg').types; +types.setTypeParser(1700, 'text', parseFloat); +var _ = require('underscore'); +var jsdiff = require('diff'); +var jwt = require('jsonwebtoken'); +var pool = require('../../server.js').pool; + +var fs = require("fs"); +var dir_1 = "/../../sql/queries/documents/"; +var dir_2 = "/../../sql/queries/courses/"; +var dir_3 = "/../../sql/queries/revisions/"; +var dir_4 = "/../../sql/queries/descriptions/"; +var dir_5 = "/../../sql/queries/concerns/"; +var dir_6 = "/../../sql/queries/comments/"; +var dir_7 = "/../../sql/queries/reviewers/"; + +var query_get_document = fs.readFileSync(__dirname + dir_1 + 'get.sql', 'utf8').toString(); +var query_get_document_with_user = fs.readFileSync(__dirname + dir_1 + 'get_with_user.sql', 'utf8').toString(); +var query_get_course_by_document = fs.readFileSync(__dirname + dir_2 + 'get_by_document.sql', 'utf8').toString(); +var query_list_revisions_by_document = fs.readFileSync(__dirname + dir_3 + 'list_by_document.sql', 'utf8').toString(); +var query_get_descriptions_by_revision = fs.readFileSync(__dirname + dir_4 + 'get_by_revision.sql', 'utf8').toString(); +var query_get_concerns_by_revision = fs.readFileSync(__dirname + dir_5 + 'get_by_revision.sql', 'utf8').toString(); +var query_get_comments_by_revision = fs.readFileSync(__dirname + dir_6 + 'get_by_revision.sql', 'utf8').toString(); +var query_get_reviewer_by_revision = fs.readFileSync(__dirname + dir_7 + 'get_by_revision.sql', 'utf8').toString(); + + +// GET v2 +exports.request = function(req, res) { + + async.waterfall([ + function(callback){ + // Connect to database + pool.connect(function(err, client, done) { + if(err) { + callback(err, 500); + } else { + callback(null, client, done); + } + }); + }, + function(client, done, callback) { + // Authorization + if(req.headers.authorization) { + var token = req.headers.authorization.substring(7); + + // Verify token + jwt.verify(token, process.env.JWTSECRET, function(err, decoded) { + if(err){ + callback(new Error("Authorization failed"), 401); + } else { + if(decoded.member){ + callback(null, client, done, query_get_document_with_user); + } else { + callback(null, client, done, query_get_document); + } + } + }); + } else { + callback(new Error("Authorization failed"), 401); + } + }, + function(client, done, query, callback) { + // Database query + client.query(query, [ + req.params.document_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + // Check if Document exists + if (result.rows.length === 0) { + callback(new Error("Document not found"), 404); + } else { + callback(null, client, done, result.rows[0]); + } + } + }); + }, + function(client, done, document, callback) { + // Database query + client.query(query_get_course_by_document, [ + req.params.document_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + // Check if Course exists + if (result.rows.length === 0) { + document = _.extend(document, { + affiliation_id: null, + course_id: null + }); + } else { + document = _.extend(document, result.rows[0]); + } + callback(null, client, done, document); + } + }); + }, + function(client, done, document, callback) { + // Database query + client.query(query_list_revisions_by_document, [ + req.params.document_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + document.revisions = result.rows; + callback(null, client, done, document); + } + }); + }, + function(client, done, document, callback) { + async.eachOfSeries(document.revisions, function (revision, key, callback) { + async.parallel([ + function(callback){ + // Database query + client.query(query_get_descriptions_by_revision, [ + revision.revision_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + revision.descriptions = result.rows[0]; + callback(null); + } + }); + }, + function(callback){ + // Database query + client.query(query_get_concerns_by_revision, [ + revision.revision_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + revision.concerns = result.rows[0]; + callback(null); + } + }); + }, + function(callback){ + // Database query + client.query(query_get_comments_by_revision, [ + revision.revision_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + revision.comments = result.rows[0]; + callback(null); + } + }); + }, + function(callback){ + // Database query + client.query(query_get_reviewer_by_revision, [ + revision.revision_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + revision.reviewer = result.rows.length > 0 ? result.rows[0]: null; + callback(null); + } + }); + } + ], function(err){ + if (err) { + callback(err); + } else { + callback(null); + } + }); + }, function(err) { + if (err) { + callback(err); + } else { + callback(null, document); + } + }); + }, + function(document, callback) { + // Create diff + async.eachOfSeries(document.revisions, function (revision, key, callback) { + revision.descriptions.en_title_diff = []; + revision.descriptions.en_researcher_diff = []; + revision.descriptions.en_study_time_diff = []; + revision.descriptions.en_purpose_diff = []; + revision.descriptions.en_procedure_diff = []; + revision.descriptions.en_duration_diff = []; + revision.descriptions.en_risks_diff = []; + revision.descriptions.en_benefits_diff = []; + + revision.descriptions.de_title_diff = []; + revision.descriptions.de_researcher_diff = []; + revision.descriptions.de_study_time_diff = []; + revision.descriptions.de_purpose_diff = []; + revision.descriptions.de_procedure_diff = []; + revision.descriptions.de_duration_diff = []; + revision.descriptions.de_risks_diff = []; + revision.descriptions.de_benefits_diff = []; + + revision.descriptions.pt_title_diff = []; + revision.descriptions.pt_researcher_diff = []; + revision.descriptions.pt_study_time_diff = []; + revision.descriptions.pt_purpose_diff = []; + revision.descriptions.pt_procedure_diff = []; + revision.descriptions.pt_duration_diff = []; + revision.descriptions.pt_risks_diff = []; + revision.descriptions.pt_benefits_diff = []; + + revision.concerns.q01_explanation_diff = []; + revision.concerns.q02_explanation_diff = []; + revision.concerns.q03_explanation_diff = []; + revision.concerns.q04_explanation_diff = []; + revision.concerns.q05_explanation_diff = []; + revision.concerns.q06_explanation_diff = []; + revision.concerns.q07_explanation_diff = []; + revision.concerns.q08_explanation_diff = []; + revision.concerns.q09_explanation_diff = []; + revision.concerns.q10_explanation_diff = []; + revision.concerns.q11_1_explanation_diff = []; + revision.concerns.q11_2_explanation_diff = []; + revision.concerns.q12_explanation_diff = []; + revision.concerns.q13_explanation_diff = []; + revision.concerns.q14_explanation_diff = []; + + // Study descriptions (en) + revision.descriptions.en_title_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_title != null ? document.revisions[key+1].descriptions.en_title : "") : ""), + (revision.descriptions.en_title != null ? revision.descriptions.en_title: ""), + ); + revision.descriptions.en_researcher_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_researcher != null ? document.revisions[key+1].descriptions.en_researcher : "") : ""), + (revision.descriptions.en_researcher != null ? revision.descriptions.en_researcher : "") + ); + revision.descriptions.en_study_time_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_study_time != null ? document.revisions[key+1].descriptions.en_study_time : "") : ""), + (revision.descriptions.en_study_time != null ? revision.descriptions.en_study_time : "") + ); + revision.descriptions.en_purpose_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_purpose != null ? document.revisions[key+1].descriptions.en_purpose : "") : ""), + (revision.descriptions.en_purpose != null ? revision.descriptions.en_purpose : "") + ); + revision.descriptions.en_procedure_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_procedure != null ? document.revisions[key+1].descriptions.en_procedure : "") : ""), + (revision.descriptions.en_procedure != null ? revision.descriptions.en_procedure : "") + ); + revision.descriptions.en_duration_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_duration != null ? document.revisions[key+1].descriptions.en_duration : "") : ""), + (revision.descriptions.en_duration != null ? revision.descriptions.en_duration : "") + ); + revision.descriptions.en_risks_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_risks != null ? document.revisions[key+1].descriptions.en_risks : "") : ""), + (revision.descriptions.en_risks != null ? revision.descriptions.en_risks : "") + ); + revision.descriptions.en_benefits_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.en_benefits != null ? document.revisions[key+1].descriptions.en_benefits : "") : ""), + (revision.descriptions.en_benefits != null ? revision.descriptions.en_benefits : "") + ); + + // Study descriptions (de) + revision.descriptions.de_title_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_title != null ? document.revisions[key+1].descriptions.de_title : "") : ""), + (revision.descriptions.de_title != null ? revision.descriptions.de_title : "") + ); + revision.descriptions.de_researcher_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_researcher != null ? document.revisions[key+1].descriptions.de_researcher : "") : ""), + (revision.descriptions.de_researcher != null ? revision.descriptions.de_researcher : "") + ); + revision.descriptions.de_study_time_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_study_time != null ? document.revisions[key+1].descriptions.de_study_time : "") : ""), + (revision.descriptions.de_study_time != null ? revision.descriptions.de_study_time : "") + ); + revision.descriptions.de_purpose_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_purpose != null ? document.revisions[key+1].descriptions.de_purpose : "") : ""), + (revision.descriptions.de_purpose != null ? revision.descriptions.de_purpose : "") + ); + revision.descriptions.de_procedure_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_procedure != null ? document.revisions[key+1].descriptions.de_procedure : "") : ""), + (revision.descriptions.de_procedure != null ? revision.descriptions.de_procedure : "") + ); + revision.descriptions.de_duration_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_duration != null ? document.revisions[key+1].descriptions.de_duration : "") : ""), + (revision.descriptions.de_duration != null ? revision.descriptions.de_duration : "") + ); + revision.descriptions.de_risks_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_risks != null ? document.revisions[key+1].descriptions.de_risks : "") : ""), + (revision.descriptions.de_risks != null ? revision.descriptions.de_risks : "") + ); + revision.descriptions.de_benefits_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.de_benefits != null ? document.revisions[key+1].descriptions.de_benefits : "") : ""), + (revision.descriptions.de_benefits != null ? revision.descriptions.de_benefits : "") + ); + + // Study descriptions (pt) + revision.descriptions.pt_title_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_title != null ? document.revisions[key+1].descriptions.pt_title : "") : ""), + (revision.descriptions.pt_title != null ? revision.descriptions.pt_title : "") + ); + revision.descriptions.pt_researcher_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_researcher != null ? document.revisions[key+1].descriptions.pt_researcher : "") : ""), + (revision.descriptions.pt_researcher != null ? revision.descriptions.pt_researcher : "") + ); + revision.descriptions.pt_study_time_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_study_time != null ? document.revisions[key+1].descriptions.pt_study_time : "") : ""), + (revision.descriptions.pt_study_time != null ? revision.descriptions.pt_study_time : "") + ); + revision.descriptions.pt_purpose_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_purpose != null ? document.revisions[key+1].descriptions.pt_purpose : "") : ""), + (revision.descriptions.pt_purpose != null ? revision.descriptions.pt_purpose : "") + ); + revision.descriptions.pt_procedure_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_procedure != null ? document.revisions[key+1].descriptions.pt_procedure : "") : ""), + (revision.descriptions.pt_procedure != null ? revision.descriptions.pt_procedure : "") + ); + revision.descriptions.pt_duration_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_duration != null ? document.revisions[key+1].descriptions.pt_duration : "") : ""), + (revision.descriptions.pt_duration != null ? revision.descriptions.pt_duration : "") + ); + revision.descriptions.pt_risks_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_risks != null ? document.revisions[key+1].descriptions.pt_risks : "") : ""), + (revision.descriptions.pt_risks != null ? revision.descriptions.pt_risks : "") + ); + revision.descriptions.pt_benefits_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].descriptions.pt_benefits != null ? document.revisions[key+1].descriptions.pt_benefits : "") : ""), + (revision.descriptions.pt_benefits != null ? revision.descriptions.pt_benefits : "") + ); + + // Study concerns + revision.concerns.q01_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q01_explanation != null ? document.revisions[key+1].concerns.q01_explanation : "") : ""), + (revision.concerns.q01_explanation != null ? revision.concerns.q01_explanation : "") + ); + revision.concerns.q02_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q02_explanation != null ? document.revisions[key+1].concerns.q02_explanation : "") : ""), + (revision.concerns.q02_explanation != null ? revision.concerns.q02_explanation : "") + ); + revision.concerns.q03_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q03_explanation != null ? document.revisions[key+1].concerns.q03_explanation : "") : ""), + (revision.concerns.q03_explanation != null ? revision.concerns.q03_explanation : "") + ); + revision.concerns.q04_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q04_explanation != null ? document.revisions[key+1].concerns.q04_explanation : "") : ""), + (revision.concerns.q04_explanation != null ? revision.concerns.q04_explanation : "") + ); + revision.concerns.q05_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q05_explanation != null ? document.revisions[key+1].concerns.q05_explanation : "") : ""), + (revision.concerns.q05_explanation != null ? revision.concerns.q05_explanation : "") + ); + revision.concerns.q06_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q06_explanation != null ? document.revisions[key+1].concerns.q06_explanation : "") : ""), + (revision.concerns.q06_explanation != null ? revision.concerns.q06_explanation : "") + ); + revision.concerns.q07_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q07_explanation != null ? document.revisions[key+1].concerns.q07_explanation : "") : ""), + (revision.concerns.q07_explanation != null ? revision.concerns.q07_explanation : "") + ); + revision.concerns.q08_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q08_explanation != null ? document.revisions[key+1].concerns.q08_explanation : "") : ""), + (revision.concerns.q08_explanation != null ? revision.concerns.q08_explanation : "") + ); + revision.concerns.q09_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q09_explanation != null ? document.revisions[key+1].concerns.q09_explanation : "") : ""), + (revision.concerns.q09_explanation != null ? revision.concerns.q09_explanation : "") + ); + revision.concerns.q10_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q10_explanation != null ? document.revisions[key+1].concerns.q10_explanation : "") : ""), + (revision.concerns.q10_explanation != null ? revision.concerns.q10_explanation : "") + ); + revision.concerns.q11_1_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q11_1_explanation != null ? document.revisions[key+1].concerns.q11_1_explanation : "") : ""), + (revision.concerns.q11_1_explanation != null ? revision.concerns.q11_1_explanation : "") + ); + revision.concerns.q11_2_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q11_2_explanation != null ? document.revisions[key+1].concerns.q11_2_explanation : "") : ""), + (revision.concerns.q11_2_explanation != null ? revision.concerns.q11_2_explanation : "") + ); + revision.concerns.q12_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q12_explanation != null ? document.revisions[key+1].concerns.q12_explanation : "") : ""), + (revision.concerns.q12_explanation != null ? revision.concerns.q12_explanation : "") + ); + revision.concerns.q13_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q13_explanation != null ? document.revisions[key+1].concerns.q13_explanation : "") : ""), + (revision.concerns.q13_explanation != null ? revision.concerns.q13_explanation : "") + ); + revision.concerns.q14_explanation_diff = jsdiff.diffSentences( + (document.revisions[key+1] ? (document.revisions[key+1].concerns.q14_explanation != null ? document.revisions[key+1].concerns.q14_explanation : "") : ""), + (revision.concerns.q14_explanation != null ? revision.concerns.q14_explanation : "") + ); + + callback(null); + }, function(err) { + callback(null, 200, document); + }); + } + ], function(err, code, result) { + if(err){ + console.error(colors.red(err)); + res.status(code).send(err.message); + } else { + res.status(code).send(result); + } + }); +}; diff --git a/controllers/documents/submit.js b/controllers/documents/submit.js index 418b733..e105a0d 100644 --- a/controllers/documents/submit.js +++ b/controllers/documents/submit.js @@ -173,7 +173,7 @@ exports.request = function(req, res) { } else if(concern.q14_value){ callback(null, client, done, document, course, revision, description, concern, 3); } else { - // Check if document has been already in review + // Check if document has already been in review if(document.status === 5){ callback(null, client, done, document, course, revision, description, concern, 3); } else { @@ -258,6 +258,7 @@ exports.request = function(req, res) { } }, function(client, done, document, course, revision, description, concern, author, members, callback){ + // Check status to notify members, in case of a review if(document.status === 2){ callback(null, 204, null); @@ -265,122 +266,122 @@ exports.request = function(req, res) { // Formatting if(concern.q01_value){ - concern.q01_label = "badge-danger"; + concern.q01_label = "badge-warning"; concern.q01_sign = "yes"; } else { - concern.q01_label = "badge-success"; + concern.q01_label = "badge-default"; concern.q01_sign = "no"; } if(concern.q02_value){ - concern.q02_label = "badge-danger"; + concern.q02_label = "badge-warning"; concern.q02_sign = "yes"; } else { - concern.q02_label = "badge-success"; + concern.q02_label = "badge-default"; concern.q02_sign = "no"; } if(concern.q03_value){ - concern.q03_label = "badge-danger"; + concern.q03_label = "badge-warning"; concern.q03_sign = "yes"; } else { - concern.q03_label = "badge-success"; + concern.q03_label = "badge-default"; concern.q03_sign = "no"; } if(concern.q04_value){ - concern.q04_label = "badge-danger"; + concern.q04_label = "badge-warning"; concern.q04_sign = "yes"; } else { - concern.q04_label = "badge-success"; + concern.q04_label = "badge-default"; concern.q04_sign = "no"; } if(concern.q05_value){ - concern.q05_label = "badge-danger"; + concern.q05_label = "badge-warning"; concern.q05_sign = "yes"; } else { - concern.q05_label = "badge-success"; + concern.q05_label = "badge-default"; concern.q05_sign = "no"; } if(concern.q06_value){ - concern.q06_label = "badge-danger"; + concern.q06_label = "badge-warning"; concern.q06_sign = "yes"; } else { - concern.q06_label = "badge-success"; + concern.q06_label = "badge-default"; concern.q06_sign = "no"; } if(concern.q07_value){ - concern.q07_label = "badge-danger"; + concern.q07_label = "badge-warning"; concern.q07_sign = "yes"; } else { - concern.q07_label = "badge-success"; + concern.q07_label = "badge-default"; concern.q07_sign = "no"; } if(concern.q08_value){ - concern.q08_label = "badge-danger"; + concern.q08_label = "badge-warning"; concern.q08_sign = "yes"; } else { - concern.q08_label = "badge-success"; + concern.q08_label = "badge-default"; concern.q08_sign = "no"; } if(concern.q09_value){ - concern.q09_label = "badge-danger"; + concern.q09_label = "badge-warning"; concern.q09_sign = "yes"; } else { - concern.q09_label = "badge-success"; + concern.q09_label = "badge-default"; concern.q09_sign = "no"; } if(concern.q10_value){ - concern.q10_label = "badge-danger"; + concern.q10_label = "badge-warning"; concern.q10_sign = "yes"; } else { - concern.q10_label = "badge-success"; + concern.q10_label = "badge-default"; concern.q10_sign = "no"; } if(concern.q11_1_value){ - concern.q11_1_label = "badge-danger"; + concern.q11_1_label = "badge-warning"; concern.q11_1_sign = "yes"; } else { - concern.q11_1_label = "badge-success"; + concern.q11_1_label = "badge-default"; concern.q11_1_sign = "no"; } if(concern.q11_2_value){ - concern.q11_2_label = "badge-danger"; + concern.q11_2_label = "badge-warning"; concern.q11_2_sign = "yes"; } else { - concern.q11_2_label = "badge-success"; + concern.q11_2_label = "badge-default"; concern.q11_2_sign = "no"; } if(concern.q12_value){ - concern.q12_label = "badge-danger"; + concern.q12_label = "badge-warning"; concern.q12_sign = "yes"; } else { - concern.q12_label = "badge-success"; + concern.q12_label = "badge-default"; concern.q12_sign = "no"; } if(concern.q13_value){ - concern.q13_label = "badge-danger"; + concern.q13_label = "badge-warning"; concern.q13_sign = "yes"; } else { - concern.q13_label = "badge-success"; + concern.q13_label = "badge-default"; concern.q13_sign = "no"; } - + if(concern.q14_value){ - concern.q14_label = "badge-danger"; + concern.q14_label = "badge-warning"; concern.q14_sign = "yes"; } else { - concern.q14_label = "badge-success"; + concern.q14_label = "badge-default"; concern.q14_sign = "no"; } @@ -411,7 +412,7 @@ exports.request = function(req, res) { address: process.env.SENDER_EMAIL_ADDRESS }, to: member.email_address, - subject: "[Ethics-App] A Study needs your review - Study Title: " + description.en_title, + subject: "[Ethics-App] A document needs your review - Study title: " + description.en_title, text: text, html: output, messageId: document.document_id + "_review_reminder@giv-ethics-app.uni-muenster.de" @@ -419,9 +420,10 @@ exports.request = function(req, res) { if (err) { callback(err); } else { - callback(); + callback(null); } }); + callback(null); }, function(err){ callback(null, 204, null); diff --git a/controllers/recovery/find_user_by_email.js b/controllers/recovery/find_user_by_email.js index 46d71e3..8deb2ab 100644 --- a/controllers/recovery/find_user_by_email.js +++ b/controllers/recovery/find_user_by_email.js @@ -15,9 +15,11 @@ var fs = require("fs"); var dir_1 = "/../../templates/emails/"; var dir_2 = "/../../sql/queries/users/"; var dir_3 = "/../../sql/queries/documents/"; +var dir_4 = "/../../sql/queries/revisions/"; var template_document_recovery = fs.readFileSync(__dirname + dir_1 + 'document_recovery.html', 'utf8').toString(); var query_get_user_by_email = fs.readFileSync(__dirname + dir_2 + 'get_by_email.sql', 'utf8').toString(); var query_list_documents_by_user = fs.readFileSync(__dirname + dir_3 + 'list_by_user.sql', 'utf8').toString(); +var query_get_latest_revision_by_document = fs.readFileSync(__dirname + dir_4 + 'get_latest_by_document.sql', 'utf8').toString(); // FIND BY EMAIL @@ -79,6 +81,33 @@ exports.request = function(req, res) { } }); }, + function(client, done, user, documents, callback) { + async.eachOfSeries(documents, function (document, key, callback) { + // Database query + client.query(query_get_latest_revision_by_document, [ + document.document_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + // Check if Revision exists + if (result.rows.length === 0) { + callback(new Error("Revision not found"), 404); + } else { + document.latest_revision = result.rows[0]; + callback(null); + } + } + }); + }, function(err){ + if (err) { + callback(err, 500); + } else { + callback(null, client, done, user, documents); + } + }); + }, function(client, done, user, documents, callback) { // Formatting @@ -148,7 +177,7 @@ exports.request = function(req, res) { }); // Render text for emails without HTML support - var text = "You asked for your Document-IDs"; + var text = "You asked for your document-IDs"; // Send email transporter.sendMail({ @@ -157,7 +186,7 @@ exports.request = function(req, res) { address: process.env.SENDER_EMAIL_ADDRESS }, to: user.email_address, - subject: "[Ethics-App] You asked for your Document-IDs", + subject: "[Ethics-App] You asked for your document-IDs", text: text, html: output }, function(err, info) { diff --git a/controllers/reviewers/put_by_revision.js b/controllers/reviewers/put_by_revision.js index 40e29bb..53fd730 100644 --- a/controllers/reviewers/put_by_revision.js +++ b/controllers/reviewers/put_by_revision.js @@ -18,7 +18,8 @@ var dir_2 = "/../../sql/queries/members/"; var dir_3 = "/../../sql/queries/reviewers/"; var dir_4 = "/../../sql/queries/courses/"; var dir_5 = "/../../sql/queries/descriptions/"; -var dir_8 = "/../../sql/queries/members/"; +var dir_6 = "/../../sql/queries/members/"; +var dir_7 = "/../../sql/queries/documents/"; var query_get_revision = fs.readFileSync(__dirname + dir_1 + 'get.sql', 'utf8').toString(); var query_get_member = fs.readFileSync(__dirname + dir_2 + 'get.sql', 'utf8').toString(); @@ -27,10 +28,10 @@ var query_delete_reviewer_by_revision = fs.readFileSync(__dirname + dir_3 + 'del var query_create_reviewer = fs.readFileSync(__dirname + dir_3 + 'create.sql', 'utf8').toString(); var query_get_reviewer_by_revision = fs.readFileSync(__dirname + dir_3 + 'get_by_revision.sql', 'utf8').toString(); var query_get_description_by_revision = fs.readFileSync(__dirname + dir_5 + 'get_by_revision.sql', 'utf8').toString(); - var query_get_course_by_document = fs.readFileSync(__dirname + dir_4 + 'get_by_document.sql', 'utf8').toString(); -var query_list_members_by_subscription = fs.readFileSync(__dirname + dir_8 + 'list_by_subscription.sql', 'utf8').toString(); -var query_list_members_by_course = fs.readFileSync(__dirname + dir_8 + 'list_by_course_internal.sql', 'utf8').toString(); +var query_list_members_by_subscription = fs.readFileSync(__dirname + dir_6 + 'list_by_subscription.sql', 'utf8').toString(); +var query_list_members_by_course = fs.readFileSync(__dirname + dir_6 + 'list_by_course_internal.sql', 'utf8').toString(); +var query_get_document = fs.readFileSync(__dirname + dir_7 + 'get.sql', 'utf8').toString(); var template_review_claimed = fs.readFileSync(__dirname + '/../../templates/emails/member_review_claimed.html', 'utf8').toString(); @@ -89,6 +90,24 @@ exports.request = function(req, res) { }); }, function(client, revision, done, callback) { + // Database query + client.query(query_get_document, [ + revision.document_id + ], function(err, result) { + done(); + if (err) { + callback(err, 500); + } else { + // Check if Document exists + if (result.rows.length === 0) { + callback(new Error("Document not found"), 404); + } else { + callback(null, client, result.rows[0], revision, done); + } + } + }); + }, + function(client, document, revision, done, callback) { // Database query client.query(query_get_member, [ req.body.member_id @@ -101,12 +120,12 @@ exports.request = function(req, res) { if (result.rows.length === 0) { callback(new Error("Member not found"), 404); } else { - callback(null, client, result.rows[0], revision, done); + callback(null, client, document, revision, result.rows[0], done); } } }); }, - function(client, member, revision, done, callback) { + function(client, document, revision, member, done, callback) { // Database query client.query(query_get_course_by_document, [ revision.document_id @@ -117,14 +136,14 @@ exports.request = function(req, res) { } else { // Check if Course exists if (result.rows.length === 0) { - callback(null, client, member, revision, false, done); + callback(null, client, document, revision, member, false, done); } else { - callback(null, client, member, revision, result.rows[0], done); + callback(null, client, document, revision, member, result.rows[0], done); } } }); }, - function(client, member, revision, course, done, callback) { + function(client, document, revision, member, course, done, callback) { // Find responsible members, when document was referenced to a course if(course){ // Database query @@ -137,20 +156,20 @@ exports.request = function(req, res) { } else { // Check if Members exists if (result.rows.length === 0) { - callback(null, client, member, revision, [], done); + callback(null, client, document, revision, member, [], done); } else { - callback(null, client, member, revision, result.rows, done); + callback(null, client, document, revision, member, result.rows, done); } } }); } else { - callback(null, client, member, revision, [], done); + callback(null, client, document, revision, member, [], done); } }, - function(client, member, revision, members, done, callback) { + function(client, document, revision, member, members, done, callback) { // Find responsible members, when document was not referenced to a course, or course didn't had responsible members if(members.length > 0){ - callback(null, client, member, revision, members, done); + callback(null, client, document, revision, member, members, done); } else { // Database query client.query(query_list_members_by_subscription, function(err, result) { @@ -158,12 +177,12 @@ exports.request = function(req, res) { if (err) { callback(err, 500); } else { - callback(null, client, member, revision, result.rows, done); + callback(null, client, document, revision, member, result.rows, done); } }); } }, - function(client, member, revision, members, done, callback) { + function(client, document, revision, member, members, done, callback) { // Database query client.query(query_get_description_by_revision, [ req.params.revision_id @@ -176,12 +195,12 @@ exports.request = function(req, res) { if (result.rows.length === 0) { callback(new Error("Description not found"), 404); } else { - callback(null, client, member, revision, members, result.rows[0], done); + callback(null, client, document, revision, result.rows[0], member, members, done); } } }); }, - function(client, newmember, revision, members, description, done, callback) { + function(client, document, revision, description, newmember, members, done, callback) { // Database query // Check if there is an old reviewer - if not send email that it is already taken. client.query(query_get_reviewer_by_revision, [ @@ -199,6 +218,7 @@ exports.request = function(req, res) { member: member, newmember: newmember, year: moment().format("YYYY"), + document: document, revision: revision, description: description, domain: domain, @@ -217,9 +237,9 @@ exports.request = function(req, res) { to: member.email_address, inReplyTo: revision.document_id + "_review_reminder@giv-ethics-app.uni-muenster.de", references: revision.document_id + "_review_reminder@giv-ethics-app.uni-muenster.de", - subject: "RE: [Ethics-App] A document needs your review - Study Title: " + description.en_title, + subject: "RE: [Ethics-App] A document needs your review - Study title: " + description.en_title, text: text, - html: output, + html: output }, function(err, info) { if (err) { callback(err ,500); diff --git a/public/member-client/css/styles.css b/public/member-client/css/styles.css index 64d64aa..b130071 100644 --- a/public/member-client/css/styles.css +++ b/public/member-client/css/styles.css @@ -42,8 +42,18 @@ footer { } .comment { - padding-top: 3px; - color: #ff4d4d; + color: #8a6d3b; + border-color: #faf2cc; + background-color: #fcf8e3; +} + +.comment-textarea { + border-color: #faf2cc; +} + +.alert-comment { + margin-top: 5px; + margin-bottom: 0px; } .timestamp { diff --git a/public/member-client/js/controllers/document/detailsController.js b/public/member-client/js/controllers/document/detailsController.js index 9edafd1..831da4c 100644 --- a/public/member-client/js/controllers/document/detailsController.js +++ b/public/member-client/js/controllers/document/detailsController.js @@ -29,126 +29,17 @@ app.controller("documentDetailsController", function($scope, $rootScope, $routeP // Reset navbar $scope.$parent.document = false; - $timeout(function(){ - // Load document - $documentService.retrieve($routeParams.document_id) - .then(function onSuccess(response) { - $documentService.set(response.data); - $scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_REVISIONS') }; - - $timeout(function(){ - // Load revisions - $revisionService.listByDocument($routeParams.document_id) - .then(function onSuccess(response) { - $documentService.setRevisions(response.data); - - // Prepare main-promises - var checkout_revisions_deferred = $q.defer(); - var revision_promises = []; - - // Checkout description, concerns, comments and reviewers for each revision - angular.forEach($documentService.getRevisions(), function(revision, key){ - - // Prepare sub-promises - var checkout_descriptions_deferred = $q.defer(); - var checkout_concerns_deferred = $q.defer(); - var checkout_comments_deferred = $q.defer(); - var checkout_reviewers_deferred = $q.defer(); - - // Checkout descriptions - $descriptionService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setDescriptions(revision.revision_id, response.data); - // Resolve sub-promise - checkout_descriptions_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout concerns - $concernService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setConcerns(revision.revision_id, response.data); - // Resolve sub-promise - checkout_concerns_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout comments - $commentService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setComments(revision.revision_id, response.data); - // Resolve sub-promise - checkout_comments_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout reviewers - $reviewerService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setReviewers(revision.revision_id, response.data || null); - // Resolve sub-promise - checkout_reviewers_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Sub-promises - checkout_descriptions_deferred.promise.then(function(){ - return; - }); - checkout_concerns_deferred.promise.then(function() { - return; - }); - checkout_comments_deferred.promise.then(function() { - return; - }); - checkout_reviewers_deferred.promise.then(function() { - return; - }); - - // Start parallel sub-requests - $q.all([ - checkout_descriptions_deferred.promise, - checkout_concerns_deferred.promise, - checkout_comments_deferred.promise, - checkout_reviewers_deferred.promise - ]).then(function(){ - // Resolve main-promises - revision_promises.push(checkout_revisions_deferred.resolve()); - }); - - }); - - // Start parallel requests for each revision - $q.all(revision_promises).then(function(){ - $scope.$parent.loading = { status: false, message: "" }; - - // Redirect - $scope.redirect("/documents/" + $routeParams.document_id + "/overview"); - - }); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - }, 400); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - }, 400); - + // Load document v2 + $documentService.retrieve_v2($routeParams.document_id) + .then(function onSuccess(response) { + $documentService.set(response.data); + $scope.$parent.loading = { status: false, message: "" }; + + // Redirect + $scope.redirect("/documents/" + $routeParams.document_id + "/overview"); + }) + .catch(function onError(response) { + $window.alert(response.data); + $scope.redirect("/documents"); + }); }); diff --git a/public/member-client/js/controllers/document/overviewController.js b/public/member-client/js/controllers/document/overviewController.js index 2406f97..40f4e48 100644 --- a/public/member-client/js/controllers/document/overviewController.js +++ b/public/member-client/js/controllers/document/overviewController.js @@ -191,131 +191,22 @@ app.controller("documentOverviewController", function($scope, $rootScope, $route $scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_DOCUMENT') }; - $timeout(function(){ - // Load document - $documentService.retrieve($routeParams.document_id) - .then(function onSuccess(response) { - $documentService.set(response.data); - $scope.$parent.loading = { status: true, message: $filter('translate')('LOADING_REVISIONS') }; - - $timeout(function(){ - - // Load revisions - $revisionService.listByDocument($routeParams.document_id) - .then(function onSuccess(response) { - $documentService.setRevisions(response.data); - - // Prepare main-promises - var checkout_revisions_deferred = $q.defer(); - var revision_promises = []; - - // Checkout description, concerns, comments and reviewers for each revision - angular.forEach($documentService.getRevisions(), function(revision, key){ - - // Prepare sub-promises - var checkout_descriptions_deferred = $q.defer(); - var checkout_concerns_deferred = $q.defer(); - var checkout_comments_deferred = $q.defer(); - var checkout_reviewers_deferred = $q.defer(); - - // Checkout descriptions - $descriptionService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setDescriptions(revision.revision_id, response.data); - // Resolve sub-promise - checkout_descriptions_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout concerns - $concernService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setConcerns(revision.revision_id, response.data); - // Resolve sub-promise - checkout_concerns_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout comments - $commentService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setComments(revision.revision_id, response.data); - // Resolve sub-promise - checkout_comments_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Checkout reviewers - $reviewerService.getByRevision(revision.revision_id) - .then(function onSuccess(response) { - $documentService.setReviewers(revision.revision_id, response.data); - // Resolve sub-promise - checkout_reviewers_deferred.resolve(); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - - // Sub-promises - checkout_descriptions_deferred.promise.then(function(){ - return; - }); - checkout_concerns_deferred.promise.then(function() { - return; - }); - checkout_comments_deferred.promise.then(function() { - return; - }); - checkout_reviewers_deferred.promise.then(function() { - return; - }); - - // Start parallel sub-requests - $q.all([ - checkout_descriptions_deferred.promise, - checkout_concerns_deferred.promise, - checkout_comments_deferred.promise, - checkout_reviewers_deferred.promise - ]).then(function(){ - // Resolve main-promises - revision_promises.push(checkout_revisions_deferred.resolve()); - }); - - }); - - // Start parallel requests for each revision - $q.all(revision_promises).then(function(){ - - // Update navbar - $scope.$parent.document = $documentService.get(); - $scope.$parent.loading = { status: false, message: "" }; - - // Redirect - $scope.redirect("/documents/" + $routeParams.document_id + "/review"); - - }); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - }, 400); - }) - .catch(function onError(response) { - $window.alert(response.data); - $scope.redirect("/documents"); - }); - }, 400); + // Load document + $documentService.retrieve_v2($routeParams.document_id) + .then(function onSuccess(response) { + $documentService.set(response.data); + + // Update navbar + $scope.$parent.document = $documentService.get(); + $scope.$parent.loading = { status: false, message: "" }; + + // Redirect + $scope.redirect("/documents/" + $routeParams.document_id + "/review"); + }) + .catch(function onError(response) { + $window.alert(response.data); + $scope.redirect("/documents"); + }); }) .catch(function onError(response) { $window.alert(response.data); @@ -350,7 +241,7 @@ app.controller("documentOverviewController", function($scope, $rootScope, $route $scope.document = $documentService.get(); $scope.latest_revision = $documentService.getLatestRevision(); $scope.authenticated_member = $authenticationService.get(); - + switch($scope.document.status) { case 0: $scope.document.statusText = "initialized" @@ -425,15 +316,6 @@ app.controller("documentOverviewController", function($scope, $rootScope, $route } }; - // Show all comments and history - $scope.toggle('general', 'history'); - $scope.toggle('descriptions', 'history', 'en'); - $scope.toggle('descriptions', 'history', 'de'); - $scope.toggle('descriptions', 'language', 'de'); - $scope.toggle('descriptions', 'history', 'pt'); - $scope.toggle('descriptions', 'language', 'pt'); - $scope.toggle('concerns', 'history'); - $scope.$parent.loading = { status: false, message: "" }; }); diff --git a/public/member-client/js/controllers/document/reviewController.js b/public/member-client/js/controllers/document/reviewController.js index 4d0515a..ca3addd 100644 --- a/public/member-client/js/controllers/document/reviewController.js +++ b/public/member-client/js/controllers/document/reviewController.js @@ -266,7 +266,7 @@ app.controller("documentReviewController", function($scope, $rootScope, $routePa $scope.authenticated_member = $authenticationService.get(); $scope.document = $documentService.get(); $scope.latest_revision = $documentService.getLatestRevision(); - + //TODO Add concerns to make filepath available in review.html // Update navbar @@ -313,14 +313,5 @@ app.controller("documentReviewController", function($scope, $rootScope, $routePa } }; - // Show all comments and history - $scope.toggle('general', 'history'); - $scope.toggle('descriptions', 'history', 'en'); - $scope.toggle('descriptions', 'history', 'de'); - $scope.toggle('descriptions', 'language', 'de'); - $scope.toggle('descriptions', 'history', 'pt'); - $scope.toggle('descriptions', 'language', 'de'); - $scope.toggle('concerns', 'history'); - $scope.$parent.loading = { status: false, message: "" }; }); diff --git a/public/member-client/js/modules/_languages.js b/public/member-client/js/modules/_languages.js deleted file mode 100644 index 3a5c543..0000000 --- a/public/member-client/js/modules/_languages.js +++ /dev/null @@ -1,531 +0,0 @@ -var app = angular.module("languages", []); - -// Language provider -app.config(function ($translateProvider) { - - $translateProvider.translations('de_DE', { - // TODO - }); - - $translateProvider.translations('en_US', { - - WELCOME: 'Welcome', - WELCOME_MESSAGE: 'This Web-App provides a way to create the necessary forms for your user study.', - WELCOME_MESSAGE_2: 'Please login or create a new document.', - WELCOME_MESSAGE_MEMBER: 'This is the Login for Members of the Ethics-Committee.', - WELCOME_MESSAGE_MEMBER_2: 'If you are not a member of the Ethics-Committee, please login', - HERE: 'here', - - DOCUMENT_ID: 'Document-ID', - DOCUMENT_TITLE: 'Document title', - EMAIL : 'Email', - EMAIL_ADDRESS : 'Email-address', - TITLE : 'Title', - FIRST_NAME : 'First name', - LAST_NAME : 'Last name', - FULL_NAME: 'Full name', - HELP: 'Help', - MANUAL: 'Manual', - CREATE_NEW_DOCUMENT: 'Create a new document', - FORGOT_YOUR_DOCUMENT_ID: 'Forgot your document-ID', - FORGOT_YOUR_PASSWORD: 'Forgot your password', - PASSWORD: 'Password', - - LOGIN : 'Login', - SIGN_UP:'Sign up', - SUBMIT : 'Submit', - SEND: 'Send', - SAVE: 'Save', - DELETE: 'Delete', - CANCEL: 'Cancel', - NEXT: 'Next', - NEXT_PAGE: 'Next page', - PREVIOUS_PAGE: 'Previous page', - BACK: 'Back', - SEARCH: 'Search', - SEND_RECOVERY_EMAIL: 'Send recovery email', - SHOW_INTRO: 'Show introduction', - RECOVERY: 'Recovery', - REGISTRATION: 'Registration', - NEW_DOCUMENT: 'New document', - PLEASE_USE_A_UNIVERSITY_ADDRESS: 'Please use an official university address', - - SEARCH_FOR_DOCUMENT_TITLES_AND_AUTHORS: 'Search for documents, titles and authors', - SEARCH_FOR_MEMBERS: 'Search for members', - SEARCH_FOR_USERS: 'Search for users', - SEARCH_FOR_COURSES: 'Search for courses', - SEARCH_FOR_UNIVERSITIES: 'Search for universities', - SEARCH_FOR_INSTITUTES: 'Search for institutes', - SEARCH_FOR_WORKING_GROUPS: 'Search for working groups', - - NO_FILTER: 'No filter', - FILTER_BY_COURSE: 'Filter by course', - FILTER_BY_STATUS: 'Filter by status', - SORT_BY: 'Sort by', - WITH_A_COURSE: 'With a course', - WITHOUT_A_COURSE: 'Without a course', - CREATED_ASC: 'Created ascending', - CREATED_DESC: 'Created descending', - UPDATED_ASC: 'Updated ascending', - UPDATED_DESC: 'Updated descending', - STATUS_ASC: 'Status number ascending', - STATUS_DESC: 'Status number descending', - TITLE_ASC: 'Title ascending', - TITLE_DESC: 'Title descending', - NAME_ASC: 'Name ascending', - NAME_DESC: 'Name descending', - YEAR_ASC: 'Year ascending', - YEAR_DESC: 'Year descending', - - DELETE_THIS_DOCUMENT: 'Do you really want to delete this document', - EXPLANATION_OF_DELETING_A_DOCUMENT: 'Deleting a document also deletes ALL ASSOCIATED data. PLEASE PROCEED WITH CAUTION!', - PLEASE_TYPE_IN_THE_ID_OF_THE_DOCUMENT_TO_CONFIRM: 'Please type in the ID of the document to confirm', - ALTERNATIVE_DOCUMENT: 'If you don\'t want to delete EVERYTHING associated with this document you can also temporay reject the document, so that the user has no longer access to it', - - DELETE_THIS_COURSE: 'Do you really want to delete this course', - PLEASE_TYPE_IN_THE_COURSE_NAME_TO_CONFIRM: 'Please type in the name of the course to confirm', - - DELETE_THIS_USER: 'Do you really want to delete this user', - EXPLANATION_OF_DELETING_A_USER: 'Deleting an user also deletes ALL ASSOCIATED documents. PLEASE PROCEED WITH CAUTION!', - USER_NAME: 'Full name of the user', - PLEASE_TYPE_IN_THE_FULL_NAME_OF_THE_USER_TO_CONFIRM: 'Please type in the full name of the user to confirm', - ALTERNATIVE_USER: 'If you don\'t want to delete EVERYTHING associated with this user you can temporary blocked the user', - - DELETE_THIS_MEMBER: 'Do you really want to delete this member', - DELETE_THIS_ADMINISTRATOR: 'Do you really want to delete this administrator', - EXPLANATION_OF_DELETING_A_MEMBER: 'Deleting an committee member also deletes ALL ASSOCIATED reviews. PLEASE PROCEED WITH CAUTION!', - MEMBER_NAME: 'Full name of the member', - PLEASE_TYPE_IN_THE_FULL_NAME_OF_THE_MEMBER_TO_CONFIRM: 'Please type in the full name of the member to confirm', - ALTERNATIVE_MEMBER: 'If you don\'t want to delete EVERYTHING associated with this member you can change the member to a former member', - ALTERNATIVE_ADMIN: 'An administrator can not be deleted, but you can revoke the admin priviliges and then change the member to a former member or delete the member', - - DELETE_THIS_UNIVERSITY: 'Do you really want to delete this university', - EXPLANATION_OF_DELETING_A_UNIVERSITY: 'Deleting an university also deletes ALL ASSOCIATED institutes, working groups, committee members, users and documents. PLEASE PROCEED WITH CAUTION!', - UNIVERSITY_NAME: 'University name', - PLEASE_TYPE_IN_THE_UNIVERSITY_NAME_TO_CONFIRM: 'Please type in the name of the university to confirm', - - DELETE_THIS_INSTITUTE: 'Do you really want to delete this institute', - EXPLANATION_OF_DELETING_A_INSTITUTE: 'Deleting an institute also deletes ALL ASSOCIATED working groups, committe members, users and documents. PLEASE PROCEED WITH CAUTION!', - INSTITUTE_NAME: 'Institute name', - PLEASE_TYPE_IN_THE_INSTITUTE_NAME_TO_CONFIRM: 'Please type in the name of the institute to confirm', - ALTERNATIVE_INSTITUTE: 'If you don\'t want to delete EVERYTHING associated with this institute you can change it to a former institute', - - DELETE_THIS_WORKING_GROUP: 'Do you really want to delete this working group', - EXPLANATION_OF_DELETING_A_WORKING_GROUP: 'Deleting a working group also deletes ALL ASSOCIATED committee members and their reviews. PLEASE PROCEED WITH CAUTION!', - WORKING_GROUP_NAME: 'Working group name', - PLEASE_TYPE_IN_THE_WORKING_GROUP_NAME_TO_CONFIRM: 'Please tpe in the name of the working group to confirm', - ALTERNATIVE_WORKING_GROUP: 'If you don\'t want to delete EVERYTHING associated with this working group you can change it to a former working group', - - RELATED_COURSE: 'Related course', - COURSE_DESCRIPTION_1: 'If you are creating this document for a course, please select the appropiate Course from the selection below. If you cannot find it, please ask your lecturer to add it to the list (It is possible to change the course later in the document settings).', - COURSE_DESCRIPTION_2: 'If you are creating the document for a personal study, for example your thesis, then you do not need to connect it to a course.', - - INTRODUCTION_TEXT_FRAGMENT_1: 'This Web-App will guide you in creating the necessary forms for your user study. You will be asked a series of questions, based on which the Ethics-App will auto-generate three documents.', - INTRODUCTION_TEXT_FRAGMENT_2: 'The Informed Consent form', - INTRODUCTION_TEXT_FRAGMENT_3: 'This is the most important document. It assures that the Participant gave his consent prior to participating in the study. Both you and your participant must sign the document, and you need to store your copy safely. Conducting a study without the written consent of the participant is not advised and can lead to various legal issues.', - INTRODUCTION_TEXT_FRAGMENT_4: 'The Statement of the Researcher', - INTRODUCTION_TEXT_FRAGMENT_5: 'The Statement of the Researcher provides guidelines for carrying out the study itself. You need to sign the Statement and store it savely together with the Informed Consent forms. This form is only for yourself and should not be handed to the participant.', - INTRODUCTION_TEXT_FRAGMENT_6: 'Debriefing Information', - INTRODUCTION_TEXT_FRAGMENT_7: 'The Debriefing Information provides a checklist for the debriefing after the experiment. It does not need to be signed as it only serves as a reminder of the most important points that should be mentioned during the debriefing. This list is not complete and needs to be extended based on the specific circumstances of the individual study.', - INTRODUCTION_TEXT_FRAGMENT_8: 'You are ', - INTRODUCTION_TEXT_FRAGMENT_9: 'required', - INTRODUCTION_TEXT_FRAGMENT_10: ' to use these Documents in your experiment.', - - STUDY_DESCRIPTION_FORM_TEXT: 'This form will be used to automatically generate the informed consent form that every participant of your study will have to sign. Please fill out the English version and optionally versions in other languages. Depending on the language(s) filled out, you will receive the informed consent forms in the chosen languages to be used during your experiment.', - CHOOSE_LANGUAGE:'Please select the language(s), in which you want to generate the informed consent forms:', - STUDY_CONCERNS_FORM_TEXT: 'Complete the checklist below. If you have answered yes to any of the questions, please provide a brief overview of how you are going to ensure ethical conduct with regard to the given risk. This will be reviewed by the Institutes Ethics committee. Remember that any ethical approval granted based on untrue or incomplete disclosure of your research procedure is invalid. The checklist is intended as a guideline and its role is to alert you in cases where you might be proposing an unethical study. Make sure you discuss any concerns with the members of the Intitutes\'s Ethics committee.', - - AGREEMENT_DATA: 'I agree that all given information is correct, and I am aware that my data will be stored by the Institute responsible for the study and its partners', - AGREEMENT_DELETION: 'I agree that as soon as I submit my document request, only Members of the Ethics committee can delete my account', - - STATUS_2: 'Your files have been created successfully. Please click on the following icons to download them.', - STATUS_3: 'Your document was submitted successfully, but has one or more ethical concerns. You will get an email as soon as the committee start to review it.', - STATUS_4: 'Your document was submitted successfully, but has one or more ethical concerns. The committee has started to review it. You will get an email as soon as the committee has reviewed it completely.', - STATUS_5: 'Your document has been partly accepted by the committee. Please read the comments and revise your document.', - STATUS_6: 'Your files have been created successfully. Please click on the following icons to download them.', - STATUS_7: 'Unfortunatly your document has been rejected by the Ethics committee. Please get in contact with the corresponding reviewers.', - - ACCOUNT: 'Account', - SETTINGS: 'Settings', - DOCUMENT_SETTINGS: 'Document settings', - ADMINISTRATION: 'Administration', - DOCUMENT: 'Document', - DOCUMENTS: 'Documents', - LOGOUT: 'Logout', - SHOW_DOCUMENT_ID: 'Show document-ID', - SHOW_DOCUMENT_INTRO: 'Show introduction', - SHOW_FILES: 'Show files', - DOWNLOAD_FILES: 'Download files', - CHANGE_DOCUMENT_SETTINGS: 'Change document settings', - SAVE_DOCUMENT: 'Save document', - DELETE_DOCUMENT: 'Delete document', - YOUR_DOCUMENT_ID: 'Your document-ID', - YOUR_ACCOUNT: 'Your account', - CURRENT_STATUS: 'Current status', - CHANGE_STATUS: 'Change status', - NEW_STATUS: 'New status', - - PROVIDED_TO_PARTICIPANTS_AFTER_STUDY:'(provided to participants after the study)', - TO_BE_FILLED_OUT_BY_PARTICIPANT:'(to be filled out by each participant)', - SIGN_BY_YOURSELF:'(sign by yourself and add to archive)', - - DEFAULT:'Default', - STATUS:'Status', - ALL:'All', - INITIALISED: 'initialised', - UNSUBMITTED: 'unsubmitted', - UNSUBMITTED_IN_PROGRESS: 'unsubmitted (in progress)', - ACCEPTED: 'accepted', - AUTO_ACCEPTED: 'auto accepted', - PARTLY_ACCEPTED: 'partly accepted', - AUTO_ACCEPTED_AND_ACCEPTED: 'auto accepted and accepted', - REVIEWED_ACCEPTED: 'reviewed (accepted)', - REVIEWED_PARTLY_ACCEPTED: 'reviewed (partly accepted)', - REVIEWED_REJECTED: 'reviewed (rejected)', - REVIEW_REQUIRED: 'review required', - REVIEW_REQUESTED: 'review requested', - REJECTED: 'rejected', - REVIEW_IN_PROGRESS: 'review in progress', - UNDER_REVIEW: 'under review', - UNPUBLISHED: 'unpublished', - IN_PROGRESS: 'in progress', - _SUBMITTED: 'submitted', - REVIEWED: 'reviewed', - REVIEW_OPTIONS: 'Review options', - NO_CHANGES: 'No changes', - - DESCRIPTION_1: 'Title of the project', - DESCRIPTION_2: 'Name of the lead researcher, his/her position (and his/her lab)', - DESCRIPTION_3: 'Time scale of the data collection process (range)', - DESCRIPTION_4: 'Theme and purpose of the study', - DESCRIPTION_5: 'Describe the procedure of your study (make sure to list, all potentially difficult or distressing actions that you will require from your participants)', - DESCRIPTION_6: 'Specify the estimated duration of the study, for a single person', - DESCRIPTION_7: 'List all potential risks and uncomfortable activities which can occur to your participants over the course of the study', - DESCRIPTION_8: 'List benefits (if applicable)', - - STUDY_DESCRIPTION_INFO: 'This form will be used to automatically generate the informed consent form that every participant of your study will have to sign. Please fill out the English version and optionally the language-specific version appriopiate for your participants. Depending on the language(s), you will receive the informed consent forms for your experiment', - LANGUAGE_OPTIONS: 'Please select the language, in which you want to generate the informed consent forms', - - DESCRIPTION_1_INFO: '', - DESCRIPTION_2_INFO: '', - DESCRIPTION_3_INFO: 'Specify the period during which you will be collecting the data. If you do not know the exact staring and ending dates, specify in \'month-year\' format.', - DESCRIPTION_4_INFO: 'In a few sentences, describe the theme and purpose of the study (do not get very technical - the content of this box should be understandable to your participants).', - DESCRIPTION_5_INFO: 'Keep this limited to a few sentences. Do not describe the details of your experimental design, but make sure that you mention all important actions which are required from the participants.', - DESCRIPTION_6_INFO: 'Try to give a conservative estimate which will be higher then the average completion time. If you have not used a similar procedure in the past, you can run a simple pilot study to estimate this.', - DESCRIPTION_7_INFO: 'Potential risks include (but are not limited to): walking on stairs, nausea (e.g. in Virtual Reality studies), spending time in confined spaces (e.g. lifts), cycling, operating vehicles (including simple ones like sport equipment), navigating in crowded or heavy-traffic areas, observing quickly changing or blinking stimuli (e.g. in computer-based studies), interacting with potentially strong emotional content (e.g. viewing pictures), wearing any additional electronics (eye-tracker, sensors), any activities that might cause physical effort or pain (e.g. attaching movement sensors to the body).', - DESCRIPTION_8_INFO: 'For instance a monetary payment, or a lottery voucher.', - - CONCERNS_INFO: 'Complete the checklist below. If you have answered \'yes\' to any of the questions, please provide a brief overview of how you are going to ensure ethical conduct with regard to the given risk. This will be reviewed by the Ethics Committee. Remember that any ethical approval granted based on untrue or incomplete disclosure of your research procedure is invalid. The checklist is intended as a guideline and its role is to alert you in cases where you might be proposing an unethical study. Make sure you discuss any concerns with the members of the Ethics Committee.', - - CONCERN_1: 'Will the study involve potentially vulnerable groups of participants or people who are unable or unauthorized to give informed consent', - CONCERN_2: 'Will the study involve deception', - CONCERN_3: 'Will the study involve discussion, judgment or presentation of strongly emotional or sensitive stimuli or topics', - CONCERN_4: 'Will participants be required to eat or drink any potentially allergic substances', - CONCERN_5: 'Will you be in the position of power in relation to your participants', - CONCERN_6: 'Will there be any other live observers present who are invisible to the participant and whose presence will not be disclosed to the participant', - CONCERN_7: 'Can any element of the procedure cause physical pain or more than mild discomfort', - CONCERN_8: 'Can the study cause psychological stress, anxiety or negative emotions stronger than what is experienced naturally on an everyday basis outside of research', - CONCERN_9: 'Will any additional information on your participants be obtained from third parties', - CONCERN_10: 'Does the procedure involve potential moments when the participant is left without the supervision of a researcher in a potentially challenging or dangerous situation in an uncontrolled environment', - CONCERN_11_1: 'Does the study involve audio or film recordings potentially identifying participants', - CONCERN_11_2: 'If yes: Will the study involve any recording without prior consent', - CONCERN_12: 'Is any raw data from the study likely to be passed on to external partners', - CONCERN_13: 'Does the study involve collection of any information without obtaining an Informed Consent in a situation different from public observations or anonymous street surveys', - - CONCERN_1_INFO: 'For instance: children and youth under 18yo, participants with impairments, patients, people assisted by a carer, people recruited from groups associated with a specific mental or physical condition.', - CONCERN_2_INFO: 'That is to say: Will participants be deliberately mislead in such a way that they might show distress or ask to retract their data when debriefed?', - CONCERN_3_INFO: 'For instance: viewing images involving emotional content that participants might want to avoid, discussing topics related to sexuality, asking personal questions in a publicly exposed environment.', - CONCERN_4_INFO: '', - CONCERN_5_INFO: 'That is to say: Does the procedure require you to give orders that participants might hesitate or not wish to perform?', - CONCERN_6_INFO: '', - CONCERN_7_INFO: 'For instance: attaching anything to participant\'s body, requiring participants to perform physically demanding gestures or poses, operating equipment.', - CONCERN_8_INFO: '', - CONCERN_9_INFO: 'If \'yes\': list those parties, approval to use this data (if applicable) and whether participants will be aware of the data aggregation process.', - CONCERN_10_INFO: 'For instance: mobile HCI studies in heavy-traffic areas, navigational tasks in-the-wild without following, Virtual Reality studies.', - CONCERN_11_1_INFO: 'For instance: spoken-aloud personal information, video recording of faces.', - CONCERN_11_2_INFO: '', - CONCERN_12_INFO: 'For instance companies, funding bodies, other universities. If yes: who is responsible for the safety of the passed information?', - CONCERN_13_INFO: 'Excluded cases (select \'no\'): remote sensing data, recordings from public settings allowed by the law, and other situations where the observed individual is expected to be aware of remaining in the public view. Continuous observation of targeted individuals, however, infringes this condition (similarly to how following someone physically in the public is different from observing the same person passing-by).', - - SUBMIT_WARNING: 'You are about to finally submit your Proposal for review by the Ethics-Committee. Please be aware that after this step the Study cannot be changed or modified anymore, until a revised version is requested by the Ethics-Committee.', - DOCUMENT_FILES: 'Download the associated Files', - - - YES: 'yes', - NO: 'no', - EXPLANATION: 'Explanation', - ENGLISH: 'English', - GERMAN: 'German', - PORTUGUESE: 'Portuguese', - - DOWNLOAD_YOUR_FILES: 'Download your files', - DEBRIEFING_INFORMATION: 'Debriefing information', - STATEMENT_OF_RESEARCHER: 'Statement of researcher', - INFORMED_CONSENT_FORM: 'Informed consent form', - REVISE_DOCUMENT: 'Revise document', - - INTRO: 'Introduction', - REQUIRED: 'required', - OPTIONAL: 'optional', - NAME: 'Name', - TIME: 'Time', - RESEARCHER: 'Reseacher(s)', - PURPOSE: 'Purpose', - PROCEDURE: 'Procedure', - DURATION: 'Duration', - RISKS: 'Risks', - BENEFITS: 'Benefits', - - YOU: 'You', - ADMIN: 'admin', - YOUR_DOCUMENT_NEEDS_TO_BE_REVIEWED: 'Your document needs to be reviewed', - DOCUMENT_IS_CURRENTLY_UNDER_REVIEW: 'Your document is currently under review', - DOCUMENT_REVIEWED_SUCCESSFULLY: 'Your document has been reviewed successfully', - DOCUMENT_PARTLY_ACCEPTED: 'Your document has been partly accepted', - YOUR_DOCUMENT_HAS_BEEN_REJECTED: 'Your document has been rejected', - - SHOW_SUBMISSION: 'Show submission', - SHOW_REVIEW: 'Show review', - SUBMISSION: 'Submission', - AND: 'and', - REVIEW: 'Review', - _REVIEW: 'review', - OVERVIEW: 'Overview', - GENERAL: 'General', - REVISIONS: 'Revisions', - STUDY_DESCRIPTION: 'Study description', - STUDY_CONCERNS: 'Study concerns', - YOUR_DOCUMENT: 'Your document', - ALL_REVISIONS: 'All revisions', - LATEST_REVISION: 'Latest revision', - REV: 'rev', - SHOW: 'Show', - HIDE: 'Hide', - SHOW_DOCUMENT: 'Show document', - SHOW_HISTORY: 'Show history', - HIDE_HISTORY: 'Hide history', - SHOW_COMMENTS: 'Show comments', - HIDE_COMMENTS: 'Hide comments', - NOT_USED: 'not used', - - CREATED: 'Created', - SUBMITTED: 'Submitted', - REVIEWERS: 'Reviewers', - LATEST_REVIEWER: 'Latest reviewer', - GENERAL_COMMENT: 'Comment', - AUTHOR: 'Author', - NOTES: 'Notes', - MEMBERS: 'Members', - MEMBER: 'Member', - USERS: 'Users', - USER: 'User', - BLOCKED: 'Blocked', - BLOCKED_USERS: 'Blocked users', - BLOCKED_USER: 'Blocked user', - UNIVERSITIES: 'Universities', - UNIVERSITY: 'University', - INSTITUTES: 'Institutes', - INSTITUTE: 'Institute', - NO_INSTITUTE: 'No institute', - WORKING_GROUP: 'Working group', - WORKING_GROUPS: 'Working groups', - - REVIEW_OPTION_1: 'The user gets access to download the files', - REVIEW_OPTION_2: 'The user has to revise the document and submit it again, until it gets fully accepted', - REVIEW_OPTION_3: 'The user can no longer access the document. (Attention: Use this option only in extreme situations, for example when your comments have been totally ignored in a revised document. In case of violated rules, you can also block the user). In all other cases, please use the option \'partly accept\' to give the user the chance to revise the document and submit it again', - - COURSES: 'Courses', - COURSE: 'Course', - NO_COURSE: 'No course', - RELATED_DOCUMENTS: 'Related documents', - RESPONSIBLE_MEMBERS: 'Responsible members', - RESPONSIBLE_FORMER_MEMBERS: 'Responsible former members', - ATTENTION: 'Attention', - ADMINISTRATOR: 'Administrator', - - SEASON: 'Season', - LECTURERS: 'Lecturer(s)', - - NONE: 'none', - COMMITTEE: 'Committee', - COMMITTEE_MEMBERS: 'Committee members', - COMMITTEE_MEMBER:'Committee member', - FORMER_COMMITTEE_MEMBER:'Former committee member', - FORMER_MEMBERS: 'Former members', - FORMER_MEMBER: 'Former member', - OFFICE: 'Office', - RESPONSIBLE: 'Responsible ', - CURRENTLY_NOT_RESPONSIBLE: 'Currently not responsible', - NOT_RESPONSIBLE_ANYMORE: 'Not responsible anymore', - SUBSCRIBED: 'Subscribed ', - CURRENTLY_NOT_SUBSCRIBED: 'Currently not subscribed', - - FORMER: 'Former', - FORMER_INSTITUTES: 'Former institutes', - FORMER_WORKING_GROUPS: 'Former working groups', - FORMER_WORKING_GROUP: 'Former working group', - RELATED_WORKING_GROUPS: 'Related working groups', - RELATED_FORMER_WORKING_GROUPS: 'Related former working groups', - RELATED_MEMBERS: 'Related members', - RELATED_FORMER_MEMBERS: 'Related former members', - RELATED_USERS: 'Related users', - RELATED_BLOCKED_USERS: 'Related blocked users', - RELATED_INSTITUTES: 'Related institutes', - RELATED_FORMER_INSTITUTES: 'Related former institutes', - RELATED_COURSES: 'Related courses', - - START_REVIEWING: 'Start reviewing', - OPEN_REVIEW: 'Open review', - CLOSE: 'Close', - _CLOSE: 'close', - PUBLISH_REVIEW: 'Publish review', - PARTLY_ACCEPT: 'Partly accept', - ACCEPT: 'Accept', - REJECT: 'Reject', - - NEW_COURSE: 'New course', - EDIT_COURSE: 'Edit course', - COURSE_NAME: 'Course name', - YEAR: 'Year', - TERM: 'Term', - WINTER: 'Winter', - SUMMER: 'Summer', - LECTURER: 'Lecturer(s)', - - EDIT_DOCUMENT_SETTINGS: 'Edit document settings', - EDIT_MEMBER: 'Edit member', - EDIT_USER: 'Edit user', - EDIT_UNIVERSITY: 'Edit university', - EDIT_INSTITUTE: 'Edit institute', - EDIT_WORKING_GROUP: 'Edit working group', - TRUE: 'true', - FALSE: 'false', - - NEW_MEMBER: 'New member', - NEW_USER: 'New user', - NEW_UNIVERSITY: 'New university', - NEW_INSTITUTE: 'New institute', - NEW_WORKING_GROUP: 'New working group', - PLEASE_SELECT_AN_UNIVERSITY: 'Please select an university', - PLEASE_SELECT_AN_INSTITUTE: 'Please select an institute', - PLEASE_SELECT_A_WORKING_GROUP: 'Please select a working group', - - USERNAME: 'Username', - OLD_PASSWORD: 'Old password', - NEW_PASSWORD: 'New password', - REPEATED_PASSWORD: 'Password repeated', - NEW_REPEATED_PASSWORD: 'New password repeated', - ROOM_NUMBER: 'Room number', - PHONE_NUMBER: 'Phone number', - OFFICE_ROOM_NUMBER: 'Office (room number)', - OFFICE_PHONE_NUMBER: 'Office (phone number)', - OFFICE_EMAIL_ADDRESS: 'Office (email-address)', - PLEASE_USE_A_UNIVERSITY_NUMBER: 'Please use an official university number in the format', - - EXPLANATION_OF_THE_ADMIN_ROLE: 'If you give a member admin priviliges, he/she has gets full access to all data in the database and he/she can administrate it. As an administrator you can create new universities, insitutes, working groups, members and update or archive them.', - EXPLANATION_OF_THE_FORMER_STATUS: 'This setting can only be changed by an administrator. It is used to archive your account, sothat you will have no longer access to it. But all data is still be stored in the database and your account can reactivated by the administrator, in case you need access again.', - EXPLANATION_OF_THE_FORMER_STATUS_OF_A_MEMBER: 'With this setting you can archive a member, resulting in the member account no longer being accessible. All data will still be stored in the database. This is the recommended way to remove a Member, as all related reviews will still be stored in the Database.', - EXPLANATION_OF_THE_FORMER_STATUS_OF_AN_INSTITUTE: 'With this setting you can archive an institute. The Institute can no longer be selected by users or members, but all associated data will still be stored in the database. This is the recommended way of removing an institute, as it retains all the assiciated data, while completely deleting an institute also deletes all related working groups, members, users and documents.', - EXPLANATION_OF_THE_FORMER_STATUS_OF_A_WORKING_GROUP: 'With this setting you can archive a working group. The Working Group can no longer be selected by users or members. All data will still be stored in the database. This is the the recommended way to remove a working group, as it retains all the assiciated data, while deleting a working group also, deletes all related working groups, members, users and documents.', - EXPLANATION_OF_THE_SUBSCRIBED_STATUS: 'With this setting you can turn on/off the email notifications notifying you about a document needing your review. If you are in temporarily unavailable, you can turn the subscription off and users and members can see that you are currently not responsible for reviewing.', - EXPLANATION_OF_THE_BLOCKING_STATUS: 'With this setting you can block a user. This is the last measure applied if the user has clearly violated the rules. The user no longer has access to the App until the account is reactivated again.', - - OVERWRITING_INFORMATION: 'You are not the latest reviewer! If you continue, you are going to overwrite the existing review. Please make sure you asked the latest reviewer about the status of the latest review.', - OKAY: 'Okay', - ADMIN_ROLE: 'Admin role', - SUBSCRIBED_STATUS: 'Subscribed status', - FORMER_STATUS: 'Former status', - BLOCKING_STATUS: 'Blocking status', - MIN_LENGTH: 'Please use a password with a minimum of 14 characters', - TOO_SHORT: 'Password too short', - NO_VALID_EMAIL_ADDRESS: 'No valid email-address', - CHANGE_PASSWORD: 'Change password', - DO_NOT_CHANGE_PASSWORD: 'Do not change password', - - CREATING_NEW_MEMBER: 'Creating new committee member', - SAVING_MEMBER: 'Saving committee member', - DELETING_MEMBER: 'Deleting committee member', - - CREATING_NEW_USER: 'Creating new user', - SAVING_USER: 'Saving user', - DELETING_USER: 'Deleting user', - - CREATING_NEW_DOCUMENT: 'Creating new document', - SAVING_DOCUMENT: 'Saving document', - DELETING_DOCUMENT: 'Deleting document', - - CREATING_NEW_COURSE: 'Creating new course', - SAVING_COURSE: 'Saving course', - DELETING_COURSE: 'Deleting course', - - CREATING_NEW_UNIVERSITY: 'Creating new university', - SAVING_UNIVERSITY: 'Saving university', - DELETING_UNIVERSITY: 'Deleting university', - - CREATING_NEW_INSTITUTE: 'Creating new institute', - SAVING_INSTITUTE: 'Saving institute', - DELETING_INSTITUTE: 'Deleting institute', - - CREATING_NEW_WORKING_GROUP: 'Creating new working group', - SAVING_WORKING_GROUP: 'Saving working group', - DELETING_WORKING_GROUP: 'Deleting working group', - - LOADING_APPLICATION: 'Loading application', - LOGGING_IN: 'Logging in', - AUTO_SAVING: 'Auto saving', - - LOADING_DOCUMENT: 'Loading document', - LOADING_DOCUMENTS: 'Loading documents', - LOADING_RELATED_DOCUMENTS: 'Loading related documents', - LOADING_MEMBER: 'Loading committe member', - LOADING_MEMBERS: 'Loading committe members', - LOADING_RELATED_MEMBERS: 'Loading related committe members', - LOADING_USER: 'Loading user', - LOADING_USERS: 'Loading users', - LOADING_RELATED_USERS: 'Loading related users', - LOADING_COURSE: 'Loading course', - LOADING_COURSES: 'Loading courses', - LOADING_RELATED_COURSES: 'Loading related courses', - LOADING_UNIVERSITY: 'Loading university', - LOADING_UNIVERSITIES: 'Loading universities', - LOADING_INSTITUTE: 'Loading institute', - LOADING_INSTITUTES: 'Loading institutes', - LOADING_RELATED_INSTITUTES: 'Loading related institutes', - LOADING_WORKING_GROUP: 'Loading working group', - LOADING_WORKING_GROUPS: 'Loading working groups', - LOADING_RELATED_WORKING_GROUPS: 'Loading related working groups', - LOADING_REVISIONS: 'Loading revisions', - LOADING_SUBMISSION: 'Loading submission', - LOADING_OVERVIEW: 'Loading overview', - LOADING_REVIEW: 'Loading review', - LOADING_ACCOUNT_SETTINGS: 'Loading account settings', - - INITIALISING_NEW_DOCUMENT: 'Initialising new document', - CHECKING_AUTHENTICATION: 'Checking authentication', - - SAVING_ACCOUNT_SETTINGS: 'Saving account settings', - SAVING_NOTES: 'Saving notes', - SAVING_REVIEW: 'Saving review', - PUBLISHING_REVIEW: 'Publishing review', - UPDATING_REVIEWER: 'Updating reviewer', - SEARCHING_FOR_EMAIL_ADDRESS: 'Searching for Email-address', - SEARCHING_FOR_USER: 'Searching for user', - GENERATING_FILES: 'Generating files', - SUBMITTING_DOCUMENT: 'Submitting document', - - ALERT_SIGN_UP_SUCCESSFULL: 'You have successfully signed up, you can now create your document!', - ALERT_PASSWORD_NOT_EQUAL: 'Your passwords are not equal!', - ALERT_RESET_EMAIL_SENT: 'An email to reset your password was sent to you!', - ALERT_RECOVERY_EMAIL_SENT: 'An email with your document-IDs was sent to you!', - ALERT_EMAIL_ADDRESS_NOT_FOUND: 'The email-address could not be found!', - ALERT_DOCUMENT_CREATED: 'Your new document has been created and an email with the document-ID has been sent to you!', - ALERT_SUBMIT_DOCUMENT_FAILED: 'Your document can not be submitted, please fill out all required fields!', - ALERT_FILE_GENERATION_FAILED: 'Files can only be generated, if the document has been accepted!', - - }); - - // Default Language (English) - $translateProvider.preferredLanguage('en_US'); - $translateProvider.useSanitizeValueStrategy('sanitize'); - -}); diff --git a/public/member-client/js/services/documentService.js b/public/member-client/js/services/documentService.js index f7da2a1..b702f81 100644 --- a/public/member-client/js/services/documentService.js +++ b/public/member-client/js/services/documentService.js @@ -119,6 +119,13 @@ app.factory('$documentService', function($http, $log, config, $authenticationSer } }); }, + retrieve_v2: function(document_id) { + return $http.get(config.getApiEndpoint() + "/v2/documents/" + document_id, { + headers: { + 'Authorization': 'Bearer ' + $authenticationService.getToken() + } + }); + }, edit: function(document_id, data) { return $http.put(config.getApiEndpoint() + "/documents/" + document_id, data, { headers: { diff --git a/public/member-client/js/templates/document/list.html b/public/member-client/js/templates/document/list.html index 80efc17..9d5151d 100644 --- a/public/member-client/js/templates/document/list.html +++ b/public/member-client/js/templates/document/list.html @@ -90,14 +90,16 @@
-    +   + +   {{document.document_title}}     {{document.course_name}} | {{document.season}}
-
+
{{ 'INITIALISED' | translate }} {{ 'UNSUBMITTED' | translate }} @@ -108,9 +110,6 @@ {{ 'ACCEPTED' | translate }} {{ 'REJECTED' | translate }} - -   -
diff --git a/public/member-client/js/templates/document/overview.html b/public/member-client/js/templates/document/overview.html index fda7abc..d73d112 100644 --- a/public/member-client/js/templates/document/overview.html +++ b/public/member-client/js/templates/document/overview.html @@ -5,7 +5,7 @@
{{ 'OVERVIEW' | translate }}
-
+
-
-
-
+
+ + +
diff --git a/public/user-client/js/templates/status/5.html b/public/user-client/js/templates/status/5.html index a1368ee..b167d50 100644 --- a/public/user-client/js/templates/status/5.html +++ b/public/user-client/js/templates/status/5.html @@ -14,9 +14,7 @@
+ {{#concern.q06_value}} +   + {{/concern.q06_value}} {{concern.q06_sign}}
@@ -358,6 +381,9 @@
Ethical concerns
+ {{#concern.q07_value}} +   + {{/concern.q07_value}} {{concern.q07_sign}}
@@ -376,6 +402,9 @@
Ethical concerns
+ {{#concern.q08_value}} +   + {{/concern.q08_value}} {{concern.q08_sign}}
@@ -394,6 +423,9 @@
Ethical concerns
+ {{#concern.q09_value}} +   + {{/concern.q09_value}} {{concern.q09_sign}}
@@ -412,6 +444,9 @@
Ethical concerns
+ {{#concern.q10_value}} +   + {{/concern.q10_value}} {{concern.q10_sign}}
@@ -430,6 +465,9 @@
Ethical concerns
+ {{#concern.q11_1_value}} +   + {{/concern.q11_1_value}} {{concern.q11_1_sign}}
@@ -448,6 +486,9 @@
Ethical concerns
+ {{#concern.q11_2_value}} +   + {{/concern.q11_2_value}} {{concern.q11_2_sign}}
@@ -466,6 +507,9 @@
Ethical concerns
+ {{#concern.q12_value}} +   + {{/concern.q12_value}} {{concern.q12_sign}}
@@ -484,6 +528,9 @@
Ethical concerns
+ {{#concern.q13_value}} +   + {{/concern.q13_value}} {{concern.q13_sign}}
@@ -502,6 +549,9 @@
Ethical concerns
+ {{#concern.q14_value}} +   + {{/concern.q14_value}} {{concern.q14_sign}}
@@ -514,7 +564,7 @@
Ethical concerns