[#8094] use same space for URL and error msg, to avoid page content shifting around
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 0820117..7bb982a 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -55,7 +55,7 @@
def _validate_shortname(self, shortname, neighborhood, state):
if not h.re_project_name.match(shortname):
raise forge_exc.ProjectShortnameInvalid(
- 'Please use only small letters, numbers, and dashes 3-15 characters long.',
+ 'Please use 3-15 small letters, numbers, and dashes.',
shortname, state)
def _validate_allowed(self, shortname, neighborhood, state):
@@ -976,6 +976,7 @@
var $nbhd_input = $('input[name="%(neighborhood)s"]');
var $name_input = $('input[name="%(project_name)s"]');
var $unixname_input = $('input[name="%(project_unixname)s"]');
+ var $project_url = $('#project_url');
var $url_fragment = $('#url_fragment');
var $form = $name_input.closest('form');
var delay = (function(){
@@ -1005,6 +1006,7 @@
$error_field = $('<div class="error" style="display: none"></div>').insertAfter($input);
}
$error_field.text(message).toggle(!!message);
+ $project_url.toggle(!message);
update_icon($input);
};
$form.submit(function(e) {
diff --git a/Allura/allura/lib/widgets/resources/css/add_project.css b/Allura/allura/lib/widgets/resources/css/add_project.css
index 594b16f..a4eac98 100644
--- a/Allura/allura/lib/widgets/resources/css/add_project.css
+++ b/Allura/allura/lib/widgets/resources/css/add_project.css
@@ -35,11 +35,12 @@
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
}
-div.welcome .error, div.welcome .success {
+div.welcome .error, div.welcome .success, #project_url {
font-size: 13px;
padding: 5px;
background: none;
border: 0;
+ margin-bottom: 0;
}
div.welcome .error, .error_icon {
color: #D41326;
@@ -81,10 +82,6 @@
div.welcome div.grid-3{
padding-top: 2px;
}
-#project_url {
- font-size: 12px;
- padding-left: 5px;
-}
#url_fragment {
font-weight: 600;
}
diff --git a/Allura/allura/templates/widgets/neighborhood_add_project.html b/Allura/allura/templates/widgets/neighborhood_add_project.html
index 68efbfd..892dcd5 100644
--- a/Allura/allura/templates/widgets/neighborhood_add_project.html
+++ b/Allura/allura/templates/widgets/neighborhood_add_project.html
@@ -37,7 +37,7 @@
</label>
</div>
<div class="grid-10">{{widget.display_field(widget.fields.project_unixname)}}
- <br/><div id="project_url">http://{{request.environ['HTTP_HOST']}}{{neighborhood.url()}}<span id="url_fragment"></span></div>
+ <div id="project_url">http://{{request.environ['HTTP_HOST']}}{{neighborhood.url()}}<span id="url_fragment"></span></div>
</div>
<div class="grid-9" style="position:relative; overflow:visible">
{{ g.icons['caution'].render(tag='b', extra_css='error_icon') }}
@@ -48,6 +48,9 @@
</div>
{% if not neighborhood.project_template %}
+ <h2 style="padding-left:20px">
+ Select the tools to use in your project. You may add or remove tools at any time.
+ </h2>
{% for opt in widget.fields.tools.options %}
{% set tool = g.entry_points["tool"][opt.html_value] %}
{% set _ctx = widget.context_for(widget.fields.tools) %}
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index ce8c8d8..fb48faa 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -513,7 +513,7 @@
antispam=True,
extra_environ=dict(username='root'))
assert r.html.find('div', {'class': 'error'}
- ).string == 'Please use only small letters, numbers, and dashes 3-15 characters long.'
+ ).string == 'Please use 3-15 small letters, numbers, and dashes.'
r = self.app.post('/adobe/register',
params=dict(
project_unixname='mymoz', project_name='My Moz',
@@ -528,7 +528,7 @@
antispam=True,
extra_environ=dict(username='root'))
assert r.html.find('div', {'class': 'error'}
- ).string == 'Please use only small letters, numbers, and dashes 3-15 characters long.'
+ ).string == 'Please use 3-15 small letters, numbers, and dashes.'
r = self.app.post('/p/register',
params=dict(
project_unixname='test', project_name='Tester',
@@ -827,7 +827,7 @@
'/p/check_names?neighborhood=Projects&project_unixname=%s' % name)
assert_equal(
r.json,
- {'project_unixname': 'Please use only small letters, numbers, and dashes 3-15 characters long.'})
+ {'project_unixname': 'Please use 3-15 small letters, numbers, and dashes.'})
r = self.app.get(
'/p/check_names?neighborhood=Projects&project_unixname=mymoz')
assert_equal(r.json, {})