You are here

pcp-template.html.twig in Profile Complete Percent 8

Default theme implementation for PCP block

Available variables:

  • uid: Current user ID.
  • total: Total number of fields in profile.
  • completed: How many fields the user has filled.
  • incomplete: The inverse of $completed, how many empty fields left.
  • next_percent: The percent if the user filled the next field.
  • nextfield_name: The name of the suggested next field to fill (machine name).
  • nextfield_title: The name of the suggested next field to fill (human readable name).
  • current_percent: From 0 to 100% of how much the profile is complete.

File

templates/pcp-template.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for PCP block
  5. *
  6. * Available variables:
  7. * - uid: Current user ID.
  8. * - total: Total number of fields in profile.
  9. * - completed: How many fields the user has filled.
  10. * - incomplete: The inverse of $completed, how many empty fields left.
  11. * - next_percent: The percent if the user filled the next field.
  12. * - nextfield_name: The name of the suggested next field to fill (machine name).
  13. * - nextfield_title: The name of the suggested next field to fill (human readable name).
  14. * - current_percent: From 0 to 100% of how much the profile is complete.
  15. *
  16. */
  17. #}
  18. {% spaceless %}
  19. <style type="text/css">
  20. .pcp-percent-bar { width: 0{{ current_percent }}%; }
  21. </style>
  22. <div class="pcp-wrapper pcp-user">
  23. {% trans %}
  24. <span class="profile-completed"> {{ current_percent }}% Complete</span>
  25. {% endtrans %}
  26. <div class="pcp-percent-bar-wrapper">
  27. <div class="pcp-percent-bar user-user"></div>
  28. </div>
  29. <div class="pcp-next-field">
  30. {% if nextfield_title %}
  31. {% trans %}
  32. Filling out <em><a href="/user/{{ uid }}/edit#edit-{{ nextfield_name }}-wrapper" target={{ open_link }} >{{ nextfield_title }}</a></em> will bring your profile to {{ next_percent }}% complete
  33. {% endtrans %}
  34. {% endif %}
  35. </div>
  36. </div>
  37. {% endspaceless %}