Skip to content

Commit 8d2cc7c

Browse files
committed
add environment configuration
required: `BRANDING_ORG_NAME`, `BRANDING_ORG_SITE_NAME`, `BRANDING_LIABILITY_URL`, `BRANDING_EMAIL_SIGNATURE`, `BRANDING_SUPPORT_EMAIL` optional: `BRANDING_CSS_URL`, `BRANDING_HEADLINE_1`, `BRANDING_HEADLINE_2`, `BRANDING_PRIVACY_URL` - add details on config settings to README - add sample Swing Left config (CSS and environment settings) - update pages and email templates to use config values - add test for email signatures
1 parent 063603d commit 8d2cc7c

31 files changed

+178
-52
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,43 @@ Locally:
241241
```
242242
pytest
243243
```
244+
245+
## Branding
246+
247+
Organizations using Nomad need to set these environment variables:
248+
249+
- `BRANDING_ORG_NAME` - organization name; default "Ragtag"
250+
- `BRANDING_ORG_SITE_NAME` - site name (not full URL), default "ragtag.org"
251+
- `BRANDING_LIABILITY_URL` - URL to organizer liability statement (required)
252+
- `BRANDING_EMAIL_SIGNATURE` - default "The Nomad team"
253+
- `BRANDING_SUPPORT_EMAIL` - default `[email protected]`
254+
255+
These environment variables have reasonable defaults; setting these is optiona:
256+
257+
- `BRANDING_CSS_URL` - URL to CSS with skin-specific overrides; default is no overrides
258+
- `BRANDING_HEADLINE_1` - default "Carpool to canvass in battleground districts near you"
259+
- `BRANDING_HEADLINE_2` - default "Find other volunteers near you and join a carpool."
260+
- `BRANDING_PRIVACY_URL` - default `/terms.html`; the default `terms.html` uses values of `BRANDING_ORG_NAME`, `BRANDING_ORG_SITE_NAME`, and `BRANDING_SUPPORT_EMAIL`
261+
262+
### sample Swing Left branding
263+
264+
to use sample sample config for Swing Left locally:
265+
266+
cat branding/swing-left >> .env
267+
268+
sample branding config values: [branding/swing-left](branding/swing-left)
269+
270+
sample CSS overrides: [static/css/swing-left.css](static/css/swing-left.css)
271+
272+
restart app to reload config from `.env`
273+
274+
### branding QA
275+
276+
- `BRANDING_ORG_NAME` in [terms.html](templates/auth/terms.html) (ie "Ragtag Nomad Privacy Policy")
277+
- `BRANDING_ORG_SITE_NAME` in [terms.html](templates/auth/terms.html) ie "nomad.ragtag.org, the "Site""
278+
- `BRANDING_SUPPORT_EMAIL` in [terms.html](templates/auth/terms.html) ie "email [email protected]"
279+
- `BRANDING_LIABILITY_URL` in email templates: [driver_reminder](templates/email/driver_reminder.html), [ride_approved.html](templates/email/ride_approved.html)
280+
- `BRANDING_EMAIL_SIGNATURE` in all [email templates](templates/email)
281+
- logo on home page, defined in CSS referenced by `BRANDING_CSS_URL`
282+
- `BRANDING_HEADLINE_1` and `BRANDING_HEADLINE_1` on home page, below "SHARE YOUR RIDE"
283+
- `BRANDING_PRIVACY_URL` privacy policy links on [login](app/templates/auth/login.html) and [mobile and desktop nav](app/templates/_template.html)

app/config.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,30 @@ class Config:
5252
USE_SESSION_FOR_NEXT = True
5353

5454
SENTRY_DSN = os.environ.get('SENTRY_DSN')
55+
5556
DATE_FORMAT = os.environ.get('DATE_FORMAT', '%a %b %-d %Y at %-I:%M %p')
5657

58+
BRANDING_ORG_NAME = os.environ.get('BRANDING_ORG_NAME') or \
59+
'Ragtag'
60+
BRANDING_ORG_SITE_NAME = os.environ.get('BRANDING_SITE_NAME') or \
61+
'ragtag.org'
62+
BRANDING_ORG_EMAIL = os.environ.get('BRANDING_ORG_EMAIL') or \
63+
64+
BRANDING_LIABILITY_URL = os.environ.get('BRANDING_LIABILITY_URL') or \
65+
'set config BRANDING_LIABILITY_URL'
66+
# see example static/css/swing-left.css
67+
BRANDING_CSS_URL = os.environ.get('BRANDING_CSS_URL', None)
68+
BRANDING_HEADLINE_1 = os.environ.get('BRANDING_HEADLINE_1') or \
69+
'Carpool to canvass in battleground districts near you'
70+
BRANDING_HEADLINE_2 = os.environ.get('BRANDING_HEADLINE_2') or \
71+
'Find other volunteers near you and join a carpool.'
72+
BRANDING_EMAIL_SIGNATURE = os.environ.get('BRANDING_EMAIL_SIGNATURE') or \
73+
'The Nomad team'
74+
BRANDING_PRIVACY_URL = os.environ.get('BRANDING_PRIVACY_URL') or \
75+
'/terms.html'
76+
BRANDING_SUPPORT_EMAIL = os.environ.get('BRANDING_SUPPORT_EMAIL') or \
77+
78+
5779
@staticmethod
5880
def init_app(app):
5981
pass

app/static/css/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ select:focus {
208208
width: 143px;
209209
height: 50px;
210210
margin: 10px 0;
211-
background: url("../img/logo-swingleft.png") top left / contain no-repeat;
211+
background: url("../img/logo_ragtag.png") top left / contain no-repeat;
212212
}
213213
.header-left .logo.generic {
214-
background: url("../img/logo-swingleft.png") top left / contain no-repeat;
214+
background: url("../img/logo_ragtag.png") top left / contain no-repeat;
215215
}
216216

217217
.header-left .header-search-bar {

app/static/css/swing-left.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.header-left .logo {
2+
width: 143px;
3+
height: 50px;
4+
background: url("../img/logo-swingleft.png") top left / contain no-repeat;
5+
}
6+
.header-left .logo.generic {
7+
background: url("../img/logo-swingleft.png") top left / contain no-repeat;
8+
}

app/templates/_template.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,700|Source+Sans+Pro:300,400,600,700" rel="stylesheet">
9191
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" integrity="sha256-yMjaV542P+q1RnH6XByCPDfUFhmOafWbeLPmqKh11zo=" crossorigin="anonymous" />
9292
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
93+
{% if config.get('BRANDING_CSS_URL') %}
94+
<link rel="stylesheet" type="text/css" href="{{config.get('BRANDING_CSS_URL')}}">
95+
{% endif %}
9396

9497
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ url_for('static', filename='img/favicon/apple-touch-icon-144x144.png') }}" />
9598
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ url_for('static', filename='img/favicon/apple-touch-icon-152x152.png') }}" />
@@ -123,7 +126,7 @@
123126
{% endif %}
124127
<li><a href="{{ url_for('carpool.find') }}">Find a ride</a></li>
125128
<li><a href="{{ url_for('carpool.new') }}">Give a ride</a></li>
126-
<li class="divider"><a href="{{ url_for('auth.terms') }}">Privacy &amp; Terms</a></li>
129+
<li class="divider"><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy &amp; Terms</a></li>
127130
{% if current_user.is_authenticated %}
128131
<li><a href="{{ url_for('auth.profile') }}">Profile</a></li>
129132
<li><a href="#" onClick="return doLogout()">Logout</a></li>
@@ -148,7 +151,7 @@
148151
<ul class="nav-bar">
149152
<li class="active"><a href="{{ url_for('carpool.find') }}">Find a ride</a></li>
150153
<li><a href="{{ url_for('carpool.new') }}">Give a ride</a></li>
151-
<li><a href="{{ url_for('auth.terms') }}">Privacy &amp; Terms</a></li>
154+
<li><a href="{{ config.get('BRANDING_PRIVACY_URL') }}">Privacy &amp; Terms</a></li>
152155
{% if current_user.is_authenticated %}
153156
<li><a href="{{ url_for('carpool.mine') }}">My rides</a></li>
154157
{% endif %}

app/templates/auth/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{%- endwith %}
1818
<div class="interstitial-page">
1919
<h1>Log in to continue</h1>
20-
<p>Please verify your identity by logging in through one of the following options. We will not save your information or use it for any purpose other than to verify that you are a human. For more info, check out our <a href="{{ url_for('auth.terms') }}">privacy policy</a>.</p>
20+
<p>Please verify your identity by logging in through one of the following options. We will not save your information or use it for any purpose other than to verify that you are a human. For more info, check out our <a href="{{ config.get('BRANDING_PRIVACY_URL') }}">privacy policy</a>.</p>
2121
<br><br>
2222
<a href="{{ url_for('auth.oauth_authorize', provider='facebook') }}"><input class="primary" type="submit" value="Log in through Facebook"></a>&nbsp;&nbsp; or &nbsp;&nbsp;<a href="{{ url_for('auth.oauth_authorize', provider='google') }}"><input class="primary" type="submit" value="Log in through Google"></a>
2323
</div>

0 commit comments

Comments
 (0)