Skip to content

Commit

Permalink
Merge branch 'dev' into feature/custom_file_upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeckiJ authored Mar 28, 2018
2 parents e360ac6 + fa5296e commit 80b13f0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Version 1.4.1
- Added Email Notification to all Members when Review is started (and not pending anymore)
- Added q14 (Custom Files)
- Added Password Generation on Cover Sheet
- bugfixes & style improvements

# Version 1.4.0
- Added Reminder Email to be sent out after 7 days of inactivity with still pending reviews.
Expand Down
13 changes: 13 additions & 0 deletions controllers/documents/generate_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var moment = require('moment');
var pool = require('../../server.js').pool;
var pdf = require('html-pdf');
var uuid = require("uuid");
var crypto = require('crypto');

var fs = require("fs");
var dir_1 = "/../../templates/pdfs/";
Expand Down Expand Up @@ -163,11 +164,23 @@ exports.request = function(req, res) {
// Create files
async.parallel([
function(callback) { // Generate Cover Sheet

// create distinguishable password
var psw = crypto.randomBytes(32)
.toString('base64')
.replace("1","R")
.replace("I","A")
.replace("0","M")
.replace("O","P")
.replace("U","F")
.replace("V","Z")
.replace("Q","X");
// Render HTML-content
var html = mustache.render(template_cover_sheet, {
document: document,
description: description,
revision: revision,
veracryptpassword: psw,
year: moment().format("YYYY")
});

Expand Down
6 changes: 3 additions & 3 deletions public/translations/en_US.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ app.constant("en_US", {

YES: 'yes',
NO: 'no',
EXPLANATION: 'Explanation',
EXPLANATION: 'Please add a detailed explanation of the problem and how you will solve it in your study.',
ENGLISH: 'English',
GERMAN: 'German',
PORTUGUESE: 'Portuguese',
Expand Down Expand Up @@ -332,9 +332,9 @@ app.constant("en_US", {
SUBMITTED: 'Submitted',
REVIEWERS: 'Reviewers',
LATEST_REVIEWER: 'Latest reviewer',
GENERAL_COMMENT: 'Comment',
GENERAL_COMMENT: 'Comment for Researcher',
AUTHOR: 'Author',
NOTES: 'Notes',
NOTES: 'Notes (only viewable by Members)',
MEMBERS: 'Members',
MEMBER: 'Member',
USERS: 'Users',
Expand Down
12 changes: 6 additions & 6 deletions public/user-client/js/templates/document/revise.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ <h6>
</div>
</div>
<span ng-if="!$first">
<i>{{revision.descriptions.en_title}}</i><br>
<i>{{revision.descriptions.en_researcher}}</i><br>
</span>
<span ng-if="!$first && status.descriptions.comments.en">
<span class="comment" ng-if="revision.comments.en_researcher_comment !== null && revision.comments.en_researcher_comment !== ''">
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.en_title_comment}}
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.en_researcher_comment}}
</span>
</span>
</div>
Expand Down Expand Up @@ -721,11 +721,11 @@ <h6>
</div>
</div>
<span ng-if="!$first">
<i>{{revision.descriptions.de_title}}</i><br>
<i>{{revision.descriptions.de_researcher}}</i><br>
</span>
<span ng-if="!$first && status.descriptions.comments.en">
<span class="comment" ng-if="revision.comments.de_researcher_comment !== null && revision.comments.de_researcher_comment !== ''">
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.de_title_comment}}
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.de_researcher_comment}}
</span>
</span>
</div>
Expand Down Expand Up @@ -1166,11 +1166,11 @@ <h6>
</div>
</div>
<span ng-if="!$first">
<i>{{revision.descriptions.pt_title}}</i><br>
<i>{{revision.descriptions.pt_researcher}}</i><br>
</span>
<span ng-if="!$first && status.descriptions.comments.en">
<span class="comment" ng-if="revision.comments.pt_researcher_comment !== null && revision.comments.pt_researcher_comment !== ''">
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.pt_title_comment}}
<i class="fa fa-comment-o" aria-hidden="true"></i>&nbsp;&nbsp;{{revision.comments.pt_researcher_comment}}
</span>
</span>
</div>
Expand Down
33 changes: 20 additions & 13 deletions templates/pdfs/cover_sheet.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,43 @@ <h1 style="width:100%; text-align: center;">Cover sheet for research study</h1>
<p style="text-align: justify;">
<b>Document ID:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: red">
<p style="border: 2px solid black; padding: 10px; color: black">
{{document.document_id}}
</p>
<br>
<p style="text-align: justify;">
<b>Revision:</b>
<b>Name of the Researcher:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: red">
{{revision.version}}
<p style="border: 2px solid black; padding: 10px; color: black">
{{description.en_researcher}}
</p>
<br>
<p style="text-align: justify;">
<b>Date of last Revision:</b>
<b>Title of study:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: red">
{{revision.updated}}
<p style="border: 2px solid black; padding: 10px; color: black">
{{document.document_title}}
</p>
<br>
<p style="text-align: justify;">
<b>Name of the Researcher:</b>
<b>Revision Number:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: red">
{{description.en_researcher}}
<p style="border: 2px solid black; padding: 10px; color: black">
{{revision.version}}
</p>
<br>
<p style="text-align: justify;">
<b>Title of study:</b>
<b>Date of last Revision:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: red">
{{document.document_title}}
<p style="border: 2px solid black; padding: 10px; color: black">
{{revision.updated}}
</p>
<br>
<p style="text-align: justify;">
<b>Veracrypt Password:</b>
</p>
<p style="border: 2px solid black; padding: 10px; color: black">
{{veracryptpassword}}
</p>
</div>
</body>

0 comments on commit 80b13f0

Please sign in to comment.