Do not return contact alias activity on the contact manager page
This commit is contained in:
parent
fb88654d84
commit
45891bed36
|
@ -92,39 +92,43 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="mb-2 text-muted small-text">
|
<div class="mb-2 text-muted small-text">
|
||||||
{% if contact_info.latest_email_log != None %}
|
Contact created {{ contact.created_at | dt }}
|
||||||
{% set email_log = contact_info.latest_email_log %}
|
|
||||||
|
|
||||||
{% if email_log.is_reply %}
|
|
||||||
<i class="fa fa-reply mr-2" data-toggle="tooltip" title="Email reply/sent from alias"></i>
|
|
||||||
{{ email_log.created_at | dt }}
|
|
||||||
{% elif email_log.bounced %}
|
|
||||||
<span class="text-danger">
|
|
||||||
<i class="fa fa-warning mr-2" data-toggle="tooltip"
|
|
||||||
title="Email bounced and cannot be forwarded to your mailbox"></i>
|
|
||||||
{{ email_log.created_at | dt }}
|
|
||||||
</span>
|
|
||||||
{% elif email_log.blocked %}
|
|
||||||
<i class="fa fa-ban mr-2 text-danger" data-toggle="tooltip" title="Email blocked"></i>
|
|
||||||
{{ email_log.created_at | dt }}
|
|
||||||
{% else %}
|
|
||||||
<i class="fa fa-paper-plane mr-2" data-toggle="tooltip" title="Email sent to alias"></i>
|
|
||||||
{{ email_log.created_at | dt }}
|
|
||||||
{% endif %}
|
|
||||||
<br>
|
|
||||||
Contact created {{ contact.created_at | dt }}
|
|
||||||
{% else %}
|
|
||||||
No Activity. Contact created {{ contact.created_at | dt }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<span class="alias-activity">{{ contact_info.nb_forward }}</span> forwards,
|
|
||||||
<span class="alias-activity">{{ contact_info.nb_reply }}</span> replies
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{# <div class="mb-2 text-muted small-text">#}
|
||||||
|
{# {% if contact_info.latest_email_log != None %}#}
|
||||||
|
{# {% set email_log = contact_info.latest_email_log %}#}
|
||||||
|
{##}
|
||||||
|
{# {% if email_log.is_reply %}#}
|
||||||
|
{# <i class="fa fa-reply mr-2" data-toggle="tooltip" title="Email reply/sent from alias"></i>#}
|
||||||
|
{# {{ email_log.created_at | dt }}#}
|
||||||
|
{# {% elif email_log.bounced %}#}
|
||||||
|
{# <span class="text-danger">#}
|
||||||
|
{# <i class="fa fa-warning mr-2" data-toggle="tooltip"#}
|
||||||
|
{# title="Email bounced and cannot be forwarded to your mailbox"></i>#}
|
||||||
|
{# {{ email_log.created_at | dt }}#}
|
||||||
|
{# </span>#}
|
||||||
|
{# {% elif email_log.blocked %}#}
|
||||||
|
{# <i class="fa fa-ban mr-2 text-danger" data-toggle="tooltip" title="Email blocked"></i>#}
|
||||||
|
{# {{ email_log.created_at | dt }}#}
|
||||||
|
{# {% else %}#}
|
||||||
|
{# <i class="fa fa-paper-plane mr-2" data-toggle="tooltip" title="Email sent to alias"></i>#}
|
||||||
|
{# {{ email_log.created_at | dt }}#}
|
||||||
|
{# {% endif %}#}
|
||||||
|
{# <br>#}
|
||||||
|
{# Contact created {{ contact.created_at | dt }}#}
|
||||||
|
{# {% else %}#}
|
||||||
|
{# No Activity. Contact created {{ contact.created_at | dt }}#}
|
||||||
|
{# {% endif %}#}
|
||||||
|
{##}
|
||||||
|
{# <div>#}
|
||||||
|
{# <span class="alias-activity">{{ contact_info.nb_forward }}</span> forwards,#}
|
||||||
|
{# <span class="alias-activity">{{ contact_info.nb_reply }}</span> replies#}
|
||||||
|
{# </div>#}
|
||||||
|
{# </div>#}
|
||||||
|
|
||||||
<a href="{{ url_for('dashboard.contact_detail_route', contact_id=contact.id) }}">Edit ➡</a>
|
<a href="{{ url_for('dashboard.contact_detail_route', contact_id=contact.id) }}">Edit ➡</a>
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
|
|
|
@ -61,6 +61,26 @@ class ContactInfo(object):
|
||||||
|
|
||||||
|
|
||||||
def get_contact_infos(alias: Alias, page=0, contact_id=None) -> [ContactInfo]:
|
def get_contact_infos(alias: Alias, page=0, contact_id=None) -> [ContactInfo]:
|
||||||
|
q = db.session.query(
|
||||||
|
Contact,
|
||||||
|
)
|
||||||
|
|
||||||
|
if contact_id:
|
||||||
|
q = q.filter(Contact.id == contact_id)
|
||||||
|
|
||||||
|
q = q.order_by(Contact.id.desc()).limit(PAGE_LIMIT).offset(page * PAGE_LIMIT)
|
||||||
|
|
||||||
|
ret = []
|
||||||
|
for contact in q:
|
||||||
|
contact_info = ContactInfo(
|
||||||
|
contact=contact, nb_forward=0, nb_reply=0, latest_email_log=None
|
||||||
|
)
|
||||||
|
ret.append(contact_info)
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
def get_contact_infos2(alias: Alias, page=0, contact_id=None) -> [ContactInfo]:
|
||||||
"""if contact_id is set, only return the contact info for this contact"""
|
"""if contact_id is set, only return the contact info for this contact"""
|
||||||
sub = (
|
sub = (
|
||||||
db.session.query(
|
db.session.query(
|
||||||
|
|
Loading…
Reference in New Issue