mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
Rating mit SelectField
This commit is contained in:
parent
251804226c
commit
7985aadf17
@ -67,7 +67,7 @@ class BaseEventForm(FlaskForm):
|
||||
(int(EventAttendanceMode.mixed), lazy_gettext('EventAttendanceMode.mixed'))])
|
||||
|
||||
photo_file = FileField(lazy_gettext('Photo'), validators=[FileAllowed(['jpg', 'jpeg', 'png'], lazy_gettext('Images only!'))])
|
||||
rating = RadioField(lazy_gettext('Rating'), default=50, coerce=int, choices=[
|
||||
rating = SelectField(lazy_gettext('Rating'), default=50, coerce=int, choices=[
|
||||
(0,lazy_gettext('0 (Little relevant)')),
|
||||
(10,'1'),
|
||||
(20,'2'),
|
||||
@ -141,7 +141,7 @@ class ReviewEventForm(FlaskForm):
|
||||
(int(EventRejectionReason.untrustworthy), lazy_gettext('EventRejectionReason.untrustworthy')),
|
||||
(int(EventRejectionReason.illegal), lazy_gettext('EventRejectionReason.illegal'))])
|
||||
|
||||
rating = RadioField(lazy_gettext('Rating'), default=50, coerce=int, choices=[
|
||||
rating = SelectField(lazy_gettext('Rating'), default=50, coerce=int, choices=[
|
||||
(0,lazy_gettext('0 (Little relevant)')),
|
||||
(10,'1'),
|
||||
(20,'2'),
|
||||
|
||||
@ -382,6 +382,10 @@ class FeaturedEvent(db.Model, TrackableMixin):
|
||||
rejection_resaon = Column(IntegerEnum(FeaturedEventRejectionReason))
|
||||
rating = Column(Integer())
|
||||
|
||||
@hybrid_property
|
||||
def verified(self):
|
||||
return self.review_status == FeaturedEventReviewStatus.verified
|
||||
|
||||
class Event(db.Model, TrackableMixin):
|
||||
__tablename__ = 'event'
|
||||
id = Column(Integer(), primary_key=True)
|
||||
|
||||
@ -139,7 +139,7 @@ $( function() {
|
||||
{{ _('Rating') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_radio_buttons(form.rating) }}
|
||||
{{ render_field_with_errors(form.rating) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@ -10,25 +10,11 @@
|
||||
<form action="" method="POST">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
{{ _('Review') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_field_with_errors(form.review_status) }}
|
||||
{{ render_field_with_errors(form.rejection_resaon) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ render_field_with_errors(form.review_status) }}
|
||||
{{ render_field_with_errors(form.rejection_resaon) }}
|
||||
|
||||
{% if form.rating.choices|length > 1 %}
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
{{ _('Rating') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_radio_buttons(form.rating) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ render_field_with_errors(form.rating) }}
|
||||
{% endif %}
|
||||
|
||||
{{ render_field(form.submit) }}
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
{{ _('Rating') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_radio_buttons(form.rating) }}
|
||||
{{ render_field_with_errors(form.rating) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user