Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions esp/templates/admin/emails.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
<td style="text-align:center;">{{ req.num_sent }}</td>
</tr>
<tr class="email-details">
{% autoescape off %}
<td colspan="3" style="vertical-align:top;">{{ req.msgtext }}</td>
{% endautoescape %}
<td colspan="3" style="vertical-align:top;">
<iframe srcdoc="{{ req.msgtext|join:""|escape }}" style="width: 100%; max-height: 600px;"></iframe>
</td>
<td colspan="2" style="vertical-align:top;padding:0;"><table>
<tr><td><i>Sent by:</i><br /><a href="/manage/userview?username={{ req.creator|urlencode }}">{{ req.creator }}</a></td></tr>
<tr><td><i>Sending address:</i><br />{{ req.sender }}</td></tr>
Expand All @@ -96,7 +96,10 @@
$j(function() {
$j("tr.email-header").click(function(event) {
var $target = $j(event.target).parent("tr.email-header");
$target.next("tr").toggle();
var $row = $target.next("tr");
$row.toggle();
var iframe = $row.find("iframe")[0];
iframe.style.height = iframe.contentWindow.document.body.scrollHeight + 16 + 'px';
if ($target.find("td:first").html() == "+") {
$target.find("td:first").html("-");
} else {
Expand Down
14 changes: 11 additions & 3 deletions esp/templates/program/modules/commmodule/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ <h2>Preview</h2>
<p>
<strong>Email body:</strong>
<br />
{% autoescape off %}
{{ rendered_text }}
{% endautoescape %}
<iframe srcdoc="{{ rendered_text|join:""|escape }}" style="width: 100%; max-height: 800px;"></iframe>
<br />
</p>

Expand Down Expand Up @@ -97,4 +95,14 @@ <h2>Preview</h2>
<input type="submit" value="Send Message!" id="submitform" class="btn btn-primary" />
</form>

<script>
$j(function() {
$j("iframe").each(function(index, element) {
element.onload = function() {
element.style.height = element.contentWindow.document.body.scrollHeight + 16 + 'px';
}
});
});
</script>

{% endblock %}
17 changes: 12 additions & 5 deletions esp/templates/public_email.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ <h1>Email Public View</h1>

<h2 id="subject">Subject: <u>{{ email_req.subject }}</u></h2>
<h2>Send Date: {{ email_req.created_at|date:"DATE_FORMAT" }}</h2>
<h2>Message Text:</h2>
{% autoescape off %}
<h2>Message Body:</h2>
<div id="msgtext">
<p>{{ email_req.msgtext }}</p>
<iframe srcdoc="{{ email_req.msgtext|join:""|escape }}" style="width: 100%; max-height: 800px;"></iframe>
</div>
{% endautoescape %}


<script>
$j(function() {
$j("iframe").each(function(index, element) {
element.onload = function() {
element.style.height = element.contentWindow.document.body.scrollHeight + 16 + 'px';
}
});
});
</script>

{% endblock %}
Loading