template updates and suporting files

This commit is contained in:
Raymond Jessop 2025-04-18 16:02:09 -05:00
parent 36ab722d2b
commit 3113fb953f
6 changed files with 130 additions and 93 deletions

View File

@ -1,4 +1,4 @@
include LICENSE include LICENSE
include README.md include README.md
recursive-include django_aws_ses/templates *.html recursive-include django_aws_ses/templates *.html
recursive-include django_aws_ses/static *.css *.js recursive-include django_aws_ses/static *.css *.js *.ico

View File

@ -0,0 +1,20 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
color: #333;
background-color: #fff;
line-height: 1.6;
}
#body_container.cardContent {
max-width: 1200px;
margin: 20px auto;
padding: 0 20px;
box-sizing: border-box;
}
@media (max-width: 768px) {
#body_container.cardContent {
padding: 0 10px;
}
}

View File

@ -1,14 +1,19 @@
{% load static %} {% load static %}
<!DOCTYPE html> <!DOCTYPE html>
<html> <html lang="en">
<head> <head>
<title>{% block title1 %}N/A {% endblock title1 %} | {% block title2 %} {{ site.domain }}{% endblock title2 %}</title> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title1 %}N/A{% endblock title1 %} | {% block title2 %}{{ site.domain|escape }}{% endblock title2 %}</title>
<link rel="stylesheet" href="{% static 'django_aws_ses/css/base.css' %}">
<link rel="icon" href="{% static 'django_aws_ses/favicon.ico' %}" type="image/x-icon">
{% block extrahead %}{% endblock extrahead %}
</head> </head>
<body> <body>
<div id="body_contaner" class=" cardContenet"> <div id="body_container" class="cardContent">
{% block content %} {% block content %}
if you see this, something is wrong! If you see this, something is wrong!
{% endblock content %} {% endblock content %}
</div> </div>
</body> </body>
</html> </html>

View File

@ -1,41 +1,59 @@
{% extends "admin/base_site.html" %} {% extends "admin/base_site.html" %}
{% load static %}
{% block extrastyle %} {% block extrastyle %}
{{ block.super }} {{ block.super }}
<style>table {width: 100%;}</style> <link rel="stylesheet" href="{% static 'django_aws_ses/css/send_stats.css' %}">
{% endblock %} {% endblock %}
{% block extrahead %} {% block extrahead %}
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script src="{% static 'django_aws_ses/js/chart.min.js' %}"></script>
<script type="text/javascript"> <script>
google.load("visualization", "1", {packages:["corechart"]}); document.addEventListener('DOMContentLoaded', function () {
google.setOnLoadCallback(drawChart); const ctx = document.getElementById('chart').getContext('2d');
function drawChart() { new Chart(ctx, {
var data = new google.visualization.DataTable(); type: 'line',
data.addColumn('string', 'Time'); data: {
data.addColumn('number', 'Delivery Attempts'); labels: [{% for dp in datapoints %}'{% if local_time %}{{ dp.Timestamp }}{% else %}{{ dp.Timestamp|slice:"11:19" }} {{ dp.Timestamp|slice:":10" }}{% endif %}'{% if not forloop.last %},{% endif %}{% endfor %}],
data.addColumn('number', 'Bounces'); datasets: [
data.addColumn('number', 'Complaints'); {
data.addColumn('number', 'Rejected'); label: 'Delivery Attempts',
data.addRows({{ datapoints|length }}); data: [{% for dp in datapoints %}{{ dp.DeliveryAttempts }}{% if not forloop.last %},{% endif %}{% endfor %}],
{% for datapoint in datapoints %} borderColor: '#4bc0c0',
data.setValue({{ forloop.counter0 }}, 0, {% if local_time %}'{{ datapoint.Timestamp }}'{% else %}'{{ datapoint.Timestamp|slice:"11:19" }} {{ datapoint.Timestamp|slice:":10" }}'{% endif %}); fill: false
data.setValue({{ forloop.counter0 }}, 1, {{ datapoint.DeliveryAttempts }}); },
data.setValue({{ forloop.counter0 }}, 2, {{ datapoint.Bounces }}); {
data.setValue({{ forloop.counter0 }}, 3, {{ datapoint.Complaints }}); label: 'Bounces',
data.setValue({{ forloop.counter0 }}, 4, {{ datapoint.Rejects }}); data: [{% for dp in datapoints %}{{ dp.Bounces }}{% if not forloop.last %},{% endif %}{% endfor %}],
{% endfor %} borderColor: '#ff6384',
fill: false
var chart = new google.visualization.LineChart(document.getElementById('chart')); },
chart.draw(data, { {
width: 498, label: 'Complaints',
height: 300, data: [{% for dp in datapoints %}{{ dp.Complaints }}{% if not forloop.last %},{% endif %}{% endfor %}],
title: 'Sending Stats', borderColor: '#ffcd56',
hAxis: {textPosition: 'none'}, fill: false
chartArea: {left:30,top:30,width:460,height:230}, },
legend: 'bottom' {
label: 'Rejects',
data: [{% for dp in datapoints %}{{ dp.Rejects }}{% if not forloop.last %},{% endif %}{% endfor %}],
borderColor: '#36a2eb',
fill: false
}
]
},
options: {
responsive: true,
plugins: {
legend: { position: 'bottom' },
title: { display: true, text: 'Sending Stats' }
},
scales: {
x: { display: false }
}
}
});
}); });
}
</script> </script>
{% endblock %} {% endblock %}
@ -43,25 +61,24 @@
{% block content_title %}<h1>SES Stats</h1>{% endblock %} {% block content_title %}<h1>SES Stats</h1>{% endblock %}
{% block content %} {% block content %}
<p>Access Key: <span id="aws_access_key_id">{{ access_key }}</span></p>
<div id="content-main"> <div id="content-main">
<div class="module"> <div class="module">
<table id="quota"> <table id="quota">
<caption>Quotas</caption> <caption>Quotas</caption>
<thead> <thead>
<tr> <tr>
<th>24 Quota</th> <th>24h Quota</th>
<th>24 Sent</th> <th>24h Sent</th>
<th>Quota Remaining</th> <th>Quota Remaining</th>
<th>Per/s Quota</th> <th>Per/s Quota</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{ 24hour_quota }}</td> <td>{{ 24hour_quota|floatformat:0 }}</td>
<td>{{ 24hour_sent }}</td> <td>{{ 24hour_sent|floatformat:0 }}</td>
<td>{{ 24hour_remaining }}</td> <td>{{ 24hour_remaining|floatformat:0 }}</td>
<td>{{ persecond_rate }}</td> <td>{{ persecond_rate|floatformat:2 }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -80,44 +97,44 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{ summary.DeliveryAttempts }}</td> <td>{{ summary.DeliveryAttempts|default:0 }}</td>
<td>{{ summary.Bounces }}</td> <td>{{ summary.Bounces|default:0 }}</td>
<td>{{ summary.Complaints }}</td> <td>{{ summary.Complaints|default:0 }}</td>
<td>{{ summary.Rejects }}</td> <td>{{ summary.Rejects|default:0 }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div id="chart"></div> <canvas id="chart"></canvas>
</div> </div>
<div class="module"> <div class="module">
<table id="sending_stats"> <table id="sending_stats">
<caption>Sending Activity</caption> <caption>Sending Activity</caption>
<thead> <thead>
<tr> <tr>
<th style="width:35px">Delivery Attempts</th> <th>Delivery Attempts</th>
<th>Bounces</th> <th>Bounces</th>
<th>Complaints</th> <th>Complaints</th>
<th>Rejected</th> <th>Rejected</th>
<th>{% if local_time %}Local Time{% else %}Timestamp{% endif %}</th> <th>{% if local_time %}Local Time{% else %}Timestamp{% endif %}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for datapoint in datapoints %} {% for datapoint in datapoints %}
<tr> <tr>
<td>{{ datapoint.DeliveryAttempts }}</td> <td>{{ datapoint.DeliveryAttempts|default:0 }}</td>
<td>{{ datapoint.Bounces }}</td> <td>{{ datapoint.Bounces|default:0 }}</td>
<td>{{ datapoint.Complaints }}</td> <td>{{ datapoint.Complaints|default:0 }}</td>
<td>{{ datapoint.Rejects }}</td> <td>{{ datapoint.Rejects|default:0 }}</td>
<td>{{ datapoint.Timestamp }}</td> <td>{{ datapoint.Timestamp|escape }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block sidebar %} {% block sidebar %}
<div id="content-related"> <div id="content-related">
<div class="module" id="recent-actions-module"> <div class="module" id="recent-actions-module">
@ -129,11 +146,11 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for email_address in verified_emails %} {% for email_address in verified_emails %}
<tr> <tr>
<td>{{ email_address }}</td> <td>{{ email_address|escape }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
<tfoot> <tfoot>
<tr><td><strong>{{ verified_emails|length }}</strong></td></tr> <tr><td><strong>{{ verified_emails|length }}</strong></td></tr>
@ -141,4 +158,4 @@
</table> </table>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -1,11 +0,0 @@
{% extends base_template_name %}
{% block title1 %}
Unsubscribe
{% endblock title1 %}
{% block content %}
<div>
<h3>{{ unsubscribe_message }}</h3>
</div>
{% endblock content %}

View File

@ -1,11 +1,17 @@
{% extends base_template_name %} {% extends 'django_aws_ses/base.html' %}
{% load static %}
{% block title1 %} {% block extrahead %}
Unsubscribe <link rel="stylesheet" href="{% static 'django_aws_ses/css/unsubscribe.css' %}">
{% endblock title1 %} {% endblock %}
{% block content %} {% block title1 %}Unsubscribe{% endblock title1 %}
<div>
<h3>{{ unsubscribe_message }}</h3> {% block content %}
<div class="unsubscribe-container">
<h3>{{ unsubscribe_message|escape }}</h3>
<p>You have been successfully unsubscribed from our email list.</p>
<p>Changed your mind? <a href="{% url 'django_aws_ses:aws_ses_unsubscribe' uuid=uuid hash=hash %}?resubscribe=1">Re-subscribe</a></p>
<p>Return to <a href="{{ home_url|default:'/' }}">home</a>.</p>
</div> </div>
{% endblock content %} {% endblock content %}