2011-07-13 03:38:42 +04:00
|
|
|
from django import forms
|
|
|
|
from django.conf import settings
|
|
|
|
from django.forms.widgets import RadioSelect
|
|
|
|
|
|
|
|
from tower import ugettext_lazy as _
|
|
|
|
|
|
|
|
import amo
|
|
|
|
|
|
|
|
|
2012-01-25 09:13:55 +04:00
|
|
|
appvers = [(amo.APP_IDS[d['app']], d['main']) for d in settings.COMPAT]
|
|
|
|
APPVER_CHOICES = [
|
|
|
|
('%s-%s' % (app.id, ver), '%s %s' % (unicode(app.pretty), ver))
|
|
|
|
for app, ver in appvers
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
class AppVerForm(forms.Form):
|
|
|
|
appver = forms.ChoiceField(choices=[('', _('All'))] + APPVER_CHOICES,
|
|
|
|
required=False)
|
|
|
|
|
|
|
|
|
2011-07-13 03:38:42 +04:00
|
|
|
class CompatForm(forms.Form):
|
2012-01-25 09:13:55 +04:00
|
|
|
appver = forms.ChoiceField(choices=APPVER_CHOICES, required=False)
|
2011-07-13 03:38:42 +04:00
|
|
|
type = forms.ChoiceField(choices=(('all', _('All Add-ons')),
|
|
|
|
('binary', _('Binary')),
|
|
|
|
('non-binary', _('Non-binary'))),
|
|
|
|
widget=RadioSelect, required=False)
|