{% extends "base.html" %} {% import "macros.html" as m %} {# The header (name, the line under it, the action row, the status strip) stays on top. Below it the sections come in layout.toml's order (help: adjust-layout); their names, in the default order: details, tasks, quick-add, timeline, drafts, merge, delete. Merge and delete, the rare and destructive ones, always sit in the closed "More" box at the bottom, in the same order. `hide` is the fields layout.toml hides on this page. #} {% macro ago(days) -%} {{ 'today' if days == 0 else 'yesterday' if days == 1 else days ~ ' days ago' }} {%- endmacro %} {% macro arrow(direction) -%} {%- if direction %}{{ direction }}{% endif -%} {%- endmacro %} {% block title %}{{ contact.name }}{% endblock %} {% block content %} {%- set hide = layout_hidden('contact') %} {%- set sections = layout_sections('contact') %} {%- set more = sections | select('in', ['merge', 'delete']) | list %} {%- set s = summary %}

{{ contact.name }}

{% if contact.title and 'title' not in hide %}{{ contact.title }} at {% endif %}{{ company.name }} {{ company.stage }}{% if contact.role and 'role' not in hide %} {{ contact.role }}{% endif %}

{% if 'quick-add' in sections %}Log interaction Add note{% endif %} {% if 'tasks' in sections %}Add task{% endif %} {% if contact.email and 'email' not in hide %}copy email{% endif %} {% if contact.linkedin and 'linkedin' not in hide %}linkedin{% endif %} {% if enricher and enricher.available %}
{% endif %}
Last touch
{% if s.last %}
{{ fmt_date(s.last.date) }}, {{ s.last.channel }} {{ arrow(s.last.direction) }}
{{ ago(s.last_days) }}
{% else %}
none yet
{% endif %}
Waiting on
{% if s.waiting and s.waiting.kind == 'reply' %}
you: reply owed
since {{ fmt_date(s.waiting.interaction.date) }} · {{ s.waiting.summary }}
{% elif s.waiting %}
them: no answer
since {{ fmt_date(s.waiting.interaction.date) }} · {{ s.waiting.summary }}
{% else %}
nobody
{% endif %}
Next for {{ contact.first_name or contact.name }}
{% if s.next %}{{ s.next.text }}{% if s.next.due %}
due {{ fmt_date(s.next.due) }}{% endif %} {% else %}
nothing planned
{% endif %}
History
{% if s.count %}
{{ s.count }} touch{{ 'es' if s.count != 1 }}, {{ s.count_in }} in / {{ s.count_out }} out
since {{ fmt_date(s.first.date) }}
{% else %}
no touches yet
{% endif %}
{% for section in sections %}{% if section == 'details' %}

Details

{{ m.errors_box(errors) }} {% set add = '?edit=1#details' %}
{% if 'title' not in hide %}
title
{{ contact.title or '' }}{% if not contact.title %}+ title{% endif %}
{% endif %} {% if 'role' not in hide %}
role
{{ contact.role or '' }}{% if not contact.role %}+ role{% endif %}
{% endif %} {% if 'email' not in hide %}
email
{% if contact.email %}{{ contact.email }}{% else %}+ email{% endif %}
{% endif %} {% if 'phone' not in hide %}
phone
{{ contact.phone or '' }}{% if not contact.phone %}+ phone{% endif %}
{% endif %} {% if 'linkedin' not in hide %}
linkedin
{% if contact.linkedin %}open{% else %}+ linkedin{% endif %}
{% endif %} {% if 'language' not in hide %}{% set lang = (contact.language or '') | trim | lower %}
draft language
{{ language_names.get(lang, lang) if lang else 'from country' }}
{% endif %} {% for f in custom_fields_for('contact') if f.key not in hide and contact.extra.get(f.key) not in (none, '') %}
{{ f.label }}
{{ f.display(contact.extra.get(f.key)) }}
{% endfor %}
Edit
{{ m.contact_fields(values, errors) }}
{% elif section == 'tasks' %}

Tasks for {{ contact.name }}

Things you owe this person. {{ company.name }}'s next step is its open task due first, which can be one of these.

{{ m.task_list(company, contact.tasks, today, contact=contact.slug) }}
{% elif section == 'quick-add' %}

Log an interaction

{{ m.interaction_form('/companies/' ~ company.slug ~ '/interactions', company, interaction, contact=contact) }}
{% elif section == 'timeline' %}

Interactions ({{ interactions | length }})

{{ m.timeline(company, interactions, contact_page=true) }}
{% elif section == 'drafts' %} {# Open when you still need a first message, or while you are working the drafts form (its Refresh reloads the page with these parameters). #} {% set q = request.query_params %} {{ m.drafts_section(company, contact, drafts, signal, observation, '/companies/' ~ company.slug ~ '/contacts/' ~ contact.slug, fold=true, open=(not s.has_outbound or q.get('signal') or q.get('observation') or q.get('lang'))) }} {% endif %}{% endfor %}
More: {% for x in more %}{{ x }}, {% endfor %}slug and dates {% for section in more %}{% if section == 'merge' and company.contacts | length > 1 %}

Merge

{% elif section == 'delete' %}

Delete

{% set open_tasks = contact.tasks | rejectattr('done') | list %} {% set confirm_text = 'Delete ' ~ contact.name ~ '?' ~ ((' Their ' ~ interactions | length ~ ' interaction(s) stay on ' ~ company.name ~ ' without a contact.') if interactions else '') ~ ((' Their ' ~ open_tasks | length ~ ' open task(s) go with them.') if open_tasks else '') %}
{% if interactions %}{{ interactions | length }} interaction(s) stay on {{ company.name }}, without a contact.{% else %}No interactions are linked to this contact.{% endif %}
{% endif %}{% endfor %}

slug {{ contact.slug }} · created {{ fmt_datetime(contact.created) }} · updated {{ fmt_datetime(contact.updated) }}

{% endblock %}