diff --git a/app/templates/macros/forms.html b/app/templates/macros/forms.html index 858e0d4d..89525f95 100644 --- a/app/templates/macros/forms.html +++ b/app/templates/macros/forms.html @@ -133,6 +133,21 @@ {% endfor %} {%- endmacro %} +{% macro render_toggle_field(field, icons=[]) -%} +
+ {% for value, label, checked in field.iter_choices() %} + + {% endfor %} +
+{%- endmacro %} + {% macro render_submit_field(field, label=None, tabindex=None) -%} {% if not label %}{% set label=field.label.text %}{% endif %} {##} diff --git a/app/templates/macros/reviews.html b/app/templates/macros/reviews.html index 642e086a..1ab9de59 100644 --- a/app/templates/macros/reviews.html +++ b/app/templates/macros/reviews.html @@ -87,11 +87,11 @@
diff --git a/app/templates/packages/review_create_edit.html b/app/templates/packages/review_create_edit.html index 6ed6fe12..eb4dff27 100644 --- a/app/templates/packages/review_create_edit.html +++ b/app/templates/packages/review_create_edit.html @@ -11,7 +11,7 @@ {% block content %}

{{ _("Post a review for %(title)s by %(author)s", title=self.link(), author=package.author.display_name) }}

-{% from "macros/forms.html" import render_field, render_submit_field, render_radio_field %} +{% from "macros/forms.html" import render_field, render_submit_field, render_toggle_field %}
{{ form.hidden_tag() }}
@@ -28,7 +28,7 @@

{{ _("Do you recommend this %(type)s?", type=package.type.value | lower) }}

- {{ render_radio_field(form.recommends) }} + {{ render_toggle_field(form.recommends, icons={"yes":"fa-thumbs-up", "no":"fa-thumbs-down"}) }}

{{ _("Why or why not? Try to be constructive") }}