Added newsletter viewing page

This commit is contained in:
Zak Timson
2017-09-03 17:02:57 -04:00
parent 18498b10bf
commit 54218c4298
4 changed files with 54 additions and 7 deletions

View File

@ -0,0 +1,42 @@
{% extends 'base.html' %}
{% block body %}
<style>
.newsletter-header {
cursor: pointer;
}
.newsletter-header:hover {
background-color: rgba(0, 0, 0, 0.1)
}
</style>
<div class="container-fluid bg-dark-primary">
<div class="container py-3">
{% for newsletter in newsletters %}
<div class="col-12 p-0 mb-3 bg-white newsletter">
<div class="p-3 newsletter-header">
<h2>{{ newsletter.subject }}</h2>
<span class="text-muted">By: {{ newsletter.creator }}</span>
<span class="text-muted float-right">{{ newsletter.publish }}</span>
</div>
<div class="bg-light-blue p-3 newsletter-body" style="display:none;">
<span>{{ newsletter.body }}</span>
</div>
</div>
{% endfor %}
</div>
</div>
<script>
$('.newsletter').click(function() {
var content = $('.newsletter-body', this);
if(content.css('display') == 'block') {
content.slideUp()
} else {
content.slideDown()
}
})
</script>
{% endblock %}