diff --git a/routes/receive.js b/routes/receive.js
index 0aadac2..65e84ed 100644
--- a/routes/receive.js
+++ b/routes/receive.js
@@ -41,6 +41,7 @@ router.get(router.servePagePath + ':id', function (req, res, next) {
res.render('receive', {
isLocal: typeof process.env.OPENSHIFT_NODEJS_IP === "undefined",
jdropitVersion: global.DROP_IT_VERSION,
+ infoMessage : typeof process.env.USER_INFO_MESSAGE === "undefined" ? "" : process.env.USER_INFO_MESSAGE,
dumbContent : "",
fileName: sender.fileName,
fileSize: sender.fileSize,
diff --git a/routes/send.js b/routes/send.js
index 6a287dc..3a6e8d4 100644
--- a/routes/send.js
+++ b/routes/send.js
@@ -38,10 +38,11 @@ var dumbQuotes = ["Let us ease your file transfers",
/* GET home page. */
router.get('/', function(req, res) {
- debug('serving send');
+ debug('serving view');
res.render('send', {
isLocal : typeof process.env.OPENSHIFT_NODEJS_IP === "undefined",
jdropitVersion : global.DROP_IT_VERSION,
+ infoMessage : typeof process.env.USER_INFO_MESSAGE === "undefined" ? "" : process.env.USER_INFO_MESSAGE,
dumbContent : dumbQuotes[Math.floor(Math.random() * dumbQuotes.length)]
});
});
diff --git a/views/about.pug b/views/about.pug
index 5c482ae..e9fe33e 100644
--- a/views/about.pug
+++ b/views/about.pug
@@ -19,6 +19,17 @@
You should have received a copy of the GNU General Public License
along with just-drop-it. If not, see .
extends modal_layout
+block modal_extra_scripts
+ script.
+ function handleInfoMessage() {
+ if ("#{infoMessage}".length > 0) {
+ $('#info_message_content').text("#{infoMessage}");
+ } else {
+ $('#info_message_header').hide();
+ $('#info_message_content').hide();
+ }
+ }
+
block modal_title
| About
block modal_body
@@ -31,6 +42,8 @@ block modal_body
ul
li Arnaud Ruffin
li Benjamin Einaudi
+ h5#info_message_header Info
+ p#info_message_content
h5 Contact
p Any question, suggestion or even contribution, please visit our project on
a(title="github" href="https://github.com/Orange-OpenSource/just-drop-it") GitHub
diff --git a/views/modal_layout.pug b/views/modal_layout.pug
index 1be5f0e..1a195f9 100644
--- a/views/modal_layout.pug
+++ b/views/modal_layout.pug
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License
along with just-drop-it. If not, see .
-
+block modal_extra_scripts
div.modal.fade(tabindex="-1" role="dialog" aria-hidden="true")
div.modal-dialog(role="document")
div.modal-content
diff --git a/views/receive.pug b/views/receive.pug
index 3b81b04..5cd72d3 100644
--- a/views/receive.pug
+++ b/views/receive.pug
@@ -32,6 +32,7 @@ block extra_scripts
window.onload = function(){
receiverHandler = new ReceiverHandler(#{isLocal}, "#{senderId}","#{fileName}",#{fileSize});
enableNotifications();
+ handleInfoMessage();
}
block content
div.row#transferContainer
diff --git a/views/send.pug b/views/send.pug
index f8d199f..f8f7149 100644
--- a/views/send.pug
+++ b/views/send.pug
@@ -40,6 +40,7 @@ block extra_scripts
window.onload = function(){
sendFile(#{isLocal});
enableNotifications();
+ handleInfoMessage();
}
block content
diff --git a/views/user_messages.pug b/views/user_messages.pug
index c37970f..3b95087 100644
--- a/views/user_messages.pug
+++ b/views/user_messages.pug
@@ -20,23 +20,29 @@
along with just-drop-it. If not, see .
script.
- function appendError(message) {
- var rowDiv = $("
", {role:"alert"}).addClass("alert alert-danger alert-dismissible fade in");
- var buttonProperties = {type : "button"};
+ function _appendMessage(message, alert){
+ var rowDiv = $("
", {role: "alert"})
+ .addClass("alert")
+ .addClass(alert? "alert-danger": "alert-info")
+ .addClass("alert-dismissible fade in");
+ var buttonProperties = {type: "button"};
buttonProperties["data-dismiss"] = "alert";
buttonProperties["aria-label"] = "Close";
var spanProperties = {};
spanProperties["aria-hidden"] = "true";
rowDiv.append(
- $("