Revert "Do not return contact alias activity on the contact manager page"
This reverts commit 45891bed36
.
# Conflicts:
# app/dashboard/views/alias_contact_manager.py
This commit is contained in:
parent
25f0a71ea5
commit
aa799fa339
|
@ -92,43 +92,39 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mb-2 text-muted small-text">
|
||||
Contact created {{ contact.created_at | dt }}
|
||||
{% 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>
|
||||
|
||||
|
||||
{# <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>
|
||||
|
||||
<form method="post">
|
||||
|
|
|
@ -61,26 +61,6 @@ class ContactInfo(object):
|
|||
|
||||
|
||||
def get_contact_infos(alias: Alias, page=0, contact_id=None) -> [ContactInfo]:
|
||||
q = db.session.query(
|
||||
Contact,
|
||||
).filter(Contact.alias_id == alias.id)
|
||||
|
||||
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"""
|
||||
sub = (
|
||||
db.session.query(
|
||||
|
|
Loading…
Reference in New Issue