Skip to content

Commit

Permalink
Merge branch 'staging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Levinger committed Feb 28, 2013
2 parents 33d36da + f6e96e4 commit fca8af4
Show file tree
Hide file tree
Showing 18 changed files with 1,418 additions and 174 deletions.
Binary file modified boris/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
267 changes: 160 additions & 107 deletions boris/locale/es/LC_MESSAGES/django.po

Large diffs are not rendered by default.

Binary file added boris/locale/ko/LC_MESSAGES/django.mo
Binary file not shown.
594 changes: 594 additions & 0 deletions boris/locale/ko/LC_MESSAGES/django.po

Large diffs are not rendered by default.

Binary file added boris/locale/zh/LC_MESSAGES/django.mo
Binary file not shown.
574 changes: 574 additions & 0 deletions boris/locale/zh/LC_MESSAGES/django.po

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion boris/media/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3280,7 +3280,7 @@
$el.wrap("<div class='fake-select-wrap'></div>");
$el.parent().append($fake);
check = function() {
$fake.text($el.val());
$fake.text($el.children('option:selected').text());
return $fake.toggleClass("focus", document.activeElement === this);
};
$el.on("change blur focus keyup", check);
Expand Down
2 changes: 1 addition & 1 deletion boris/media/javascripts/fake_inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$el.wrap("<div class='fake-select-wrap'></div>");
$el.parent().append($fake);
check = function() {
$fake.text($el.val());
$fake.text($el.children('option:selected').text());
return $fake.toggleClass("focus", document.activeElement === this);
};
$el.on("change blur focus keyup", check);
Expand Down
6 changes: 6 additions & 0 deletions boris/media/javascripts/translate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(function() {
$('#setlang select').change(function() {
this.form.submit();
});
$('#setlang input[type="submit"]').hide();
}).call(this);
13 changes: 13 additions & 0 deletions boris/media/stylesheets/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,19 @@ html, body, #wrap, #main {
height: 500px; }

/*added after metalabs, need to merge back*/
#setlang {
width: 100px;
position: absolute;
top: 70px;
right: 10px;
}

#setlang input.button {
padding:8px;
font-size: 12px;
line-height: 12px;
}

fieldset.surveyquestions h2 {
color: #797569;
font-size:14px;
Expand Down
18 changes: 14 additions & 4 deletions boris/settings.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# coding=utf-8

import os,sys
from os.path import join
PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
Expand Down Expand Up @@ -37,6 +39,14 @@
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'

#for the defined site translations
#first locale code, then language in its own descriptor
LANGUAGES = (('en', 'English'),
('es', 'Español'),
#('zh', '中文'),
#('ko', '한국어')
)

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
Expand Down Expand Up @@ -106,7 +116,7 @@
'django.middleware.cache.UpdateCacheMiddleware',
#then redirection
'sslify.middleware.SSLifyMiddleware',
'registrant.middleware.MobileDetectionMiddleware',
#'registrant.middleware.MobileDetectionMiddleware', #comment out, we are testing mobile styles
'registrant.middleware.ResponseInjectP3PMiddleware',
#then session & locale
'django.contrib.sessions.middleware.SessionMiddleware',
Expand Down Expand Up @@ -261,9 +271,9 @@ def get_cache():
#s3 settings
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = 'register2.rockthevote.com'
AWS_S3_CUSTOM_DOMAIN = 'dyw5n6uc3lgo5.cloudfront.net'
STATIC_URL = 'https://dyw5n6uc3lgo5.cloudfront.net/'
AWS_STORAGE_BUCKET_NAME = 'rocky-boris-test'
AWS_S3_CUSTOM_DOMAIN = 'd3rou2woe8vj33.cloudfront.net'
STATIC_URL = 'https://d3rou2woe8vj33.cloudfront.net/'
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'
#use heroku db
import dj_database_url
Expand Down
29 changes: 27 additions & 2 deletions boris/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<link rel="P3Pv1" href="w3c/p3p.xml" />
<link href="{% static 'stylesheets/site.css'%}" media="screen" rel="stylesheet" type="text/css" />
{%if customform %}<link href="{% static 'stylesheets/whitelabel.css'%}" media="screen" rel="stylesheet" type="text/css" />{%endif%}

{# david's mobile css#}
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<link media="handheld, only screen and (max-width: 480px), only screen and (max-device-width: 480px)" href="https://s3.rockthevote.com/dp/mobile/modified-css.css" type="text/css" rel="stylesheet" />
<!--[if IEMobile]>
<link rel="stylesheet" type="text/css" href="http://s3.rockthevote.com/dp/mobile/modified-css.css" media="screen" />
<![endif]-->

{% block styles %}{% endblock styles %}
<script src="{% static 'javascripts/modernizr.js'%}" type="text/javascript"></script>

Expand Down Expand Up @@ -48,7 +56,23 @@ <h1 class="container">

</h1>
</header>
<div id="content">{%block content%}{%endblock%}</div>

{%block setlang%}
<form action="/i18n/setlang/" method="post" id="setlang">
{% csrf_token %}
<select name="language">
<option value="">{%trans 'Translate'%}</option>
{% for lang in LANGUAGES %}
<option value="{{ lang.0 }}">{{ lang.1|capfirst }}</option>
{% endfor %}
</select>
{# <input type="submit" class="button" value="Go" /> #}
</form>
{%endblock%}
<div id="content">
{%block content%}{%endblock%}

</div>
</div>
<div class="scroll-shadows top"></div>
<div class="scroll-shadows bottom"></div>
Expand All @@ -60,7 +84,7 @@ <h1 class="container">
{% if cobrandform.logo and cobrandform.show_logo = 'b'%}
<span class="amp">&nbsp;&amp;&nbsp;</span>
<a class="logo cobrand {{cobrandform.name|slugify}}" {%if cobrandform.logo_link%}href="{{cobrandform.logo_link}}" target="_blank"{%endif%}>
<img src="{{ STATIC_URL }}{{cobrandform.logo}}" />
<img src="{{ STATIC_URL }}{{cobrandform.logo}}" /></a>
{%endif%}
{% if customform.powered_by_logo%}
<span class="amp">&nbsp;&amp;&nbsp;</span>
Expand All @@ -84,6 +108,7 @@ <h1 class="container">
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="{%static 'javascripts/application.js' %}" type="text/javascript"></script>
<script src="{%static 'javascripts/translate.js' %}" type="text/javascript"></script>

<div id="fb-root"></div>
{% if request.GET.facebook %}
Expand Down
49 changes: 8 additions & 41 deletions boris/templates/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
{%endblock%}

{%block content%}
<div class="span-24 last" style="padding: 19px 20px 3px">
{%if LANGUAGE_CODE == "en" %}<a class="locale" tabindex="-1" href="?locale=es{%if state%}&state={{state}}{%endif%}">En espa&ntilde;ol</a>
{%else%}<a class="locale" tabindex="-1" href="?locale=en{%if state%}&state={{state}}{%endif%}">In english</a>{%endif%}
</div>

<form class="registration-form" method="post" action="/registrants/submit/{%if has_partner%}?partner={{partner}}{%endif%}" accept-charset="UTF-8">
{% csrf_token %}
<fieldset class="name">
Expand All @@ -29,15 +24,17 @@
<option value="{% trans 'Ms.' %}">{% trans 'Ms.' %}</option>
<option value="{% trans 'Mrs.' %}">{% trans 'Mrs.' %}</option>
</select>
<div class="name-hint tooltip">{% trans "Title is required." %}</div>
</div>
<div class="input text span-8">
<label for="first_name">{% trans "First Name" %}</label>
<input required id="first_name" name="first_name" type="text" />
<div class="full-name-hint tooltip">{% trans "Use your full first name. Do not use nicknames or initials."%}</div>
<div class="first-name-hint tooltip">{% trans "Use your full first name. Do not use nicknames or initials."%}</div>
</div>
<div class="input text span-8">
<label for="last_name">{% trans "Last Name" %}</label>
<input required id="last_name" name="last_name" type="text" />
<div class="last-name-hint tooltip">{% trans "This field is required."%}</div>
</div>
<div class="input select span-4 last">
<label for="name_suffix">{% trans "Suffix" %}</label>
Expand All @@ -56,8 +53,9 @@
</div>
<div class="row">
<div class="input checkbox span-8">
<input required checked id="us_citizen" name="us_citizen" value="1" type="checkbox" />
<label for="us_citizen">{% trans "I am a U.S. Citizen" %}</label>
<input required checked id="us_citizen" name="us_citizen" value="1" type="checkbox" />
<div class="us-citizen-hint tooltip">{% trans "You must be a U.S. citizen to register" %}</div>
</div>
<div class="input checkbox span-16 last">
<input id="change_of_name" name="change_of_name" value="1" type="checkbox" />
Expand All @@ -75,14 +73,17 @@ <h3>{% trans "Previous Name" %}</h3>
<option value="{% trans 'Ms.' %}">{% trans 'Ms.' %}</option>
<option value="{% trans 'Mrs.' %}.">{% trans 'Mrs.' %}</option>
</select>
<div class="name-hint tooltip">{% trans "Title is required." %}</div>
</div>
<div class="input text span-8">
<label for="prev_first_name">{% trans "First Name" %}</label>
<input id="prev_first_name" name="prev_first_name" type="text" />
<div class="prev-first-name-hint tooltip">{% trans "Use your full first name. Do not use nicknames or initials."%}</div>
</div>
<div class="input text span-8">
<label for="prev_last_name">{% trans "Last Name" %}</label>
<input id="prev_last_name" name="prev_last_name" type="text" />
<div class="prev-last-name-hint tooltip">{% trans "This field is required."%}</div>
</div>
<div class="input select span-4 last">
<label for="prev_name_suffix">{% trans "Suffix" %}</label>
Expand Down Expand Up @@ -304,32 +305,6 @@ <h2>{% trans "Survey Questions (optional)"%}</h2>
<div class="question-hint tooltip">{% trans "Optional" %}</div>
</div>
</div>
{% comment %}
<!-- New voter survey layout, for testing -->
<h2>{% trans "Why are you voting? (optional)"%}</h2>
<div class="row">
<div class="input questions span-24 radios">
<input id="question1" name="survey_answer_1" type="radio" value="economy"/>
<label for="question1">Economy</label>
<input id="question2" name="survey_answer_1" type="radio" value="education"/>
<label for="question2">Education</label>
<input id="question3" name="survey_answer_1" type="radio" value="womens-rights"/>
<label for="question3">Womens Rights</label>
<input id="question4" name="survey_answer_1" type="radio" value="civil-rights"/>
<label for="question4">Civil Rights</label>
<input id="question5" name="survey_answer_1" type="radio" value="climate-change"/>
<label for="question5">Climate Change</label>
</div>
<!--<div class="input span-8">
<input id="question_other" name="survey_answer_1" type="text" placeholder="other"/>
<div class="question-hint tooltip">{% trans "Optional" %}</div>
</div>-->
<div class="input checkbox span-14">
<input id="opt_in_activism_email" name="opt_in_activism_email" value="1" type="checkbox" />
<label for="opt_in_activism_email">{% trans "I want to act on important issues I care about" %}</label>
</div>
</div>
{% endcomment %}
{%endif%}
</fieldset>

Expand Down Expand Up @@ -406,14 +381,6 @@ <h2>{% trans "Why are you voting? (optional)"%}</h2>
</label>
</div>
{%endif%}

{% comment %} New inputs for CEL {% endcomment %}
{% comment %} deactivate while in testing
<div class="input checkbox">
<input id="email_cel" name="email_cel" value="1" type="checkbox" />
<label for="email_cel">I want to learn more about opportunities for activism in my community</label>
</div>
{% endcomment %}
</div>

{% comment %} Hidden but Required Fields {% endcomment %}
Expand Down
20 changes: 9 additions & 11 deletions boris/templates/form_direct.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@
{%endblock%}

{%block content%}
<div class="span-24 last" style="padding: 19px 20px 3px">
{%if LANGUAGE_CODE == "en" %}<a class="locale" tabindex="-1" href="?locale=es">En espa&ntilde;ol</a>
{%else%}<a class="locale" tabindex="-1" href="?locale=en">In english</a>{%endif%}
</div>

<form class="registration-form" method="post" action="/registrants/submit/{{state}}/" accept-charset="UTF-8">
{% csrf_token %}
<fieldset class="name">
Expand All @@ -83,15 +78,17 @@
<option value="{% trans 'Ms.' %}">{% trans 'Ms.' %}</option>
<option value="{% trans 'Mrs.' %}.">{% trans 'Mrs.' %}</option>
</select>
<div class="title-hint tooltip">{% trans "Title is required."%}</div>
</div>
<div class="input text span-8">
<label for="first_name">{% trans "First Name" %}</label>
<input required id="first_name" name="first_name" type="text" />
<div class="full-name-hint tooltip">{% trans "Use your full first name. Do not use nicknames or initials."%}</div>
<div class="first-name-hint tooltip">{% trans "Use your full first name. Do not use nicknames or initials."%}</div>
</div>
<div class="input text span-8">
<label for="last_name">{% trans "Last Name" %}</label>
<input required id="last_name" name="last_name" type="text" />
<div class="last-name-hint tooltip">{% trans "Last name is required."%}</div>
</div>

<div class="input select span-4 last">
Expand Down Expand Up @@ -131,8 +128,9 @@
</div>

<div class="input checkbox span-4 pushdown last">
<input required checked id="us_citizen" name="us_citizen" value="1" type="checkbox" />
<label for="us_citizen">{% trans "I am a U.S. Citizen" %}</label>
<input required checked id="us_citizen" name="us_citizen" value="1" type="checkbox" />
<div class="us-citizen-hint tooltip">{% trans "You must be a U.S. citizen to register" %}</div>
</div>

</div>
Expand Down Expand Up @@ -166,15 +164,15 @@
<div class="input text prepend-2 span-22">
{%block state_eligible%}
<label for="registrant_has_state_license_1">
<input checked="checked" id="registrant_has_state_license_1" name="has_state_license" type="radio" value="1">I have a current {{state}} state identification card or driver's license
<input checked="checked" id="registrant_has_state_license_1" name="has_state_license" type="radio" value="1">{% blocktrans %}I have a current {{state}} state identification card or driver's license{%endblocktrans%}
</label>
<div class="has_license span-20">
<p class="explanation" id="eligible">You may be eligible to finish your voter registration using the {{state_name}} online voter registration system.</p>
<p class="explanation" id="eligible">{% blocktrans %}You may be eligible to finish your voter registration using the {{state_name}} online voter registration system.{%endblocktrans%}</p>
</div>
</div>
<div class="input text prepend-2 span-22">
<label for="registrant_has_state_license_0">
<input id="registrant_has_state_license_0" name="has_state_license" type="radio" value="0">I do not have a current {{state}} state identification card or driver's license
<input id="registrant_has_state_license_0" name="has_state_license" type="radio" value="0">{%blocktrans%}I do not have a current {{state}} state identification card or driver's license{%endblocktrans%}
</label>
</div>
{%endblock%}
Expand Down Expand Up @@ -303,6 +301,6 @@ <h2>{% trans "Spread the word" %}</h2>
</section>{%endblock%}

<div id="share-link">
{% trans "Already registered?" %}<a href="/registrants/share/{%if partner%}?partner={{partner}}{%endif%}">{% trans "Share with your friends" %}</a>
{% trans "Already registered?" %} <a href="/registrants/share/{%if partner%}?partner={{partner}}{%endif%}">{% trans "Share with your friends" %}</a>
</div>
{%endblock content%}
3 changes: 0 additions & 3 deletions boris/templates/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
{%endblock styles%}

{%block content%}
{%if LANGUAGE_CODE == "en" %}<a class="locale" tabindex="-1" href="?locale=es">En espa&ntilde;ol</a>
{%else%}<a class="locale" tabindex="-1" href="?locale=en">In english</a>{%endif%}

<h1 class="map">{% trans "Select your state to get started" %}</h1>
<form class="state-form" method="get" action="/registrants/new/" accept-charset="UTF-8"><div id="map"></div>
<fieldset class="submit">
Expand Down
13 changes: 9 additions & 4 deletions boris/templates/submit.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{% if pdfurl %}
<header>
<h2>{% trans "You're not quite done!"%}</h2>
<p>{% trans "You still need to download your form."%}</p>
<p>{% trans "You still need to sign and mail in your form."%}</p>
</header>
<div id="download" style="display:none">
<div class="prepend-3 span-18 append-3 last">
Expand All @@ -55,9 +55,14 @@ <h2>{% trans "You're not quite done!"%}</h2>
<p class="subtle">({% trans "We've also e-mailed you a link to retreive your form later" %})</p>
</div>
</div>
<div id="email-mobile" style="display:none">
<div class="prepend-3 span-18 append-3 last">
<p class="subtle">{% trans "Check your email inbox for a link to your form" %}</p>
</div>
</div>
<div id="waiting">
<div class="prepend-3 span-18 append-3 last">
<a class="button button-primary waiting" style="display:block" disabled>Preparing Form<span style="position:fixed" class="ellipsis"></span></a>
<a class="button button-primary waiting" style="display:block" disabled>{% trans "Preparing Form" %}<span style="position:fixed" class="ellipsis"></span></a>
</div>

<div class="prepend-3 span-18 append-3 last">
Expand All @@ -78,8 +83,8 @@ <h2>{% trans "Something went wrong "%}:(</h2>
{%comment%}
<section>
<header>
<h2>Get more involved!</h2>
<p>Help your friends register to vote.</p>
<h2>{% trans "Get more involved!" %}</h2>
<p>{% trans "Help your friends register to vote." %}</p>
</header>
<div class="image-well prepend-3 span-18 append-3 last">
<img src="images/contest-tease.png" />
Expand Down
1 change: 1 addition & 0 deletions boris/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
(r'^registrants/', include('registrant.urls')),
(r'^rtv/', include('proxy.urls')),
(r'^usps/',include('ziplookup.urls')),
(r'^i18n/', include('django.conf.urls.i18n')),
)

#static file patterns to be compatible with old site
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pygeoip
pillow
django-sslify
django-evolution
django-urli18n
python-dateutil==1.2
pylibmc==1.2.3
django-pylibmc-sasl==0.2.4
Expand Down

0 comments on commit fca8af4

Please sign in to comment.