Add two-way messaging view

> Once an inbound message has been received, there should be a way to
> see the other messages in the system from the same service to the same
> number. Both in and outbound. Nice inbox/whatsapp stylee view or some
> such. This way the context of the reply is understood.
>
> Initially will only see the outbound template, not the actual message,
> but we’re going to change this for the rest (soon), so that you can
> always see the full message for all outbound.
This commit is contained in:
Chris Hill-Scott
2017-05-24 13:19:31 +01:00
parent 183c324f9a
commit f6d8e55579
11 changed files with 292 additions and 12 deletions

View File

@@ -0,0 +1,50 @@
{% extends "withnav_template.html" %}
{% block service_page_title %}
Conversation
{% endblock %}
{% block maincolumn_content %}
<div class="dashboard">
<div class="bottom-gutter">
<h1 class="heading-large">
07900 900 123
</h1>
</div>
{% for message in conversation %}
<div class="grid-row" id="n{{ message.id }}">
{% if message.inbound %}
<div class="column-two-thirds sms-message-inbound">
{{ message.content | string }}
<div class="sms-message-status">
{{ message.created_at | format_datetime_relative }}
</div>
</div>
{% else %}
<div class="column-one-third">
&nbsp;
</div>
<div class="column-two-thirds">
{{ message.content | string }}
{% if message.status == 'delivered' %}
<div class="sms-message-status sms-message-status-outbound">
{{ message.created_at | format_datetime_relative }}
</div>
{% elif message.status in ['pending', 'sending', 'created'] %}
<div class="sms-message-status sms-message-status-outbound hint">
sending
</div>
{% else %}
<div class="sms-message-status sms-message-status-outbound table-field-error-label">
Failed (sent {{ message.created_at | format_datetime_relative }})
</div>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endblock %}

View File

@@ -25,7 +25,12 @@
field_headings_visible=False
) %}
{% call field() %}
<span class="file-list-filename" href="#">{{ item.user_number | format_phone_number_human_readable }}</span>
<a
class="file-list-filename"
href="{{ url_for('.conversation', service_id=current_service.id, notification_id=item.id) }}#n{{ item.id }}"
>
{{ item.user_number | format_phone_number_human_readable }}
</a>
<span class="wide-left-hand-column">{{ item.content }}</span>
{% endcall %}
{% call field(align='right') %}