{% for att in rankingIndividual %}{% if app.user.id == att.id %} {{att.score}}{% endif %}{% endfor %}
{% if trinder.cooperativeScore > 0 %}
{% set total = 0 %}
{% set userDonated = 0 %}
{% for record in donatedpoints %}
{% if record['attempt'].user.id == app.user.id %}
{% set userDonated = userDonated + record.score %}
{% set total = total + record.score %}
{% else %}
{% set total = total + record.score %}
{% endif %}
{% endfor %}
{% set porcentajeUserDonated = (userDonated * 100)/trinder.cooperativeScore %}
{% set porcentaje = (total * 100)/trinder.cooperativeScore %}
{# animacion #}
{#
100
#}
DONACIÓN ADECCO
{{maxpoints}}
{#
{{userDonated}}
YOU
#}
{# Calacular el max-width para que no se salga del progressbar #}
{% set maxWidthOtherPoints = 100 %}
{% if porcentajeUserDonated <= 20 %}
{# si el usuario tiene menos del 20 hacer la media sobre 80 #}
{% set maxWidthOtherPoints = (80 * (porcentaje + porcentajeUserDonated)) / 100 %}
{% if maxWidthOtherPoints > 80 %}
{% set maxWidthOtherPoints = 80 %}
{% endif %}
{% else %}
{% set maxWidthOtherPoints = 100 - porcentajeUserDonated %}
{% endif %}
{# RECUERDALO CABRON #}