profile.html.twig 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {% extends "PackagistWebBundle::layout.html.twig" %}
  2. {% import "PackagistWebBundle::macros.html.twig" as macros %}
  3. {% block head_additions %}
  4. {% if user.hasRole('ROLE_SPAMMER') %}
  5. <meta name="robots" content="noindex, nofollow">
  6. {% endif %}
  7. {% endblock %}
  8. {% block content %}
  9. {% set isActualUser = app.user and app.user.username is same as(user.username) %}
  10. <h2 class="title">
  11. {{ user.username }}
  12. <small>
  13. {% if is_granted('ROLE_ANTISPAM') and user.hasRole('ROLE_SPAMMER') %}
  14. [SPAMMER]
  15. {% endif %}
  16. {{ 'user.member_since'|trans }}: {{ user.createdAt|date('M d, Y') }}
  17. {%- if is_granted('ROLE_ADMIN') %}
  18. <a href="mailto:{{ user.email }}">{{ user.email }}</a>
  19. {%- endif %}
  20. {%- if is_granted('ROLE_ANTISPAM') %}
  21. <form class="delete action" action="{{ path('mark_spammer', {name: user.username}) }}" method="POST">
  22. {{ form_widget(spammerForm._token) }}
  23. <input class="btn btn-danger" type="submit" value="Mark as Spammer" />
  24. </form>
  25. {%- endif %}
  26. </small>
  27. </h2>
  28. <section class="row">
  29. <section class="col-md-12">
  30. {% embed "PackagistWebBundle:web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: isActualUser} %}
  31. {% block content_title %}
  32. <h3 class="font-normal profile-title">{{ 'user.packages'|trans({ '%username%':user.username }) }}</h3>
  33. {% endblock %}
  34. {% endembed %}
  35. </section>
  36. </section>
  37. {% endblock %}