templates/ClientOffer/privateMessage.html.twig line 1

Open in your IDE?
  1. {% for privateMessage in privateMessages %}
  2.     <div class="media mb-4 font-size-14" id="private-message-{{ privateMessage.id }}" style="background-color:{% if app.user.id == privateMessage.author.id %}#CCCCCC{% else %}#CCCCFF{% endif %};padding: 15px; border-radius: 15px;">
  3.         <div class="media-body">
  4.             <h5 class="mt-0 font-size-15">
  5.                 {{ privateMessage.createdAt|date('Y-m-d H:i') }}<br/>
  6.                 {{ privateMessage.author.companyName }} ({{ privateMessage.author.username }})
  7.                 {% if privateMessage.inquiry is not null %}
  8.                     <br/>
  9.                     Do zapytania: <a href="{{ path('client_inquiry_details', {'id': privateMessage.inquiry.id }) }}#comments">{{ privateMessage.inquiry.make.name }} {{ privateMessage.inquiry.model }}</a><br/>
  10.                     Nr rej:  <a href="{{ path('client_inquiry_details', {'id': privateMessage.inquiry.id }) }}#comments">{{ privateMessage.inquiry.registrationNumber }}</a><br/>
  11.                     Numer VIN:  <a href="{{ path('client_inquiry_details', {'id': privateMessage.inquiry.id }) }}#comments">{{ privateMessage.inquiry.vin }}</a><br/>
  12.                 {% elseif privateMessage.offer is not null %}
  13.                     <br/>Do Twojej oferty dotyczącej: <a href="{{ path('client_offer_details', {'id': privateMessage.offer.id }) }}">{{ privateMessage.offer.inquiry.make.name }} {{ privateMessage.offer.inquiry.model }}</a>
  14.                 {% endif %}
  15.             </h5>
  16.             <br/>
  17.             {{ privateMessage.content|raw }}
  18.             <br/>
  19.             {% if privateMessage.attachmentFiles|length > 0 %}
  20.                 <div class="row">
  21.                     <div class="col-12">
  22.                         <h5 class="mb-4 pb-1 font-size-12">Załączniki ({{ privateMessage.attachmentFiles|length }})</h5>
  23.                     </div>
  24.                 </div>
  25.                 <div class="row">
  26.                     <div class="col-12">
  27.                         <div class="lightbox2-parent-container">
  28.                             {% for attachmentFile in privateMessage.attachmentFiles %}
  29.                                 {% if attachmentFile.fileType == 'image' %}
  30.                                     <a href="{{ asset(attachmentFile.url) }}" data-lightbox="private-message-images-{{ privateMessage.id }}" style="display: inline;">
  31.                                         <div class="avatar-title rounded bg-soft-primary text-primary " style="background-color: black; width: 90px; height: 60px; display: inline-block; background-size: cover; background-position: center center; background-repeat: no-repeat; background-image: url({{ miniatureFiles['privateMessage'][attachmentFile.id]['100x100'].url }})"></div>
  32.                                     </a>
  33.                                 {% endif %}
  34.                             {% endfor %}
  35.                         </div>
  36.                         {% for attachmentFile in privateMessage.attachmentFiles %}
  37.                             {% if attachmentFile.fileType == 'file' %}
  38.                                 <div class="p-2 border rounded mb-2" style="background-color: white;">
  39.                                     <div class="media">
  40.                                         <div class="avatar-sm font-weight-bold mr-3">
  41.                                             <span class="avatar-title rounded bg-soft-primary text-primary">
  42.                                                 <i class="uil-file font-size-18"></i>
  43.                                             </span>
  44.                                         </div>
  45.                                         <div class="media-body">
  46.                                             <a href="{{ path('private_message_get_file', {'id': attachmentFile.id}) }}" class="d-inline-block mt-2">{{ attachmentFile.originalFileName }}</a>
  47.                                         </div>
  48.                                         <div class="float-right mt-1">
  49.                                             <a href="{{ path('private_message_get_file', {'id': attachmentFile.id}) }}" class="p-2"><i class="uil-download-alt font-size-18"></i></a>
  50.                                         </div>
  51.                                     </div>
  52.                                 </div>
  53.                             {% endif %}
  54.                         {% endfor %}
  55.                     </div>
  56.                 </div>
  57.             {% endif %}
  58.             <div class="row">
  59.                 <div class="col-12">
  60.                     <p class="text-muted">
  61.                         {% if privateMessage.readAt is null and notificationsForMessages[privateMessage.id] is defined and not notificationsForMessages[privateMessage.id].isRead and notificationsForMessages[privateMessage.id].recipient.id == app.user.id %}
  62.                             <a class="loader-button btn btn-primary [ read-notification-from-module ] text-white read-notification-{{ notificationsForMessages[privateMessage.id].id }}"
  63.                                data-action="{{ path('notification_read', {'id': notificationsForMessages[privateMessage.id].id}) }}"
  64.                                style="animation: blinker 1s linear infinite;"
  65.                                data-toggle="tooltip" data-html="true" data-placement="top" data-original-title="Pamiętaj, aby oznaczać wiadomość jako przeczytaną, dzięki temu będziesz mieć porządek oraz zniknie czerwona koperta informująca o nowej wiadomości"
  66.                             >
  67.                                 <i class="fa fa-spinner fa-spin d-none loader-button-mark"></i> Oznacz jako przeczytane <i class="fa fa-envelope" style="color: red;"></i>
  68.                             </a>
  69.                         {% endif %}
  70.                         {% if privateMessage.readAt is not null and notificationsForMessages[privateMessage.id] is defined and notificationsForMessages[privateMessage.id].isRead %}
  71.                             {% if notificationsForMessages[privateMessage.id].recipient.id == app.user.id %}
  72.                                 <a class="badge badge-light [ unread-notification-from-module ] text-white unread-notification-{{ notificationsForMessages[privateMessage.id].id }}" data-action="{{ path('notification_unread', {'id': notificationsForMessages[privateMessage.id].id}) }}" style="background: gray; color: black;">Oznacz jako NIE przeczytane</a>
  73.                             {% endif %}
  74.                             <br/>
  75.                             <small>Przeczytana {{ privateMessage.readAt|date('Y-m-d H:i') }} przez {{ notificationsForMessages[privateMessage.id].recipient }}</small><br/>
  76.                         {% endif %}
  77.                     </p>
  78.                 </div>
  79.             </div>
  80.             <div class="row">
  81.                 <div class="col-12" style="text-align: left;">
  82.                     {% if app.user.id == privateMessage.author.id and app.user.canDeletePrivateMessages %}
  83.                         <button class="btn btn-sm btn-danger [ delete-private-message-from-module ] " data-message-id="{{ privateMessage.id }}">Usuń</button>
  84.                     {% endif %}
  85.                 </div>
  86.             </div>
  87.         </div>
  88.         <hr>
  89.     </div>
  90. {% endfor %}