addons-server/mkt/reviewers/forms.py

34 строки
1.1 KiB
Python
Исходник Обычный вид История

from tower import ugettext_lazy as _lazy
2012-04-03 01:34:59 +04:00
import amo
2012-04-18 02:10:19 +04:00
from editors.forms import ReviewAddonForm, ReviewLogForm
2012-04-03 01:34:59 +04:00
from mkt.reviewers.utils import ReviewHelper
2012-04-03 01:34:59 +04:00
class ReviewAppForm(ReviewAddonForm):
def __init__(self, *args, **kw):
kw.update(type=amo.CANNED_RESPONSE_APP)
2012-04-03 01:34:59 +04:00
super(ReviewAppForm, self).__init__(*args, **kw)
# We don't want to disable any app files:
self.addon_files_disabled = tuple([])
self.fields['notify'].label = _lazy(
u'Notify me the next time the manifest is updated. (Subsequent '
'updates will not generate an email.)')
2012-04-03 01:34:59 +04:00
def get_review_form(data, request=None, addon=None, version=None):
helper = ReviewHelper(request=request, addon=addon, version=version)
return ReviewAppForm(data, helper=helper)
2012-04-18 02:10:19 +04:00
class ReviewAppLogForm(ReviewLogForm):
def __init__(self, *args, **kwargs):
super(ReviewAppLogForm, self).__init__(*args, **kwargs)
self.fields['search'].widget.attrs = {
# L10n: Descript of what can be searched for.
2012-08-13 09:10:54 +04:00
'placeholder': _lazy(u'app, reviewer, or comment'),
2012-04-18 02:10:19 +04:00
'size': 30}