<commit_before>{% extends "PROCERGSLoginCidadaoCoreBundle::grid_layout.html.twig" %}

{% block grid_header_action %}
{% endblock grid_header_action %}

{% block grid_header_data %}
    <div class="col-md-12">{{ 'Notifications'|trans }}</div>
{% endblock grid_header_data %}

{% block grid_row_action %}
{% endblock grid_row_action %}

{% block grid_row_data %}
<div class="pull-left">
  {% image '@PROCERGSLoginCidadaoCoreBundle/Resources/public/images/userav.png' %}
  {% if row.sender.pictureWebPath != '' %}
      {% set asset_url = '/' ~ row.sender.pictureWebPath  %}
  {% endif %}
  <img alt="{{ row.sender.name }}" class="media-object" src="{{ asset_url }}" width="50" height="50" />
  {% endimage %}
</div>
<div class="media-body">
  <h5 class="media-heading">{{ row.title }}</h5>
  <div class="client-name">{{ row.sender.name }}</div>
  <div class="date">{{ row.createdat|date('d/m/Y h:i:s') }}</div>
</div>
{% endblock grid_row_data %}



{% block grid_row %}
    {% if grid.routeParams.clientId is defined %}
        {% set url = path('lc_notifications_from_client', { id: row.id, clientId: grid.routeParams.clientId }) %}
    {% else %}
        {% set url = path('lc_notifications', { id: row.id }) %}
    {% endif %}
    <div class="notification-line {{ openId is defined and row.id == openId ? 'notification-open' : '' }}">
        <a class="row media notification common-grid-result {{ row.isread  ? 'notification-read' : 'notification-unread' }} {{ grid.rlast ? 'row-last' }}"
             title="{{ 'Click to read'|trans }}"
             data-notification-id="{{ row.id }}"
             href="{{ url }}">
            {{ block('grid_row_action') }}
            {{ block('grid_row_data') }}
        </a>
        <div class="row notification-content common-grid-result" data-loaded="false">
            {#{ row.renderHtml() | raw }#}
        </div>
    </div>
{% endblock grid_row %}

{% block grid_infinite_pagination %}
    {% if not grid.rlast and grid.isInfiniteGrid %}
        {% set routeParams = { 'offset': grid.iterable.nextOffset } %}
        {% if grid.routeParams.clientId is defined %}
        {% set routeParams = { 'offset': grid.iterable.nextOffset, 'clientId': grid.routeParams.clientId } %}
        {% endif %}
        <a href="{{ path(grid.route, routeParams) }}" class="btn btn-block btn-info notification-load-more" data-next-offset="{{ grid.iterable.nextOffset }}"
           data-per-page="{{ grid.perPage }}" data-loading-text="{{ 'loading...'|trans }}">
            {{ 'load more'|trans }}
        </a>
    {% endif %}
{% endblock grid_infinite_pagination %}<commit_msg>Pre-loading read notifications. #152<commit_after>{% extends "PROCERGSLoginCidadaoCoreBundle::grid_layout.html.twig" %}

{% block grid_header_action %}
{% endblock grid_header_action %}

{% block grid_header_data %}
    <div class="col-md-12">{{ 'Notifications'|trans }}</div>
{% endblock grid_header_data %}

{% block grid_row_action %}
{% endblock grid_row_action %}

{% block grid_row_data %}
<div class="pull-left">
  {% image '@PROCERGSLoginCidadaoCoreBundle/Resources/public/images/userav.png' %}
  {% if row.sender.pictureWebPath != '' %}
      {% set asset_url = '/' ~ row.sender.pictureWebPath  %}
  {% endif %}
  <img alt="{{ row.sender.name }}" class="media-object" src="{{ asset_url }}" width="50" height="50" />
  {% endimage %}
</div>
<div class="media-body">
  <h5 class="media-heading">{{ row.title }}</h5>
  <div class="client-name">{{ row.sender.name }}</div>
  <div class="date">{{ row.createdat|date('d/m/Y h:i:s') }}</div>
</div>
{% endblock grid_row_data %}



{% block grid_row %}
    {% if grid.routeParams.clientId is defined %}
        {% set url = path('lc_notifications_from_client', { id: row.id, clientId: grid.routeParams.clientId }) %}
    {% else %}
        {% set url = path('lc_notifications', { id: row.id }) %}
    {% endif %}
    <div class="notification-line {{ openId is defined and row.id == openId ? 'notification-open' : '' }}">
        <a class="row media notification common-grid-result {{ row.isread  ? 'notification-read' : 'notification-unread' }} {{ grid.rlast ? 'row-last' }}"
             title="{{ 'Click to read'|trans }}"
             data-notification-id="{{ row.id }}"
             href="{{ url }}">
            {{ block('grid_row_action') }}
            {{ block('grid_row_data') }}
        </a>
        <div class="row notification-content common-grid-result" data-loaded="{{ row.isRead ? 'true' : 'false' }}">
            {% if row.isRead %}
            {{ row.renderHtml() | raw }}
            {% endif %}
        </div>
    </div>
{% endblock grid_row %}

{% block grid_infinite_pagination %}
    {% if not grid.rlast and grid.isInfiniteGrid %}
        {% set routeParams = { 'offset': grid.iterable.nextOffset } %}
        {% if grid.routeParams.clientId is defined %}
        {% set routeParams = { 'offset': grid.iterable.nextOffset, 'clientId': grid.routeParams.clientId } %}
        {% endif %}
        <a href="{{ path(grid.route, routeParams) }}" class="btn btn-block btn-info notification-load-more" data-next-offset="{{ grid.iterable.nextOffset }}"
           data-per-page="{{ grid.perPage }}" data-loading-text="{{ 'loading...'|trans }}">
            {{ 'load more'|trans }}
        </a>
    {% endif %}
{% endblock grid_infinite_pagination %}
{'fraction_non_alphanumeric': 0.19256058613563778, 'fraction_numerical': 0.0035694157430020664, 'mean_word_length': 3.182246661429694, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '3320721', 'n_tokens_mistral': 1829, 'n_tokens_neox': 1691, 'n_words': 333}