This commit is contained in:
Ross
2022-04-26 22:48:56 +01:00
parent ca669b0808
commit 206a0c0213
3 changed files with 43 additions and 36 deletions
+3
View File
@@ -450,6 +450,9 @@ class CidUser(models.Model):
self.save() self.save()
return True, "" return True, ""
def get_email_details_url(self):
return reverse("generic:candidate_email_details", kwargs={"cid": self.cid})
def get_email_results_url(self): def get_email_results_url(self):
return reverse("generic:candidate_email_results", kwargs={"cid": self.cid}) return reverse("generic:candidate_email_results", kwargs={"cid": self.cid})
+38 -34
View File
@@ -7,8 +7,12 @@
<div class="sending"><div class="lds-ripple"><div></div><div></div></div> Emailing <span id="active-email"></span></div> <div class="sending"><div class="lds-ripple"><div></div><div></div></div> Emailing <span id="active-email"></span></div>
<ul id="user-list"> <ul id="user-list">
{% for user in users %} {% for user in users %}
<li data-email={{user.email}} <li data-email={{user.email}}
data-posturl='{{user.get_email_results_url}}' {% if results %}
data-posturl='{{user.get_email_results_url}}'
{% else %}
data-posturl='{{user.get_email_details_url}}'
{% endif %}
>{{user.cid}}/{{user.name}}: {{user.email}} [{{user.supervisor_email}}] </li> >{{user.cid}}/{{user.name}}: {{user.email}} [{{user.supervisor_email}}] </li>
{% endfor %} {% endfor %}
</ul> </ul>
@@ -86,38 +90,38 @@
} }
.lds-ripple { .lds-ripple {
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 80px; width: 80px;
height: 80px; height: 80px;
} }
.lds-ripple div { .lds-ripple div {
position: absolute; position: absolute;
border: 4px solid blue; border: 4px solid blue;
opacity: 1; opacity: 1;
border-radius: 50%; border-radius: 50%;
animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite; animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
} }
.lds-ripple div:nth-child(2) { .lds-ripple div:nth-child(2) {
animation-delay: -0.5s; animation-delay: -0.5s;
} }
@keyframes lds-ripple { @keyframes lds-ripple {
0% { 0% {
top: 36px; top: 36px;
left: 36px; left: 36px;
width: 0; width: 0;
height: 0; height: 0;
opacity: 1; opacity: 1;
} }
100% { 100% {
top: 0px; top: 0px;
left: 0px; left: 0px;
width: 72px; width: 72px;
height: 72px; height: 72px;
opacity: 0; opacity: 0;
} }
} }
</style> </style>
+2 -2
View File
@@ -1527,7 +1527,7 @@ def group_email(request, pk, resend=False):
request, request,
"generic/group_emailed.html", "generic/group_emailed.html",
# {"sent": sent, "not_sent": not_sent, "users_count": users.count()}, # {"sent": sent, "not_sent": not_sent, "users_count": users.count()},
{"users": users, "users_count": users.count()}, {"users": users, "users_count": users.count(), "results": False},
) )
# sent = [] # sent = []
@@ -1570,7 +1570,7 @@ def group_email_results(request, pk, resend=False):
request, request,
"generic/group_emailed.html", "generic/group_emailed.html",
# {"sent": sent, "not_sent": not_sent, "users_count": users.count()}, # {"sent": sent, "not_sent": not_sent, "users_count": users.count()},
{"users": users, "users_count": users.count()}, {"users": users, "users_count": users.count(), "results": True},
) )