<commit_before>
{% extends "secure-messages/messages.html" %}

{% block page_title %}Messages - ONS Business Surveys{% endblock %}


{% block messages %}
{% if new_message == 'True' %}
    <div class="panel panel--simple panel--success">
        <div id="message-success-notif" class="panel__body">
            <p>
                Message sent
            </p>
        </div>
    </div>
{% endif %}

<ul class="navigation-tabs navigation-tabs--pills">

    <li id="Inbox"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'INBOX' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='inbox-list' href="/secure-message/messages/INBOX"
           class="navigation-tabs__tab {% if label == 'INBOX' %}{{'navigation-tabs__tab--active'}}{% endif %}">Inbox ({{total}})</a>
    </li>

    <li id="Sent"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'SENT' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='sent-list' href="/secure-message/messages/SENT"
           class="navigation-tabs__tab {% if label == 'SENT' %}{{'navigation-tabs__tab--active'}}{% endif %}">Sent</a>
    </li>

    <li id="Draft"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'DRAFT' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='draft-list' href="/secure-message/messages/DRAFT"
           class="navigation-tabs__tab {% if label == 'DRAFT' %}{{'navigation-tabs__tab--active'}}{% endif %}">Draft</a>
    </li>
</ul>

<ul class="message-list">
{% for message in messages %}
    <li id="message-list" class="message-list__item">
    {% if 'DRAFT' in message['labels'] %}
        <a href="{{ url_for('secure_message_bp.message_get', label='DRAFT', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% elif 'SENT' in message['labels'] %}
        <a href="{{ url_for('secure_message_bp.message_get', label='SENT', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% elif 'UNREAD' in message['labels'] %}
        <b><a href="{{ url_for('secure_message_bp.message_get', label='UNREAD', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a></b>
    {% else %}
        <a href="{{ url_for('secure_message_bp.message_get', label='INBOX', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% endif %}

        <dl class="grid">
            <dt class="grid__col col-2@m">
            {% if 'UNREAD' in message['labels'] %}
                <b>Sent:</b>
            {% else %}
                Sent:
            {% endif %}
            </dt>

            <dd class="grid__col col-9@m pull-1@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>{{ message['sent_date'][:19] }}</b>
            {% else %}
                {{ message['sent_date'][:19] }}
            {% endif %}
            {% elif 'SENT' in message['labels'] %}
                {{ message['sent_date'][:19] }}
            {% elif 'DRAFT' in message['labels'] %}
                {{ message['modified_date'][:19] }}
            {% endif %}
            </dd>

            <dt class="grid__col col-2@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>From:</b>
            {% else %}
                From:
            {% endif %}
            {% else %}
                To:
            {% endif %}
            </dt>

            <dd class="grid__col col-9@m pull-1@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>{{ message['@msg_from']['firstName'] }} {{ message['@msg_from']['lastName'] }}</b>
            {% else %}
                {{ message['@msg_from']['firstName'] }} {{ message['@msg_from']['lastName'] }}
            {% endif %}
            {% else %}
                <!-- Functionality here to be used when BRES has been added to the party service -->
                <!-- {{ message['@msg_to']['firstName'] }} {{ message['@msg_to']['lastName'] }} -->
                ONS Business Surveys team
            {% endif %}
            </dd>
        </dl>

        <p>{{ message['body']|truncate(100) }}</p>


    {% if 'DRAFT' in message['labels'] %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='DRAFT', message_id=message['msg_id']) }}">
    {% elif 'SENT' in message['labels'] %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='SENT', message_id=message['msg_id']) }}">
    {% elif 'INBOX' in message['labels'] %}
    {% if 'UNREAD' in message['labels'] %}
        <b>
    {% endif %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='INBOX', message_id=message['msg_id']) }}">
    {% endif %}
            Read full message<span class="u-vh"> with subject: {{ message['subject'] }}</span>
    {% if 'UNREAD' in message['labels'] %}
        </b>
    {% endif %}
        </a>


    </li>
{% else %}
    <li>You have no messages</li>
{% endfor %}
</ul>
{% endblock messages %}<commit_msg>Fixed read full message link (#289)<commit_after>
{% extends "secure-messages/messages.html" %}

{% block page_title %}Messages - ONS Business Surveys{% endblock %}


{% block messages %}
{% if new_message == 'True' %}
    <div class="panel panel--simple panel--success">
        <div id="message-success-notif" class="panel__body">
            <p>
                Message sent
            </p>
        </div>
    </div>
{% endif %}

<ul class="navigation-tabs navigation-tabs--pills">

    <li id="Inbox"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'INBOX' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='inbox-list' href="/secure-message/messages/INBOX"
           class="navigation-tabs__tab {% if label == 'INBOX' %}{{'navigation-tabs__tab--active'}}{% endif %}">Inbox ({{total}})</a>
    </li>

    <li id="Sent"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'SENT' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='sent-list' href="/secure-message/messages/SENT"
           class="navigation-tabs__tab {% if label == 'SENT' %}{{'navigation-tabs__tab--active'}}{% endif %}">Sent</a>
    </li>

    <li id="Draft"
        class="navigation-tabs__item navigation-tabs__item--primary {% if label == 'DRAFT' %}{{'navigation-tabs__item--active'}}{% endif %}">
        <a id='draft-list' href="/secure-message/messages/DRAFT"
           class="navigation-tabs__tab {% if label == 'DRAFT' %}{{'navigation-tabs__tab--active'}}{% endif %}">Draft</a>
    </li>
</ul>

<ul class="message-list">
{% for message in messages %}
    <li id="message-list" class="message-list__item">
    {% if 'DRAFT' in message['labels'] %}
        <a href="{{ url_for('secure_message_bp.message_get', label='DRAFT', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% elif 'SENT' in message['labels'] %}
        <a href="{{ url_for('secure_message_bp.message_get', label='SENT', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% elif 'UNREAD' in message['labels'] %}
        <b><a href="{{ url_for('secure_message_bp.message_get', label='UNREAD', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a></b>
    {% else %}
        <a href="{{ url_for('secure_message_bp.message_get', label='INBOX', message_id=message['msg_id']) }}">{{ message['subject'] | subject_filter }}</a>
    {% endif %}

        <dl class="grid">
            <dt class="grid__col col-2@m">
            {% if 'UNREAD' in message['labels'] %}
                <b>Sent:</b>
            {% else %}
                Sent:
            {% endif %}
            </dt>

            <dd class="grid__col col-9@m pull-1@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>{{ message['sent_date'][:19] }}</b>
            {% else %}
                {{ message['sent_date'][:19] }}
            {% endif %}
            {% elif 'SENT' in message['labels'] %}
                {{ message['sent_date'][:19] }}
            {% elif 'DRAFT' in message['labels'] %}
                {{ message['modified_date'][:19] }}
            {% endif %}
            </dd>

            <dt class="grid__col col-2@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>From:</b>
            {% else %}
                From:
            {% endif %}
            {% else %}
                To:
            {% endif %}
            </dt>

            <dd class="grid__col col-9@m pull-1@m">
            {% if 'INBOX' in message['labels'] %}
            {% if 'UNREAD' in message['labels'] %}
                <b>{{ message['@msg_from']['firstName'] }} {{ message['@msg_from']['lastName'] }}</b>
            {% else %}
                {{ message['@msg_from']['firstName'] }} {{ message['@msg_from']['lastName'] }}
            {% endif %}
            {% else %}
                <!-- Functionality here to be used when BRES has been added to the party service -->
                <!-- {{ message['@msg_to']['firstName'] }} {{ message['@msg_to']['lastName'] }} -->
                ONS Business Surveys team
            {% endif %}
            </dd>
        </dl>

        <p>{{ message['body']|truncate(100) }}</p>


    {% if 'DRAFT' in message['labels'] %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='DRAFT', message_id=message['msg_id']) }}">
    {% elif 'SENT' in message['labels'] %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='SENT', message_id=message['msg_id']) }}">
    {% elif 'UNREAD' in message['labels'] %}
        <b><a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='UNREAD', message_id=message['msg_id']) }}"></b>
    {% else %}
        <a id="read-message-link-{{loop.index}}" href="{{ url_for('secure_message_bp.message_get', label='INBOX', message_id=message['msg_id']) }}">
    {% endif %}
            Read full message<span class="u-vh"> with subject: {{ message['subject'] }}</span>
        </a>



    </li>
{% else %}
    <li>You have no messages</li>
{% endfor %}
</ul>
{% endblock messages %}
{'fraction_non_alphanumeric': 0.2104172553452011, 'fraction_numerical': 0.0034849769238014506, 'mean_word_length': 2.474476439790576, 'pattern_counts': {'":': 0, '<': 136, '<?xml version=': 0, '>': 136, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1214674', 'n_tokens_mistral': 3552, 'n_tokens_neox': 3228, 'n_words': 643}