{%- if comment -%} {% set vote_item = comment %} {%- elif item -%} {% set vote_item = item %} {%- endif -%} {%- if current_user.is_authenticated() %} {%- if vote_item.user_id == current_user.id or vote_item.voted_for(current_user.id) %} {% else %} {% endif -%} {% else %} {% endif -%}