templates/profile/partials/header.html.twig line 1

Open in your IDE?
  1. {% set cover = get_profile_cover(profile) %}
  2. <div class="row">
  3.     <div class="col-md-12">
  4.         <div class="profile-block">
  5.             <div class="profile-block-thumb cover-container" {% if cover %}style="background: url('{{ asset(cover) | imagine_filter('cover') }}?{{ profile.cover.createdDate|date('U') }}') no-repeat center"{% endif %}></div>
  6.             <div class="profile-toolbar">
  7.                 {% if is_granted('ROLE_CREATOR', profile) %}
  8.                 <a class="btn btn-sm btn-primary" href="{{ path('profile_cover_upload', {profile: profile.id}) }}">
  9.                     {{ 'Upload cover'|trans({}, 'profile_view') }}
  10.                 </a>
  11.                 {#<div class="btn-group">
  12.                     <button type="button" class="btn btn-sm btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  13.                         {{ 'Options'|trans({}, 'profile_view') }}
  14.                     </button>
  15.                     <div class="dropdown-menu dropdown-menu-right">
  16.                         <h6 class="dropdown-header">{{ 'Cover'|trans({}, 'profile_view') }}</h6>
  17.                         <a class="dropdown-item" href="{{ path('profile_cover_upload', {profile: profile.id}) }}">
  18.                             {{ 'Upload image'|trans({}, 'profile_view') }}
  19.                         </a>
  20.                     </div>
  21.                 </div>#}
  22.                 {% else %}
  23.                 {% if isFollow is defined %}
  24.                 {% include 'profile/partials/buttons/follow.html.twig' %}
  25.                 {% endif %}
  26.                 {% endif %}
  27.             </div>
  28.             <div class="profile-img">
  29.                 {% set avatar = get_profile_avatar(profile) %}
  30.                 {% if is_granted('ROLE_CREATOR', profile) %}
  31.                 <a href="{{ path('profile_avatar_upload', {profile: profile.id}) }}">
  32.                     <img src="{{ avatar }}{% if profile.avatar %}?{{ profile.avatar.createdDate|date('U') }}{% endif %}" class="img-thumbnail">     
  33.                     <button class="btn btn-sm btn-success btn-block change-avatar">
  34.                         {{ 'Change avatar'|trans({}, 'profile_avatar') }}
  35.                     </button>  
  36.                 </a>
  37.                 {% else %}
  38.                 <a href="{{ avatar }}" data-toggle="lightbox">
  39.                     <img src="{{ avatar }}" class="img-thumbnail">       
  40.                 </a>
  41.                 {% endif %}
  42.             </div>
  43.             <div class="profile-name">
  44.                 <h2>{{ profile.name }}</h2>
  45.                 {{ get_profile_info(profile, app.user)|raw }}
  46.             </div>
  47.             {% set links = get_profile_links(profile) %}
  48.             <div class="profile-block-link text-right">
  49.                 {% if links|length %}
  50.                     {% for link in links %}
  51.                         <a data-toggle="tooltip" target="{{ link.target }}" href="{{ link.url }}" title="{{ link.label }}"><img src="{{ link.icon }}"></a>
  52.                     {% endfor %}
  53.                 {% endif %}
  54.                 {% if is_granted('ROLE_CREATOR', profile) %}
  55.                     <a href="{{ path('profile_links', {'profile': profile.id}) }}" class="btn btn-primary btn-sm">
  56.                     {{ 'Manage links'|trans({}, 'profile_view') }}
  57.                     </a>
  58.                 {% endif %}
  59.             </div>
  60.             {#{% include 'profile/partials/menu.html.twig' %}#}
  61.         </div>
  62.     </div>
  63. </div>