You are here

rate-widget.html.twig in Rate 8.2

Default theme implementation for a voting widget.

Available variables:

  • widget_template: name of the template.
  • display_settings: the display settings of the rate widget.
  • results_settings: settings for the resulsts of the rate widget.
  • label_attributes: class and collspan for the label.
  • description_attributes: class and collspan for the label.
  • result_attributes: class and collspan for the label.

File

templates/rate-widget.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a voting widget.
  5. *
  6. * Available variables:
  7. * - widget_template: name of the template.
  8. * - display_settings: the display settings of the rate widget.
  9. * - results_settings: settings for the resulsts of the rate widget.
  10. * - label_attributes: class and collspan for the label.
  11. * - description_attributes: class and collspan for the label.
  12. * - result_attributes: class and collspan for the label.
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. <table class="rating-table">
  18. {% if display_settings.display_label and display_settings.label_position == 'above' %}
  19. <tr class="rating-table-tr">
  20. <td {{ label_attributes.addClass('rating-table-td') }}>{{ display_settings.display_label }}</td>
  21. </tr>
  22. {% endif %}
  23. <tr class="rating-table-tr">
  24. {% if display_settings.display_label and display_settings.label_position == 'inline' %}
  25. <td {{ label_attributes.addClass('rating-table-td') }}>{{ display_settings.display_label }}</td>
  26. {% endif %}
  27. <td class="rating-table-td">{{ form|without('result') }}</td>
  28. {% if results_settings.result_position == 'right' %}
  29. <td {{ result_attributes.addClass('rating-table-td')}}>{{ form.result }}</td>
  30. {% endif %}
  31. {% if display_settings.description_position == 'right' %}
  32. <td{{ description_attributes.addClass('rating-table-td') }}>{{ display_settings.description }}</td>
  33. {% endif %}
  34. </tr>
  35. {% if display_settings.description and display_settings.description_position == 'below' %}
  36. <tr class="rating-table-tr">
  37. {% if display_settings.display_label and display_settings.label_position == 'inline' %}
  38. <td class="rating-table-td"></td>
  39. {% endif %}
  40. <td{{ description_attributes.addClass('rating-table-td') }}>{{ display_settings.description }}</td>
  41. </tr>
  42. {% endif %}
  43. {% if results_settings.result_position == 'below' %}
  44. <tr class="rating-table-tr">
  45. {% if display_settings.display_label and display_settings.label_position == 'inline' %}
  46. <td class="rating-table-td"></td>
  47. {% endif %}
  48. <td{{result_attributes.addClass('rating-table-td')}}>{{ form.result }}</td>
  49. </tr>
  50. {% endif %}
  51. </table>