2015-07-18 07:09:17 +00:00
|
|
|
from __future__ import unicode_literals
|
2012-08-14 07:54:45 +00:00
|
|
|
from django import forms
|
2015-06-26 03:46:09 +00:00
|
|
|
from django.utils.translation import ugettext_lazy as _
|
2012-08-14 07:54:45 +00:00
|
|
|
|
|
|
|
from markitup.widgets import MarkItUpWidget
|
|
|
|
|
|
|
|
from symposion.reviews.models import Review, Comment, ProposalMessage, VOTES
|
|
|
|
|
|
|
|
|
|
|
|
class ReviewForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Review
|
|
|
|
fields = ["vote", "comment"]
|
2014-07-30 18:19:26 +00:00
|
|
|
widgets = {"comment": MarkItUpWidget()}
|
|
|
|
|
2012-08-14 07:54:45 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(ReviewForm, self).__init__(*args, **kwargs)
|
|
|
|
self.fields["vote"] = forms.ChoiceField(
|
2014-07-30 18:19:26 +00:00
|
|
|
widget=forms.RadioSelect(),
|
|
|
|
choices=VOTES.CHOICES
|
2012-08-14 07:54:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ReviewCommentForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = Comment
|
|
|
|
fields = ["text"]
|
2014-07-30 18:19:26 +00:00
|
|
|
widgets = {"text": MarkItUpWidget()}
|
2012-08-14 07:54:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class SpeakerCommentForm(forms.ModelForm):
|
|
|
|
class Meta:
|
|
|
|
model = ProposalMessage
|
|
|
|
fields = ["message"]
|
2014-07-30 18:19:26 +00:00
|
|
|
widgets = {"message": MarkItUpWidget()}
|
2012-08-14 07:54:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
class BulkPresentationForm(forms.Form):
|
|
|
|
talk_ids = forms.CharField(
|
2015-06-26 03:46:09 +00:00
|
|
|
label=_("Talk ids"),
|
2012-08-14 07:54:45 +00:00
|
|
|
max_length=500,
|
2015-06-26 03:46:09 +00:00
|
|
|
help_text=_("Provide a comma seperated list of talk ids to accept.")
|
2012-08-14 07:54:45 +00:00
|
|
|
)
|