diff --git a/humbug/settings.py b/humbug/settings.py index 927deb0ba9..c3b8bfa841 100644 --- a/humbug/settings.py +++ b/humbug/settings.py @@ -260,6 +260,10 @@ PIPELINE_JS = { 'source_filenames': ('js/common.js',), 'output_filename': 'min/common.js' }, + 'landing-page': { + 'source_filenames': ('js/landing-page.js',), + 'output_filename': 'min/landing-page.js' + }, 'signup': { 'source_filenames': ('js/signup.js',), 'output_filename': 'min/signup.js' diff --git a/humbug/urls.py b/humbug/urls.py index 5ceb278135..5a6206d3e1 100644 --- a/humbug/urls.py +++ b/humbug/urls.py @@ -59,13 +59,12 @@ urlpatterns = patterns('', url(r'^new-user$', TemplateView.as_view(template_name='zephyr/new-user.html')), url(r'^features$', TemplateView.as_view(template_name='zephyr/features.html')), - # Landing page and signup form + # Landing page, signup form, and nice register URL url(r'^hello$', TemplateView.as_view(template_name='zephyr/hello.html'), name='landing-page'), - url(r'^signup$', TemplateView.as_view(template_name='zephyr/signup.html'), + url(r'^signup/$', TemplateView.as_view(template_name='zephyr/signup.html'), name='signup'), - - + url(r'^signup/sign-me-up$', 'zephyr.views.beta_signup_submission', name='beta-signup-submission'), # API and integrations documentation url(r'^api$', TemplateView.as_view(template_name='zephyr/api.html')), diff --git a/templates/zephyr/signup.html b/templates/zephyr/signup.html index 949f3fd345..1d8a5ad52e 100644 --- a/templates/zephyr/signup.html +++ b/templates/zephyr/signup.html @@ -1,10 +1,67 @@ {% extends "zephyr/portico.html" %} +{% load compressed %} -{% block portico_content %} +{% block customhead %} + {% compressed_css 'portico' %} + + {% compressed_js 'landing-page' %} +{% endblock %} -
-
+{% block inner_content %} +
+
+

Sign up now!

+

Humbug is currently in closed beta, but we're constantly + adding new beta customer sites.

+
+
+
+

Success!

+ Thank you for your interest. We'll be in touch soon. + While you wait, check out some of our features! +
+ +
+

Ruh-roh!

+ Hmmm, something went wrong. Please send email to support@humbughq.com. +
+ +
+

Your email is required!

+ How else would we be able to reach you? +
+ +
+
+ PAR COURRIER ELECTRONIQUE +
+ {% csrf_token %} +

Hi Humbugs,

+ +

My name is , and + you can email me at . + + +

I work at , + and I was hoping to give Humbug a try! There are + about of us, and we currently use + for chat.

+ +

I'm looking forward to it!

+ + +
+
+
+
+
{% endblock %} diff --git a/zephyr/static/js/landing-page.js b/zephyr/static/js/landing-page.js new file mode 100644 index 0000000000..14a0bdae3f --- /dev/null +++ b/zephyr/static/js/landing-page.js @@ -0,0 +1,28 @@ +$(function () { + $(".letter-form").ajaxForm({ + dataType: 'json', // This seems to be ignored. We still get back an xhr. + beforeSubmit: function (arr, form, options) { + $(".alert").hide(); + var has_email = false; + $.each(arr, function (idx, elt) { + if (elt.name === 'email' && elt.value.length) { + has_email = true; + } + }); + if (!has_email) { + $("#error-missing-email").show(); + return false; + } + $("#beta-signup").attr('disabled', 'disabled').text("Sending..."); + }, + success: function (resp, statusText, xhr, form) { + $("#success").show(); + }, + error: function (xhr, error_type, xhn) { + $("#error").show(); + }, + complete: function (xhr, statusText) { + $("#beta-signup").removeAttr('disabled').text("Sign up"); + } + }); +}); diff --git a/zephyr/static/styles/portico.css b/zephyr/static/styles/portico.css index 834edb69db..b2eabccf37 100644 --- a/zephyr/static/styles/portico.css +++ b/zephyr/static/styles/portico.css @@ -224,3 +224,53 @@ img.screenshot{ background-color: #474747; color: white; } + +.postal-envelope { + background-color: white; + border: 1px solid black; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; +} + +.postal-stripes { + padding: 0px; + margin: 0px; + height: 10px; + background-image: repeating-linear-gradient(-60deg, #fff, #fff 10px, #62a0cf 10px, #62a0cf 20px, #fff 20px, #fff 30px, #d66468 30px, #d66468 40px ); +} + +.par-avion { + font-size: 80%; + float: right; + margin-right: 1em; +} + +.letter-form { + font-size: 110%; + padding-top: 2em; + padding-left: 4em; + padding-right: 4em; +} + +.letter-form input { + border: 0px; + border-bottom: 1px dashed grey; + box-shadow: none; + padding-bottom: 0px; + transition: border linear 0.2s; + +} + +@media (max-width: 767px) { + /* This is a hack and I'm not 100% sure why it's necessary, + but otherwise when we resize the form to be pretty narrow, + this gets crushed */ + #envelope-holder { + margin-left: 0px; + } +} + +.alert { + display: none; +} diff --git a/zephyr/views.py b/zephyr/views.py index 75e1d5d2e2..3178c8d8d7 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -190,6 +190,21 @@ def rest_dispatch(request, **kwargs): return target_function(request, **kwargs) return json_method_not_allowed(supported_methods.keys()) +@require_post +@has_request_variables +def beta_signup_submission(request, name=REQ, email=REQ, + company=REQ, count=REQ, product=REQ): + content = """Name: %s +Email: %s +Company: %s +# users: %s +Currently using: %s""" % (name, email, company, count, product,) + subject = "Interest in Humbug: %s" % company + from_email = '"%s" via Web ' % (name,) + to_email = '"Humbug Signups" ' + send_mail(subject, content, from_email, [to_email]) + return json_success() + @require_post def accounts_register(request): key = request.POST['key']