{% extends "admin/base.html" %}

{% block extrahead %}
<link rel="stylesheet" type="text/css" href="/media/admin/css/forms.css" />
{% endblock %}

{% block title %}{{ title }} | CRM by ReportLab{% endblock %}

{% block branding %}
<h1 id="site-name">CRM by ReportLab for Air Seychelles&nbsp;&nbsp;&nbsp;<a href="/admin/crm/help/" style="text-decoration:underline">(Help)</a></h1>

{% if user.is_authenticated %}
    {% if email_jobs %}
        <div style="background:#4d8f40; padding:10px 10px; margin:8px 0">
            <h1 style="margin:0; padding:0; font-size:14px; font-weight:bold">There is currently {{email_jobs}} email job{{email_jobs|pluralize}} queueing messages for sending. <span style="margin-left:25px"><a href="/admin/crm/emailjob/">View&nbsp;email&nbsp;jobs&nbsp;▶</a></h1>
            <p style="margin:5px 0 0 0; padding:0; font-size:11px">This job creates an email specifically for each lead and adds them to the 'Messages waiting to be sent' list. It can take over 10 minutes from clicking send before you start to see any messages in that list. Contact ReportLab if you think there may be a problem and don't send the same message again.</p>
        </div>
    {% endif %}
    {% if messages_waiting %}
        <div style="background:#4d8f40; padding:10px 10px; margin:8px 0">
            <h1 style="margin:0; padding:0; font-size:14px; font-weight:bold">There {{messages_waiting|pluralize:"is,are"}} currently {{messages_waiting}} email{{messages_waiting|pluralize}} waiting to be sent in the message queue. <span style="margin-left:25px"><a href="/admin/mailer/message/">View&nbsp;waiting&nbsp;messages&nbsp;▶</a></span> <span style="margin-left:25px"><a href="/admin/mailer/messagelog/">View&nbsp;sent&nbsp;messages&nbsp;▶</a></span></h1>
            <p style="margin:5px 0 0 0; padding:0; font-size:11px">After the email job has processed and queued messages into the 'Messages waiting to be sent' list another job will come along and send out the emails to each lead then move messages from the 'Messages waiting to be sent' list to the 'Messages already sent' list when they are complete. It can take up to 10 minutes before messages start being sent and moving out of the waiting list. The number of messages waiting to be sent may appear to stop decreasing for a period of time but this is normally due to batch processing and should resume in 10 minutes or so. Contact ReportLab if you think there may be a problem and don't send the same message again.</p>
        </div>
    {% endif %}
{% endif %}

{% endblock %}

{% block nav-global %}{% endblock %}



{% block extrahead %}
<script type="text/javascript">
window.onload=function(){
    document.getElementById("page_loaded").style.display = 'block';
    document.onmousedown=function(){document.getElementById("page_loaded").style.display = 'none'};
}
</script>
{% endblock %}
{% block footer %}
{{block.super}}
<div id="page_loaded" style="position:fixed; bottom:0; right:0; color:#f00; background:#000; font-weight:bold; display:none; padding:2px 5px; z-index:9999">Page loaded</div>
{% endblock %}

