diff --git a/templates/zephyr/accounts_home.html b/templates/zephyr/accounts_home.html index 88cc5a5a06..102d72318b 100644 --- a/templates/zephyr/accounts_home.html +++ b/templates/zephyr/accounts_home.html @@ -1,28 +1,30 @@ -{% extends "zephyr/base.html" %} +{% extends "zephyr/content_base.html" %} +{% block more_content %} + -{% block content %} -
-
-
-
-

Humbug

-

Zephyr for the masses (?)

+
+

You’re not using your Zip drive anymore.

+

You’re not calling your parents from the pay phone at school, asking + to be picked up because you stayed late to go to the computer club + meeting.

+

You haven’t watched Saved by the Bell in a while.

+

So why are you still using IRC?

+
+

Discover a better alternative for group communication at work.

-
-

Here we describe what makes it so great.

- -

With several features such as: -

    -
  • Sending messages
  • -
  • Reading messages
  • -
  • Incessant polling
  • -

- -

- Log in » - Register » -

+ -
-
{% endblock %} diff --git a/templates/zephyr/base.html b/templates/zephyr/base.html index e0cdef093c..8d613ef042 100644 --- a/templates/zephyr/base.html +++ b/templates/zephyr/base.html @@ -5,7 +5,6 @@ Humbug, from Humbug Inc. - {# We need to import jQuery before Bootstrap #} diff --git a/templates/zephyr/content_base.html b/templates/zephyr/content_base.html new file mode 100644 index 0000000000..c3477cd184 --- /dev/null +++ b/templates/zephyr/content_base.html @@ -0,0 +1,28 @@ +{% extends "zephyr/base.html" %} + + {% block customhead %} + + + + {% endblock %} + +{% block content %} + +
+
+
+
+
Humbug{% block for_you %}{% endblock %}
+ {% block more_content %} + {% endblock %} +
+
+ +{% endblock %} diff --git a/templates/zephyr/index.html b/templates/zephyr/index.html index fd1133a7cd..cf1b922729 100644 --- a/templates/zephyr/index.html +++ b/templates/zephyr/index.html @@ -21,6 +21,7 @@ {% autoescape off %} + diff --git a/templates/zephyr/login.html b/templates/zephyr/login.html index 4cada5e4f4..ef91c4fdaf 100644 --- a/templates/zephyr/login.html +++ b/templates/zephyr/login.html @@ -1,12 +1,16 @@ -{% extends "zephyr/base.html" %} +{% extends "zephyr/content_base.html" %} -{% block content %} +{% block more_content %} -

Log in

+

You look familiar.

{% if form.errors %}
@@ -14,17 +18,31 @@ autofocus('#id_username');
{% endif %} -
-{% csrf_token %} - - -{{ form.username }} - -{{ form.password.label_tag }} -{{ form.password }} - -
+
+ {% csrf_token %} +
+ +
+ {{ form.username }} +
+
+
+ +
+ {{ form.password }} +
+
+
+
+ +
+
+ +
+ +
+ {% endblock %} diff --git a/templates/zephyr/register.html b/templates/zephyr/register.html index a04c0d2c78..6cbf774110 100644 --- a/templates/zephyr/register.html +++ b/templates/zephyr/register.html @@ -1,27 +1,49 @@ -{% extends "zephyr/base.html" %} +{% extends "zephyr/content_base.html" %} -{% block content %} +{% block for_you %}for {% if company_name %} {{company_name}} {% else %} __________ {% endif %} {% endblock %} +{% block more_content %} -

Register for an account

+

(Welcome! We think you'll like it here.)

-
+
+
+

You're almost there. We just need you to do one last thing.

+

Tell us a bit about yourself.

+
+ + {% csrf_token %} - -{{ form.full_name.label_tag }} -{{ form.full_name }} - -{{ form.short_name.label_tag }} -{{ form.short_name }} - -{{ form.email.label_tag }} -{{ form.email }} - -{{ form.password.label_tag }} -{{ form.password }} +
+ +
+ {% if company_name %} {# They entered through the main page and already entered their email #} + {{ form.email.as_hidden }} +

{{ form.email.value }}

+ {% else %} + {{ form.email }} + {% endif %} +

+
+
+ +
+ {{ form.full_name }} +
+
+
+ +
+ {{ form.password }} +
+


diff --git a/zephyr/forms.py b/zephyr/forms.py index c50a381d99..b5baed9b42 100644 --- a/zephyr/forms.py +++ b/zephyr/forms.py @@ -2,6 +2,5 @@ from django import forms class RegistrationForm(forms.Form): full_name = forms.CharField(max_length=100) - short_name = forms.CharField(max_length=100) email = forms.EmailField() password = forms.CharField(widget=forms.PasswordInput, max_length=100) diff --git a/zephyr/static/js/signup.js b/zephyr/static/js/signup.js new file mode 100644 index 0000000000..a1bf1af51a --- /dev/null +++ b/zephyr/static/js/signup.js @@ -0,0 +1,28 @@ +/*jslint browser: true, devel: true, sloppy: true, + plusplus: true, nomen: true, regexp: true */ +/*global $: false, jQuery: false */ + +var tld_list = ['gmail.com']; +$.validator.addMethod("fromDomain", function (value, element, param) { + console.log("foo"); + console.log(value); + var splitted = value.split("@"); + var tld = splitted[spitted.length - 1]; + return false; + return $.inArray(tld, tld_list) !== -1; +}, + "Please use your company email address to sign up. Otherwise, we won’t be able to connect you with your coworkers."); + +$(document).ready(function(){ + $("#email_signup").validate({ + rules: { + email: { + required: true, + email: true, + } + }, + errorElement: "div", + errorClass: "alert", + + }); +}); diff --git a/zephyr/static/styles/signup.css b/zephyr/static/styles/signup.css new file mode 100644 index 0000000000..8e31c3f155 --- /dev/null +++ b/zephyr/static/styles/signup.css @@ -0,0 +1,46 @@ +body { + font-family: 'Open Sans', Helvetica, Arial, sans-serif; +} + +div.title { + font-family: Helvetica; + font-size: 100px; + font-weight: bold; + padding-top: 50px; + padding-bottom: 60px; +} + +.lead { + font-weight: bold; +} + +div.pitch { + width: 500px; +} + +div.signup { + width: 650px; + padding: 8px 35px 8px 14px; + margin-bottom: 20px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); + background-color: LightGray; + border: 1px solid DarkGray; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +span.or { + padding-left: 25px; + padding-right: 25px; + +} + +span.for_you { + font-size: 30px; + font-style: italic; +} + +#company-email { + display: none; +} diff --git a/zephyr/views.py b/zephyr/views.py index f03a64962c..23c41c042f 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -50,9 +50,14 @@ def strip_html(x): def register(request): if request.method == 'POST': + try: + email = strip_html(request.POST['email']) + company_name = email.split('@')[-1] + except KeyError: + company_name = None + form = RegistrationForm(request.POST) if form.is_valid(): - email = strip_html(request.POST['email']) password = request.POST['password'] full_name = strip_html(request.POST['full_name']) short_name = strip_html(request.POST['short_name']) @@ -70,9 +75,10 @@ def register(request): return HttpResponseRedirect(reverse('zephyr.views.home')) else: form = RegistrationForm() + company_name = None return render(request, 'zephyr/register.html', { - 'form': form, + 'form': form, 'company_name': company_name, }) def accounts_home(request):