rate-template-number-up-down.html.twig in Rate 8
Default theme implementation for up/down voting display.
Available variables:
- widget_attributes: Attributes for outer div.
- has_voted: Boolean if user has voted.
- user_voted: What the user voted.
- up_attributes: Attributes for up vote div.
- up_url: Url to vote up.
- score_attributes: Attributes for score display div.
- score: Up votes minus down votes.
- down_attributes: Attributes for down vote div.
- down_url: Url to vote down.
- score: Number of up votes.
- undo: Link to undo placed vote.
- undo_attributes: Attributes for undo div.
- info_description: Extra textual info to display.
File
templates/rate-template-number-up-down.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for up/down voting display.
- *
- * Available variables:
- * - widget_attributes: Attributes for outer div.
- * - has_voted: Boolean if user has voted.
- * - user_voted: What the user voted.
- * - up_attributes: Attributes for up vote div.
- * - up_url: Url to vote up.
- * - score_attributes: Attributes for score display div.
- * - score: Up votes minus down votes.
- * - down_attributes: Attributes for down vote div.
- * - down_url: Url to vote down.
- * - score: Number of up votes.
- * - undo: Link to undo placed vote.
- * - undo_attributes: Attributes for undo div.
- * - info_description: Extra textual info to display.
- *
- * @ingroup themeable
- */
- #}
- <div{{ widget_attributes }}>
- {% if (has_voted or not can_vote) %}
- <div{{up_attributes}}>{{ 'Up'|t }}</div>
- {% else %}
- <a {{ up_attributes }} href="{{ up_url }}">{{ 'Up'|t }}</a>
- {% endif %}
- <div{{ score_attributes }}>
- {{ score }}
- </div>
- {% if (has_voted or not can_vote) %}
- <div{{down_attributes}}> {{ 'Down'|t }}</div>
- {% else %}
- <a {{ down_attributes }} href="{{ down_url }}">{{ 'Down'|t }}</a>
- {% endif %}
- {% if undo %}
- <div{{ undo_attributes }}>{{ undo }}</div>
- {% endif %}
- {{ info_description }}
- </div>