- Add custom message support

This commit is contained in:
Paulo Gustavo Veiga
2012-06-16 11:37:40 -03:00
parent 9836ffdecf
commit 2f52856ea1
9 changed files with 437 additions and 398 deletions

View File

@@ -1,41 +1,39 @@
<html>
<body>
<div style="background-color: #fbeed5; max-width: 650px; font-family: Arial, sans-serif; color: #000; padding: 5px;">
<div style="height: 60px; font-size: 14px; font-weight: bold; padding-bottom: 4px;">
<table style="display: inline;width: 100%;">
<tbody>
<tr>
<td height="50px" width="2px"
style="padding: 0; padding-right: 5px; text-align:center;font-weight: normal;font-family: Arial, sans-serif">
<a href="${baseUrl}">
<img style="border: 0;margin-top: 10px;"
src="${baseUrl}/images/logo-small.png"
alt="WiseMapping Log"/>
</a>
</td>
<td valign="bottom" height="32px" style="padding: 0;font-size: 16px;">I've shared <a
href='${mapEditUrl}'>
${mindmap.title}</a> mindmap with you.
</td>
</tr>
</tbody>
</table>
</div>
<div style="font-size: 13px; background-color: #FFF; padding: 10px 7px 7px 7px; min-height: 100px">
#if( ! $message )
<p>${message}</p>
#end
<p>Click to open: <a href="${mapEditUrl}">${mindmap.title}</a></p>
<br/>
<p style="color: #898989;">Do you have a WiseMapping account ?. Don't worry, you can create an account for
free. </p>
</div>
</div>
<p style="font-size: 13px;font-family: Arial, sans-serif">Important: Do not reply this email. If
you need to contact mindmap sender, you can send an email clicking <a href="mailto:${senderMail}">here</a>.
</p>
</body>
<html>
<body>
<div style="background-color: #fbeed5; max-width: 650px; font-family: Arial, sans-serif; color: #000; padding: 5px;">
<div style="height: 60px; font-size: 14px; font-weight: bold; padding-bottom: 4px;">
<table style="display: inline;width: 100%;">
<tbody>
<tr>
<td height="50px" width="2px"
style="padding: 0; padding-right: 5px; text-align:center;font-weight: normal;font-family: Arial, sans-serif">
<a href="${baseUrl}">
<img style="border: 0;margin-top: 10px;"
src="${baseUrl}/images/logo-small.png"
alt="WiseMapping Log"/>
</a>
</td>
<td valign="bottom" height="32px" style="padding: 0;font-size: 16px;">I've shared <a
href='${mapEditUrl}'>
${mindmap.title}</a> mindmap with you.
</td>
</tr>
</tbody>
</table>
</div>
<div style="font-size: 13px; background-color: #FFF; padding: 10px 7px 7px 7px; min-height: 100px">
#if($message )
<pre style="font-family: Arial, sans-serif; color: #000; ">${message}</pre>
#end
<p>Click to open: <a href="${mapEditUrl}">${mindmap.title}</a></p>
<p style="color: #898989;">Do you have a WiseMapping account ?. Don't worry, you can create an account for
free. </p>
</div>
</div>
<p style="font-size: 13px;font-family: Arial, sans-serif">Important: Do not reply this email. If
you need to contact mindmap sender, you can send an email clicking <a href="mailto:${senderMail}">here</a>.
</p>
</body>
</html>

View File

@@ -13,13 +13,26 @@
}
#collabEmails {
float: left;
width: 300px;
display: inline-block;
vertical-align: middle;
margin-bottom: 0;
}
#roleBtn {
float: left;
margin: 0px 10px;
margin: 0 10px;
display: inline-block;
vertical-align: middle;
}
#addBtn {
display: inline-block;
vertical-align: middle;
}
#collabMessage {
display: block;
width: 100%;
}
</style>
@@ -38,25 +51,43 @@
<div class="well">
<div id="errorMsg" class="alert alert-error"></div>
<p>Add People: </p>
<input type="text" id="collabEmails" name="collabEmails"
placeholder="Enter collaborators emails separared by comas."/>
<div>
<div class="btn-group" id="roleBtn">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Can edit
<span class="caret"> </span>
</a>
<ul class="dropdown-menu" data-role="editor" id="shareRole">
<li><a href="#" data-role="editor">Can edit</a></li>
<li><a href="#" data-role="viewer">Can view</a></li>
</ul>
<p><strong>Add People:</strong></p>
<input type="text" id="collabEmails" name="collabEmails"
placeholder="Enter collaborators emails separared by comas."/>
<div class="btn-group" id="roleBtn">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Can edit
<span class="caret"> </span>
</a>
<ul class="dropdown-menu" data-role="editor" id="shareRole">
<li><a href="#" data-role="editor">Can edit</a></li>
<li><a href="#" data-role="viewer">Can view</a></li>
</ul>
</div>
<button id="addBtn" class="btn btn-primary">Add</button>
</div>
<div style="margin-top: 10px;">
<p><strong>Notify people via email</strong> - <a href="#" id="addMessageLink">Add message</a></p>
<textarea cols="4" id="collabMessage" placeholder="Optional: Include a personal message">
</textarea>
</div>
<button id="addBtn" class="btn btn-primary">Add</button>
</div>
<script type="text/javascript">
$("#errorMsg").hide();
$("#collabMessage").hide();
$("#addMessageLink").click(function(event) {
$("#collabMessage").toggle().val("");
event.preventDefault();
});
var messages = {
owner: 'Is owner',
editor: 'Can edit',
@@ -248,6 +279,7 @@ var submitDialogForm = function() {
collabs.collaborations = jQuery.grep(collabs.collaborations, function() {
return this.role != 'owner';
});
collabs['message'] = $("#collabMessage").val();
jQuery.ajax("service/maps/${mindmap.id}/collabs", {
async:false,