From c1caf74a6d9fb378396789abc3629ec62259be20 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Wed, 13 May 2015 18:12:55 -0400 Subject: [PATCH] Buff the UI just a little bit --- tests/py/test_teams.py | 4 ++-- www/new.spt | 25 +++++++++++++++++++------ www/teams/create.json.spt | 18 ++++++++++-------- 3 files changed, 31 insertions(+), 16 deletions(-) diff --git a/tests/py/test_teams.py b/tests/py/test_teams.py index 0de5c8881d..ca433d3228 100644 --- a/tests/py/test_teams.py +++ b/tests/py/test_teams.py @@ -55,7 +55,7 @@ def test_error_message_for_terms(self): del data['agree_terms'] r = self.post_new(data, expected=400) assert self.db.one("SELECT COUNT(*) FROM teams") == 0 - assert "Please agree to the terms and conditions" in r.body + assert "Please agree to the terms of service." in r.body def test_error_message_for_missing_fields(self): self.make_participant('alice') @@ -63,7 +63,7 @@ def test_error_message_for_missing_fields(self): del data['name'] r = self.post_new(data, expected=400) assert self.db.one("SELECT COUNT(*) FROM teams") == 0 - assert "Please fill out the 'Name' field" in r.body + assert "Please fill out the 'Team Name' field." in r.body class TestOldTeams(Harness): diff --git a/www/new.spt b/www/new.spt index 6f2c02b27f..5d5de7e43f 100644 --- a/www/new.spt +++ b/www/new.spt @@ -20,11 +20,17 @@ title = _("Apply for a New Team") {% block content %}
+
- - + + @@ -38,10 +44,17 @@ title = _("Apply for a New Team") -
- {{ _("I agree to the terms and conditions") }} -
- +
+
+ + +
+
diff --git a/www/teams/create.json.spt b/www/teams/create.json.spt index c7788d53e8..8e9fd58a4f 100644 --- a/www/teams/create.json.spt +++ b/www/teams/create.json.spt @@ -2,22 +2,23 @@ from aspen import Response from gratipay.models.community import slugize from gratipay.models.team import Team +from psycopg2 import IntegrityError [---] request.allow('POST') field_names = { - 'name': 'Name', + 'name': 'Team Name', 'homepage': 'Homepage', 'product_or_service': 'Product or Service', - 'getting_paid': 'How do you share revenue', - 'getting_involved': 'How can other people get involved' + 'getting_paid': 'How do you share revenue?', + 'getting_involved': 'How can other people get involved?' } if user.ANON: - raise Response(401, _("You must sign in to apply for a new team")) + raise Response(401, _("You must sign in to apply for a new team.")) if not request.body.get('agree_terms', False): - raise Response(400, _("Please agree to the terms and conditions")) + raise Response(400, _("Please agree to the terms of service.")) if request.method == 'POST': fields = {} @@ -25,10 +26,11 @@ if request.method == 'POST': # Validate inputs for field in field_names.keys(): - if not request.body.get(field, ''): - raise Response(400, _("Please fill out the '{0}' field", field_names[field])) + value = request.body.get(field, '') + if not value: + raise Response(400, _("Please fill out the '{0}' field.", field_names[field])) - fields[field] = request.body.get(field, '') + fields[field] = value fields['slug'] = slugize(fields['name'])