Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit e1fde89

Browse files
committed
Revert @ednapirahna's newsletter stuff
1 parent dba751b commit e1fde89

File tree

10 files changed

+2
-146
lines changed

10 files changed

+2
-146
lines changed

media/css/ecosystem/landing.less

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -145,90 +145,6 @@
145145
}
146146
}
147147
}
148-
149-
#newsletter-signup {
150-
.border-wrapper;
151-
background: @white url(../../img/ecosystem/newsletter-arrow.png) no-repeat 320px 50%;
152-
clear: both;
153-
float: left;
154-
width: 100%;
155-
156-
.form-title, .form-icons, .form-data, .form-details {
157-
float: left;
158-
}
159-
160-
.form-title {
161-
margin-right: 80px;
162-
width: 300px;
163-
164-
h3 {
165-
background: url(../../img/ecosystem/loop.png) no-repeat 0 8px;
166-
font-size: 32px;
167-
line-height: 35px;
168-
padding-left: 45px;
169-
}
170-
171-
p {
172-
font-size: 18px;
173-
line-height: 22px;
174-
}
175-
}
176-
177-
.form-icons {
178-
margin-right: 20px;
179-
width: 240px;
180-
181-
p {
182-
float: left;
183-
font-size: 12px;
184-
line-height: 15px;
185-
padding: 0 5px;
186-
text-align: center;
187-
width: 70px;
188-
}
189-
}
190-
191-
.form-data {
192-
width: 270px;
193-
194-
input[type="text"] {
195-
width: 270px;
196-
}
197-
198-
.form-details {
199-
margin-top: 5px;
200-
201-
small {
202-
display: inline-block;
203-
float: right;
204-
font-size: 12px;
205-
line-height: 15px;
206-
margin-bottom: 10px;
207-
width: 250px;
208-
}
209-
}
210-
211-
}
212-
213-
#footer-email-errors, #footer-email-success {
214-
float: right;
215-
padding: 10px 20px 0;
216-
}
217-
218-
form {
219-
display: block;
220-
float: left;
221-
padding: 5px 25px;
222-
223-
.button {
224-
background: #5ab045;
225-
display: block;
226-
font-size: 15px;
227-
margin: 0 auto;
228-
min-width: 150px;
229-
}
230-
}
231-
}
232148
}
233149

234150
#landing-page .half {

media/img/ecosystem/loop.png

-3.51 KB
Binary file not shown.
-2.5 KB
Binary file not shown.
-1.99 KB
Binary file not shown.
-2.65 KB
Binary file not shown.
-1.67 KB
Binary file not shown.

mkt/developers/forms.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -825,16 +825,6 @@ def save(self):
825825
self.instance.save()
826826

827827

828-
class DevNewsletterForm(happyforms.Form):
829-
"""Devhub newsletter subscription form."""
830-
email = forms.EmailField(
831-
error_messages={'required':
832-
_lazy(u'Please enter a valid email address.')})
833-
privacy = forms.BooleanField(
834-
error_messages={'required':
835-
_lazy(u'You must agree to the Privacy Policy.')})
836-
837-
838828
class AppFormTechnical(addons.forms.AddonFormBase):
839829
developer_comments = TransField(widget=TransTextarea, required=False)
840830
flash = forms.BooleanField(required=False)

mkt/ecosystem/tests/test_views.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from django.conf import settings
22

3-
import basket
43
import mock
54
from nose.tools import eq_
65
from pyquery import PyQuery as pq
@@ -42,33 +41,6 @@ def test_tutorials_refresh_disabled(self, mock_):
4241
self.client.get(self.url, {'refresh': '1'})
4342
assert not mock_.called
4443

45-
@mock.patch('basket.subscribe')
46-
def test_newsletter_form_valid(self, subscribe_mock):
47-
d = {'email': 'a@b.cd', 'privacy': True}
48-
r = self.client.post(self.url, d)
49-
self.assert3xx(r, reverse('ecosystem.landing'))
50-
assert subscribe_mock.called
51-
52-
@mock.patch('basket.subscribe')
53-
def test_newsletter_form_invalid(self, subscribe_mock):
54-
d = {'email': '', 'privacy': True}
55-
r = self.client.post(self.url, d)
56-
eq_(r.status_code, 200)
57-
self.assertFormError(r, 'newsletter_form', 'email',
58-
[u'Please enter a valid email address.'])
59-
assert not subscribe_mock.called
60-
61-
@mock.patch('basket.subscribe')
62-
def test_newsletter_form_exception(self, subscribe_mock):
63-
subscribe_mock.side_effect = basket.BasketException
64-
d = {'email': 'a@b.cd', 'privacy': True}
65-
r = self.client.post(self.url, d)
66-
eq_(r.status_code, 200)
67-
eq_(pq(r.content)('.notification-box.error h2').text(),
68-
'We apologize, but an error occurred in our '
69-
'system. Please try again later.')
70-
assert subscribe_mock.called
71-
7244

7345
class TestDevHub(amo.tests.TestCase):
7446

mkt/ecosystem/views.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
from django.conf import settings
22
from django.http import Http404
3-
from django.shortcuts import get_object_or_404, redirect
3+
from django.shortcuts import get_object_or_404
44

5-
import basket
65
import commonware.log
76
import jingo
8-
from session_csrf import anonymous_csrf
97
from tower import ugettext as _
108

11-
from amo import messages
12-
from mkt.developers.forms import DevNewsletterForm
139
from mkt.ecosystem.tasks import refresh_mdn_cache
1410
from mkt.site import messages
1511

@@ -29,7 +25,6 @@ def _refresh_mdn(request):
2925
' Thanks for all your awesome work! Devs appreciate it!')
3026

3127

32-
@anonymous_csrf
3328
def landing(request):
3429
"""Developer Hub landing page."""
3530
_refresh_mdn(request)
@@ -56,24 +51,8 @@ def landing(request):
5651
'path': 'FirefoxMarketplace_box-BR-RC-SD1%20640'
5752
}
5853
]
59-
60-
form = DevNewsletterForm(request.POST or None)
61-
62-
if request.method == 'POST' and form.is_valid():
63-
data = form.cleaned_data
64-
65-
try:
66-
basket.subscribe(data['email'],
67-
'app-dev',
68-
source_url=settings.SITE_URL)
69-
messages.success(request, _('Thank you for subscribing!'))
70-
return redirect('ecosystem.landing')
71-
except basket.BasketException:
72-
messages.error(request, _('We apologize, but an error '
73-
'occurred in our system. Please try again later.'))
74-
7554
return jingo.render(request, 'ecosystem/landing.html',
76-
{'videos': videos, 'newsletter_form': form})
55+
{'videos': videos})
7756

7857

7958
def support(request):

requirements/prod.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ amqplib==1.0.2
22
anyjson==0.3.3
33
argparse==1.2.1
44
babel==0.9.6
5-
basket-client==0.3.1
65
bleach==1.1.5
76
cef==0.5
87
celery==2.5.1

0 commit comments

Comments
 (0)