templates/media/portfolio/photo.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3. <div class="row">
  4.     <div class="col-12">
  5.         <div class="my-3 p-3 bg-white">
  6.             {% if safeMode and photo.isAdult %}
  7.             <div class="text-center alert alert-info" role="alert">
  8.                 <a href="#" id="safe-mode-off" data-responder="{{ path('core_safe_mode') }}">
  9.                     {{ 'Turn Safe Mode off to view the picture'|trans({}, 'media_portfolio') }}
  10.                 </a>
  11.             </div>
  12.             {% endif %}
  13.             <div class="col-12 text-center" id="photo-container">
  14.                 {% if prev %}
  15.                     {% set prevType = prev.type %}
  16.                     {% if album %}
  17.                         {% set route = path('portfolio_' ~ prevType, {slug: prev.profile.slug, media: prev.hash, album: album.id}) %}
  18.                     {% elseif type %}
  19.                         {% set route = path('portfolio_' ~ prevType, {slug: prev.profile.slug, media: prev.hash, type: type}|merge(routeParams)) %}
  20.                     {% endif %}
  21.                     <a href="{{ route }}" class="btn btn-primary btn-sm" id="prev-photo" role="button">
  22.                         {{ 'Previous'|trans({}, 'core') }}
  23.                     </a>
  24.                 {% endif %}
  25.                 <img src="{{ get_media(photo) }}" class="img-fluid" alt="{{ photo.title }}">
  26.                 {% if next %}
  27.                     {% set nextType = next.type %}
  28.                     {% if album %}
  29.                         {% set route = path('portfolio_' ~ nextType, {slug: prev.profile.slug, media: next.hash, album: album.id}) %}
  30.                     {% elseif type %}
  31.                         {% set route = path('portfolio_' ~ nextType, {slug: prev.profile.slug, media: next.hash, type: type}|merge(routeParams)) %}
  32.                     {% endif %}
  33.                     <a href="{{ route }}" class="btn btn-primary btn-sm" id="next-photo" role="button">
  34.                         {{ 'Next'|trans({}, 'core') }}
  35.                     </a>
  36.                 {% endif %}
  37.             </div>
  38.             <div class="col-12 text-center">
  39.             {% if photo.title %}
  40.                 <h4 id="photo-title">{{ photo.title }}</h4>
  41.             {% endif %}
  42.             {% if photo.description %}
  43.                 <p id="photo-description">{{ photo.description }}</p>
  44.             {% endif %}
  45.             </div>
  46.             <div class="col-12 text-center py-3">
  47.                 {% include 'media/portfolio/partials/social-buttons.html.twig' %}
  48.             </div>
  49.         </div>
  50.     </div>
  51.     <div class="col-12 col-md-6">
  52.         <div class="my-3 p-3 bg-white rounded">
  53.             {% if photo.convertedCredits|length %}
  54.                 {% for credit in photo.convertedCredits %}
  55.                     <p id="photo-credit-{{ credit.info.id }}">
  56.                         <span class="font-weight-bold">{{ credit.info.name }}:</span> 
  57.                         {% for user in credit.users %}
  58.                             {% if user.profile %}
  59.                                 <a href="{{ path('profile', {slug: user.profile.slug}) }}">
  60.                                     {{ user.profile.name }}
  61.                                 </a>
  62.                             {% else %}{{ user.name }}{% endif %}{% if loop.last == false %}, {% endif %}
  63.                         {% endfor %}
  64.                     </p>
  65.                 {% endfor %}
  66.             {% endif %}
  67.         </div>
  68.     </div>
  69.     <div class="col-12 col-md-6">
  70.         <div class="my-3 p-3 bg-white rounded">
  71.             {% if photo.tags|length %}
  72.                 <p id="photo-tags">
  73.                 <span class="font-weight-bold">{{ 'Hashtags:'|trans({}, 'media_portfolio') }}</span> 
  74.                 {% for tag in photo.tags %}
  75.                     <a href="{{ path('media_tag', {tag: tag.slug}) }}">#{{tag.name}}</a> 
  76.                 {% endfor %}
  77.                 </p>
  78.             {% endif %}
  79.         </div>
  80.         <div class="my-3 p-3 bg-white rounded">
  81.              <p class="font-italic">
  82.                 {{ 'Uploaded by <a href="{link}">{name}</a> on {date}'|trans({'{link}': path('profile', {slug: photo.profile.slug}) , '{name}': photo.profile.name, '{date}': photo.createdAt|format_date() }, 'media_portfolio')|raw }}
  83.             </p>
  84.             {% if owner %}
  85.                 <a href="{{ path('portfolio_photo_edit', {slug: photo.profile.slug, photo: photo.id}) }}" class="text-left btn btn-sm btn-link btn-block" btn-sm role="button">
  86.                     {{ 'Edit photo'|trans({}, 'media_portfolio') }}
  87.                 </a>
  88.                 <a href="{{ path('portfolio_photo_cover', {slug: photo.profile.slug, photo: photo.id}) }}" class="text-left btn btn-sm btn-link btn-block" btn-sm role="button">
  89.                     {{ 'Set as cover'|trans({}, 'media_portfolio') }}
  90.                 </a>
  91.                 <a data-toggle="confirmation" href="{{ path('portfolio_photo_delete', {slug: photo.profile.slug, photo: photo.id}) }}" class="text-left btn btn-link btn-block btn-sm" role="button">
  92.                     {{ 'Delete photo'|trans({}, 'media_portfolio') }}
  93.                 </a> 
  94.             {% endif %}
  95.         </div>
  96.         {% if credited %}
  97.             {% for profile in credited %}
  98.             {% if photo.profile != profile %}
  99.             <div class="my-3 p-3 bg-white rounded">
  100.                 <a href="{{ path('portfolio_photo_credited', {slug: profile.slug, photo: photo.id}) }}" class="text-left btn btn-sm btn-link btn-block" btn-sm role="button">
  101.                     {{ 'Add it to my portfolio or albums'|trans({}, 'media_portfolio') }}
  102.                 </a>
  103.                 <a href="{{ path('portfolio_photo_cover', {slug: profile.slug, photo: photo.id}) }}" class="text-left btn btn-sm btn-link btn-block" btn-sm role="button">
  104.                     {{ 'Set as cover'|trans({}, 'media_portfolio') }}
  105.                 </a>
  106.                 <a data-toggle="confirmation" href="{{ path('portfolio_photo_credited_delete', {slug: profile.slug, photo: photo.id}) }}" class="text-left btn btn-link btn-block btn-sm" role="button">
  107.                     {{ 'Remove the credits'|trans({}, 'media_portfolio') }}
  108.                 </a> 
  109.             </div>
  110.             {% endif %}
  111.             {% endfor %}
  112.         {% endif %}
  113.     </div>
  114.      <a href="{{ path('profile', {slug: profile.slug}) }}" class="btn btn-sm btn-primary btn-block" role="button">
  115.         {{ 'Back to portfolio'|trans({}, 'media_portfolio') }}
  116.     </a> 
  117. </div>
  118. {% endblock %}
  119. {% block javascripts %}
  120.     {{ parent() }}
  121.     {{ encore_entry_script_tags('media_portfolio') }}
  122. {% endblock %}
  123. {% block stylesheets %}
  124.     {{ parent() }}
  125.     {{ encore_entry_link_tags('media_portfolio') }}
  126. {% endblock %}