2012-04-03 05:32:14 +04:00
|
|
|
from tower import ugettext_lazy as _lazy
|
2012-04-03 01:34:59 +04:00
|
|
|
|
2012-04-12 23:04:34 +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
|
|
|
|
2012-04-03 05:32:14 +04:00
|
|
|
from mkt.reviewers.utils import ReviewHelper
|
2012-04-03 01:34:59 +04:00
|
|
|
|
|
|
|
|
|
|
|
class ReviewAppForm(ReviewAddonForm):
|
|
|
|
|
|
|
|
def __init__(self, *args, **kw):
|
2012-04-12 23:04:34 +04:00
|
|
|
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([])
|
2012-04-03 05:32:14 +04:00
|
|
|
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
|
|
|
|
|
|
|
|
2012-06-29 22:33:19 +04:00
|
|
|
def get_review_form(data, request=None, addon=None, version=None):
|
|
|
|
helper = ReviewHelper(request=request, addon=addon, version=version)
|
2012-04-03 05:32:14 +04:00
|
|
|
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}
|