You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/06/04 15:52:02 UTC
[1/8] allura git commit: [#7887] ticket:790 Filter error messages
from nexmo
Repository: allura
Updated Branches:
refs/heads/ib/7887 [created] 8afd9b0d3
[#7887] ticket:790 Filter error messages from nexmo
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/55a1aaa7
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/55a1aaa7
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/55a1aaa7
Branch: refs/heads/ib/7887
Commit: 55a1aaa70ee1f3171c6d582b68980ebefffe3785
Parents: bc5aa4b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 07:48:35 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 07:48:35 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/phone/nexmo.py | 12 +++++++-----
Allura/allura/tests/unit/phone/test_nexmo.py | 14 +++++++++++---
2 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/55a1aaa7/Allura/allura/lib/phone/nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/phone/nexmo.py b/Allura/allura/lib/phone/nexmo.py
index 0ee4269..3b28c71 100644
--- a/Allura/allura/lib/phone/nexmo.py
+++ b/Allura/allura/lib/phone/nexmo.py
@@ -46,7 +46,10 @@ class NexmoPhoneService(PhoneService):
}
return dict(params, **common)
- def error(self, msg):
+ def error(self, code=None, msg=None):
+ allowed_codes = ['3', '10', '15', '16', '17']
+ if code is None or str(code) not in allowed_codes:
+ msg = 'Failed sending request to Nexmo'
return {'status': 'error', 'error': msg}
def ok(self, **params):
@@ -68,12 +71,11 @@ class NexmoPhoneService(PhoneService):
log.info('PhoneService (nexmo) response: %s', resp.content)
resp = resp.json()
except Exception:
- msg = 'Failed sending request to Nexmo'
- log.exception(msg)
- return self.error(msg)
+ log.exception('Failed sending request to Nexmo')
+ return self.error()
if resp.get('status') == '0':
return self.ok(request_id=resp.get('request_id'))
- return self.error(resp.get('error_text'))
+ return self.error(code=resp.get('status'), msg=resp.get('error_text'))
def verify(self, number):
url = urljoin(self.BASE_URL, 'verify')
http://git-wip-us.apache.org/repos/asf/allura/blob/55a1aaa7/Allura/allura/tests/unit/phone/test_nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/phone/test_nexmo.py b/Allura/allura/tests/unit/phone/test_nexmo.py
index 6f6ec42..0d9c419 100644
--- a/Allura/allura/tests/unit/phone/test_nexmo.py
+++ b/Allura/allura/tests/unit/phone/test_nexmo.py
@@ -40,7 +40,15 @@ class TestPhoneService(object):
assert_equal(expected, res)
def test_error(self):
- res = self.phone.error('text')
+ res = self.phone.error()
+ expected = {'status': 'error',
+ 'error': 'Failed sending request to Nexmo'}
+ assert_equal(expected, res)
+ # not allowed code
+ res = self.phone.error(code='2', msg='text')
+ assert_equal(expected, res)
+ # allowed code
+ res = self.phone.error(code='15', msg='text')
expected = {'status': 'error', 'error': 'text'}
assert_equal(expected, res)
@@ -73,7 +81,7 @@ class TestPhoneService(object):
req.post.reset_mock()
req.post.return_value.json.return_value = {
- 'status': '1',
+ 'status': '3',
'error_text': 'Something went wrong',
}
resp = self.phone.verify('1234567890')
@@ -116,7 +124,7 @@ class TestPhoneService(object):
req.post.reset_mock()
req.post.return_value.json.return_value = {
- 'status': '1',
+ 'status': '3',
'error_text': 'Something went wrong',
}
resp = self.phone.check('test-req-id', '1234')
[6/8] allura git commit: [#7887] ticket:790 Handle unique entry
points in allura.* subgroup
Posted by je...@apache.org.
[#7887] ticket:790 Handle unique entry points in allura.* subgroup
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1d9daf4a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1d9daf4a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1d9daf4a
Branch: refs/heads/ib/7887
Commit: 1d9daf4af19e66e99209b572a45615bb9d47b70e
Parents: 109906d
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 10:35:49 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 10:35:49 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/helpers.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1d9daf4a/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 76e8db3..396d7d6 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -1068,15 +1068,15 @@ def plain2markdown(text, preserve_multiple_spaces=False, has_html_entities=False
def iter_entry_points(group, *a, **kw):
"""Yields entry points that have not been disabled in the config.
- If ``group`` is "allura" (Allura tool entry points), this function also
- checks for multiple entry points with the same name. If there are
- multiple entry points with the same name, and one of them is a subclass
- of the other(s), it will be yielded, and the other entry points with that
- name will be ignored. If a subclass is not found, an ImportError will be
- raised.
+ If ``group`` is "allura" (Allura tool entry points) or one of subgroups
+ (e.g. "allura.phone"), this function also checks for multiple entry points
+ with the same name. If there are multiple entry points with the same name,
+ and one of them is a subclass of the other(s), it will be yielded, and the
+ other entry points with that name will be ignored. If a subclass is not
+ found, an ImportError will be raised.
- This treatment of "allura" entry points allows tool authors to subclass
- another tool while reusing the original entry point name.
+ This treatment of "allura" and "allura.*" entry points allows tool authors
+ to subclass another tool while reusing the original entry point name.
"""
def active_eps():
@@ -1105,7 +1105,8 @@ def iter_entry_points(group, *a, **kw):
return ep
raise ImportError('Ambiguous [allura] entry points detected. ' +
'Multiple entry points with name "%s".' % entry_points[0].name)
- return iter(unique_eps(active_eps()) if group == 'allura' else active_eps())
+ is_allura = group == 'allura' or group.startswith('allura.')
+ return iter(unique_eps(active_eps()) if is_allura else active_eps())
# http://stackoverflow.com/a/1060330/79697
[4/8] allura git commit: [#7887] ticket:790 Fix phone validation
error when user project being created for newly registered user
Posted by je...@apache.org.
[#7887] ticket:790 Fix phone validation error when user project being created for newly registered user
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/eed874e9
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/eed874e9
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/eed874e9
Branch: refs/heads/ib/7887
Commit: eed874e944b2fcbab9570b8f4550098c255dc481
Parents: 49c94ba
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 09:24:10 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 09:24:10 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/plugin.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/eed874e9/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index abb5c8c..860292f 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -818,7 +818,7 @@ class ProjectRegistrationProvider(object):
self.rate_limit(user, neighborhood)
- if not self.phone_verified(user, neighborhood):
+ if not self.phone_verified(user, neighborhood) and not user_project:
raise forge_exc.ProjectPhoneVerificationError()
if user_project and shortname.startswith('u/'):
[5/8] allura git commit: [#7887] ticket:790 Add missing semicolon to
js
Posted by je...@apache.org.
[#7887] ticket:790 Add missing semicolon to js
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/109906d3
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/109906d3
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/109906d3
Branch: refs/heads/ib/7887
Commit: 109906d338450bb333e9082868b9681d555a2ea1
Parents: eed874e
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 09:44:22 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 09:44:22 2015 +0000
----------------------------------------------------------------------
Allura/allura/public/nf/js/phone-verification.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/109906d3/Allura/allura/public/nf/js/phone-verification.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/phone-verification.js b/Allura/allura/public/nf/js/phone-verification.js
index 239cfac..4af2a9e 100644
--- a/Allura/allura/public/nf/js/phone-verification.js
+++ b/Allura/allura/public/nf/js/phone-verification.js
@@ -88,7 +88,7 @@ var FormStepMixin = {
},
getHtml: function(elem_id) {
- var html = document.getElementById(elem_id).innerHTML
+ var html = document.getElementById(elem_id).innerHTML;
return {__html: html};
},
[2/8] allura git commit: [#7887] ticket:790 Allow html in error
messages, but escape them by default anyway
Posted by je...@apache.org.
[#7887] ticket:790 Allow html in error messages, but escape them by default anyway
This is useful for custom messages. E.g. you can extend NexmoPhoneService with
custom errors which will include html by using jinja2.Markup to mark them as
safe, so that escaping will not take effect. By default all messages received
from nexmo are escaped.
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/bc064d87
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/bc064d87
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/bc064d87
Branch: refs/heads/ib/7887
Commit: bc064d8712d40f13df3a4642ec9a2fa05023ebdb
Parents: 55a1aaa
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 08:30:38 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 08:30:38 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 7 +++++
.../allura/public/nf/js/phone-verification.js | 8 ++++--
.../tests/functional/test_neighborhood.py | 28 ++++++++++++++++++++
3 files changed, 41 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/bc064d87/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 197f859..2f6d9be 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -27,6 +27,7 @@ from tg.decorators import with_trailing_slash, without_trailing_slash
from pylons import tmpl_context as c, app_globals as g
from paste.deploy.converters import asbool
from webob import exc
+import jinja2
import pymongo
from formencode.api import Invalid
@@ -206,6 +207,9 @@ class NeighborhoodController(object):
number_hash = utils.phone_number_hash(number)
session['phone_verification.number_hash'] = number_hash
session.save()
+ if 'error' in result:
+ result['error'] = jinja2.Markup.escape(result['error'])
+ result['error'] = h.really_unicode(result['error'])
return result
@expose('json:')
@@ -214,6 +218,9 @@ class NeighborhoodController(object):
request_id = session.get('phone_verification.request_id')
number_hash = session.get('phone_verification.number_hash')
res = p.check_phone_verification(c.user, request_id, pin, number_hash)
+ if 'error' in res:
+ res['error'] = jinja2.Markup.escape(res['error'])
+ res['error'] = h.really_unicode(res['error'])
return res
@expose('json:')
http://git-wip-us.apache.org/repos/asf/allura/blob/bc064d87/Allura/allura/public/nf/js/phone-verification.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/phone-verification.js b/Allura/allura/public/nf/js/phone-verification.js
index e6bb8fc..1a22c83 100644
--- a/Allura/allura/public/nf/js/phone-verification.js
+++ b/Allura/allura/public/nf/js/phone-verification.js
@@ -70,14 +70,18 @@ var FormStepMixin = {
onClick: this.handleClick,
disabled: this.isButtonDisabled()
};
- var nbsp = String.fromCharCode(160);
return dom('div', null,
dom('label', {className: grid}, this.getLabel()),
dom('input', input_props),
- dom('div', {className: grid + ' error-text'}, this.props.state.error || nbsp),
+ dom('div', {className: grid + ' error-text',
+ dangerouslySetInnerHTML: this.getErrorHtml()}),
dom('div', {className: grid},
dom('button', button_props, 'Submit')));
},
+
+ getErrorHtml: function() {
+ return {__html: this.props.state.error || ' '};
+ },
handleClick: function() {
if (!this.isButtonDisabled()) {
http://git-wip-us.apache.org/repos/asf/allura/blob/bc064d87/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index b3ab279..593671d 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -992,6 +992,20 @@ class TestPhoneVerificationOnProjectRegistration(TestController):
assert_equal(rid, 'request-id')
assert_equal(hash, 'f9ac49faef45d18746ced08d001e23b179107940')
+ @patch.object(g, 'phone_service', autospec=True)
+ def test_verify_phone_escapes_error(self, phone_service):
+ phone_service.verify.return_value = {
+ 'status': 'error',
+ 'error': '<script>alert("hacked");</script>',
+ }
+ with h.push_config(config, **{'project.verify_phone': 'true'}):
+ r = self.app.get('/p/verify_phone', {'number': '555-444-3333'})
+ expected = {
+ 'status': 'error',
+ 'error': u'<script>alert("hacked");</script>',
+ }
+ assert_equal(r.json, expected)
+
def test_check_phone_verification_no_params(self):
with h.push_config(config, **{'project.verify_phone': 'true'}):
self.app.get('/p/check_phone_verification', status=404)
@@ -1034,6 +1048,20 @@ class TestPhoneVerificationOnProjectRegistration(TestController):
hash = user.get_tool_data('phone_verification', 'number_hash')
assert_equal(hash, '54c61c96d5d5aea5254c2d4f41508a938e5501b4')
+ @patch.object(g, 'phone_service', autospec=True)
+ def test_check_phone_verification_escapes_error(self, phone_service):
+ phone_service.check.return_value = {
+ 'status': 'error',
+ 'error': '<script>alert("hacked");</script>',
+ }
+ with h.push_config(config, **{'project.verify_phone': 'true'}):
+ r = self.app.get('/p/check_phone_verification', {'pin': '1234'})
+ expected = {
+ 'status': 'error',
+ 'error': u'<script>alert("hacked");</script>',
+ }
+ assert_equal(r.json, expected)
+
def test_register_phone_not_verified(self):
with h.push_config(config, **{'project.verify_phone': 'true'}):
r = self.app.post(
[8/8] allura git commit: [#7887] ticket:790 Increase phone
verification iframe height
Posted by je...@apache.org.
[#7887] ticket:790 Increase phone verification iframe height
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/8afd9b0d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/8afd9b0d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/8afd9b0d
Branch: refs/heads/ib/7887
Commit: 8afd9b0d3071eadabe9c2feff574690061fd56cf
Parents: 8421944
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 12:54:12 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 12:54:12 2015 +0000
----------------------------------------------------------------------
Allura/allura/nf/allura/css/allura.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/8afd9b0d/Allura/allura/nf/allura/css/allura.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/allura.css b/Allura/allura/nf/allura/css/allura.css
index 6c5c1f4..18dbd62 100644
--- a/Allura/allura/nf/allura/css/allura.css
+++ b/Allura/allura/nf/allura/css/allura.css
@@ -85,5 +85,5 @@ tr.rev div.markdown_content p {
}
#phone_verification_overlay iframe {
- height: 250px;
+ height: 320px;
}
[7/8] allura git commit: [#7887] ticket:790 Fix tests failing due to
changes in iter_entry_points
Posted by je...@apache.org.
[#7887] ticket:790 Fix tests failing due to changes in iter_entry_points
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/84219444
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/84219444
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/84219444
Branch: refs/heads/ib/7887
Commit: 84219444a12457158c6a418b86ca2fb55d2dacce
Parents: 1d9daf4
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 12:34:48 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 12:34:48 2015 +0000
----------------------------------------------------------------------
Allura/allura/tests/unit/test_package_path_loader.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/84219444/Allura/allura/tests/unit/test_package_path_loader.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_package_path_loader.py b/Allura/allura/tests/unit/test_package_path_loader.py
index c3109c3..781ec83 100644
--- a/Allura/allura/tests/unit/test_package_path_loader.py
+++ b/Allura/allura/tests/unit/test_package_path_loader.py
@@ -43,16 +43,16 @@ class TestPackagePathLoader(TestCase):
assert_equal(paths, [
['site-theme', None],
+ ['ep2', 'path:eps.ep2'],
['ep0', 'path:eps.ep0'],
['ep1', 'path:eps.ep1'],
- ['ep2', 'path:eps.ep2'],
['allura', '/'],
])
assert_equal(type(paths[0]), list)
assert_equal(resource_filename.call_args_list, [
+ mock.call('eps.ep2', ''),
mock.call('eps.ep0', ''),
mock.call('eps.ep1', ''),
- mock.call('eps.ep2', ''),
])
@mock.patch('pkg_resources.iter_entry_points')
@@ -68,7 +68,7 @@ class TestPackagePathLoader(TestCase):
order_rules, replacement_rules = PackagePathLoader()._load_rules()
- assert_equal(order_rules, [('ep0', 'allura'), ('allura', 'ep2')])
+ assert_equal(order_rules, [('allura', 'ep2'), ('ep0', 'allura')])
assert_equal(replacement_rules, {'allura': 'ep1'})
eps = iter_entry_points.return_value.__iter__.return_value = [
[3/8] allura git commit: [#7887] ticket:790 Better messaging for
phone validation
Posted by je...@apache.org.
[#7887] ticket:790 Better messaging for phone validation
- phone number examples
- different message for PIN step
- site-specific message with template override
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/49c94bae
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/49c94bae
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/49c94bae
Branch: refs/heads/ib/7887
Commit: 49c94bae01f7abd1d78d49100a2284434d069aa0
Parents: bc064d8
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Jun 4 09:04:41 2015 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Jun 4 09:04:41 2015 +0000
----------------------------------------------------------------------
.../allura/public/nf/js/phone-verification.js | 14 +++++++-
.../templates/phone_verification_fragment.html | 34 +++++++++++++++-----
2 files changed, 39 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/49c94bae/Allura/allura/public/nf/js/phone-verification.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/phone-verification.js b/Allura/allura/public/nf/js/phone-verification.js
index 1a22c83..239cfac 100644
--- a/Allura/allura/public/nf/js/phone-verification.js
+++ b/Allura/allura/public/nf/js/phone-verification.js
@@ -71,6 +71,10 @@ var FormStepMixin = {
disabled: this.isButtonDisabled()
};
return dom('div', null,
+ dom('div', {className: grid,
+ dangerouslySetInnerHTML: this.getMessage()}),
+ dom('div', {className: grid,
+ dangerouslySetInnerHTML: this.getExtraMessage()}),
dom('label', {className: grid}, this.getLabel()),
dom('input', input_props),
dom('div', {className: grid + ' error-text',
@@ -82,6 +86,14 @@ var FormStepMixin = {
getErrorHtml: function() {
return {__html: this.props.state.error || ' '};
},
+
+ getHtml: function(elem_id) {
+ var html = document.getElementById(elem_id).innerHTML
+ return {__html: html};
+ },
+
+ getMessage: function() { return this.getHtml('message-' + this.getKey()); },
+ getExtraMessage: function() { return this.getHtml('message-extra'); },
handleClick: function() {
if (!this.isButtonDisabled()) {
@@ -147,7 +159,7 @@ var StepCheck = React.createClass({
getAPIUrl: function() { return 'check_phone_verification'; },
getAPIData: function() { return {'pin': this.props.state[this.getKey()]}; },
- getLabel: function() { return 'Enter PIN'; },
+ getLabel: function() { return 'Enter your PIN'; },
getKey: function() { return 'pin'; },
onSuccess: function() {
var form = window.top.jQuery('form[action="/p/register"]');
http://git-wip-us.apache.org/repos/asf/allura/blob/49c94bae/Allura/allura/templates/phone_verification_fragment.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/phone_verification_fragment.html b/Allura/allura/templates/phone_verification_fragment.html
index faa0009..561b0df 100644
--- a/Allura/allura/templates/phone_verification_fragment.html
+++ b/Allura/allura/templates/phone_verification_fragment.html
@@ -49,18 +49,36 @@
margin-top: .5em;
margin-bottom: .5em;
}
+ .step-message { display: none; }
</style>
</head>
<body>
<div class="grid-9">
- {% block phone_validation_message %}
- <p>
- In order to register a project you need to perform phone validation
- (just this once). Please, enter your phone number below. You'll
- receive an SMS message with a PIN you need to provide on the next
- step. Your phone number will not be stored.
- </p>
- {% endblock phone_validation_message %}
+ {# The following blocks are hidden, they're used to provide messages to React component #}
+ <div id='message-number' class='step-message'>
+ {% block phone_validation_message_number %}
+ <p>
+ In order to register a project you need to perform phone
+ validation (just this once). Please, enter your phone number
+ below (e.g. 1-311-555-2368 or +61 8 5550 1757). You'll receive
+ an SMS message with a PIN you need to provide on the next step.
+ Your phone number will not be stored.
+ </p>
+ {% endblock phone_validation_message_number %}
+ </div>
+ <div id='message-pin' class='step-message'>
+ {% block phone_validation_message_pin %}
+ <p>
+ A PIN is being sent to your phone. If you are unable to receive
+ SMS, you will get a voice call with the number.
+ </p>
+ {% endblock phone_validation_message_pin %}
+ </div>
+ <div id='message-extra' class='step-message'>
+ {% block phone_validation_message_extra %}
+ {% endblock phone_validation_message_extra %}
+ </div>
+
<div id="phone-verification-form">
{# Phone verification form will be mounted here (see phone-verification.js) #}
</div>