templates/users/contributorDisplay.html.twig line 1

Open in your IDE?
  1. {% set contactClass = 'App\\Entity\\Contact' %}
  2. {% if author is defined and author is not empty %}
  3.     {% if author is not instanceof(contactClass) %}
  4.         {% set initials = author|split(' ') %}
  5.         {% if author is defined and author is not empty %}
  6.             {% if author.visibleAnnuaire is defined and author.visibleAnnuaire is not empty %}
  7.                 {% if author.visibleAnnuaire  == true %}
  8.                     <a href="/user/{{ get_user_by_contact_id(author.id).id }}" class="nodeco diblock">
  9.                         <span class="diflex initials author cwhite jcc aic fs12" title="{{ author }}">
  10.                             {{ initials[0]|first|upper }}
  11.                             {{ initials[1]|first|upper }}
  12.                         </span>
  13.                     </a>
  14.                 {% else %}
  15.                     {% include "users/showInitials.html.twig" %}
  16.                 {% endif %}
  17.             {% else %}
  18.                 {% include "users/showInitials.html.twig" %}
  19.             {% endif %}
  20.         {% else %}
  21.             {% include "users/showInitials.html.twig" %}
  22.         {% endif %}
  23.     {% else %}
  24.         {%  if author.id is defined and author.id is not empty %}
  25.             {% if author.visibleAnnuaire is defined and author.visibleAnnuaire is not empty %}
  26.                 {% if author.visibleAnnuaire == true %}
  27.                     <a href="/user/{{ get_user_by_contact_id(author.id).id }}" class="nodeco diblock">
  28.                         <span class="diflex initials author cwhite jcc aic fs12" title="{{ author.fullName }}">
  29.                             {% set initials = author.fullName|split(' ') %}
  30.                             {{ initials[0]|first|upper }}
  31.                             {{ initials[1]|first|upper }}
  32.                         </span>
  33.                     </a>
  34.                 {% else %}
  35.                     <div class="nodeco diblock">
  36.                         <span class="diflex initials author cwhite jcc aic fs12" title="{{ author.fullName }}">
  37.                             {% set initials = author.fullName|split(' ') %}
  38.                             {{ initials[0]|first|upper }}
  39.                             {{ initials[1]|first|upper }}
  40.                         </span>
  41.                     </div>
  42.                 {% endif %}
  43.             {% else %}
  44.                 <div class="nodeco diblock">
  45.                     <span class="diflex initials author cwhite jcc aic fs12" title="{{ author.fullName }}">
  46.                         {% set initials = author.fullName|split(' ') %}
  47.                         {{ initials[0]|first|upper }}
  48.                         {{ initials[1]|first|upper }}
  49.                     </span>
  50.                 </div>
  51.             {% endif %}
  52.         {% endif %}
  53.     {% endif %}
  54. {% endif %}
  55. {% if contributors is defined and contributors is not empty and contributors|length > 0 %}
  56.     {% for contributor in contributors %}
  57.         {% if contributor is instanceof(contactClass) %}
  58.             {% include "users/logic/isUserInAnnuaire.html.twig" %}
  59.         {% else %}
  60.             {% include "users/logic/isUserInAnnuaire.html.twig" with {contributor: sulu_resolve_contact(contributor)} %}
  61.         {% endif %}
  62.     {% endfor %}
  63. {% endif %}