Permalink
Browse files

Add share data to invitation message. Close #1153

  • Loading branch information...
1 parent fada3e7 commit 6b7fb0353531deafa8cfb7615fd043b8c7d63821 @cdujeu cdujeu committed Sep 29, 2016
Showing with 17 additions and 1 deletion.
  1. +17 −1 core/src/plugins/action.share/res/react/model/ShareModel.js
@@ -891,7 +891,23 @@
s = MessageHash["share_center.42"];
if(s) s = s.replace("%s", ApplicationTitle);
link = this.getPublicLink(linkId);
- message = s + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
+ let additionalData = '';
+ let password = this.hasHiddenPassword(linkId);
+ if(password){
+ additionalData += '\n - ' + MessageHash['share_center.170'] + '.';
+ }
+ let dlLimit = this.getExpirationFor(linkId, 'downloads');
+ if(dlLimit){
+ additionalData += '\n - ' + MessageHash['share_center.22'] + ': ' + dlLimit;
+ }
+ let expirationDate = this.getExpirationFor(linkId, 'days');
+ if(expirationDate){
+ let today = new Date();
+ let expDate = new Date();
+ expDate.setDate(today.getDate() + parseInt(expirationDate));
+ additionalData += '\n - ' + MessageHash['share_center.21'] + ': ' + expDate.toLocaleDateString();
+ }
+ message = s + additionalData + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
}else{
if(!this._data['repository_url']){
throw new Error(MessageHash['share_center.230']);

0 comments on commit 6b7fb03

Please sign in to comment.