You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/07/01 20:41:57 UTC
[3/3] allura git commit: [#8094] use same space for URL and error msg,
to avoid page content shifting around
[#8094] use same space for URL and error msg, to avoid page content shifting around
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/81cfcf9a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/81cfcf9a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/81cfcf9a
Branch: refs/heads/db/8094
Commit: 81cfcf9aad961a6665eb8a5e2be75f81f00c51e2
Parents: 932ed27
Author: Dave Brondsema <da...@brondsema.net>
Authored: Fri Jul 1 16:19:14 2016 -0400
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Fri Jul 1 16:41:46 2016 -0400
----------------------------------------------------------------------
Allura/allura/lib/widgets/forms.py | 4 +++-
Allura/allura/lib/widgets/resources/css/add_project.css | 7 ++-----
Allura/allura/templates/widgets/neighborhood_add_project.html | 5 ++++-
Allura/allura/tests/functional/test_neighborhood.py | 6 +++---
4 files changed, 12 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/81cfcf9a/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
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 @@ class NeighborhoodProjectShortNameValidator(fev.FancyValidator):
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 @@ class NeighborhoodAddProjectForm(ForgeForm):
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 @@ class NeighborhoodAddProjectForm(ForgeForm):
$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) {
http://git-wip-us.apache.org/repos/asf/allura/blob/81cfcf9a/Allura/allura/lib/widgets/resources/css/add_project.css
----------------------------------------------------------------------
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 @@ div.welcome input {
-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-9{
div.welcome div.grid-3{
padding-top: 2px;
}
-#project_url {
- font-size: 12px;
- padding-left: 5px;
-}
#url_fragment {
font-weight: 600;
}
http://git-wip-us.apache.org/repos/asf/allura/blob/81cfcf9a/Allura/allura/templates/widgets/neighborhood_add_project.html
----------------------------------------------------------------------
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) %}
http://git-wip-us.apache.org/repos/asf/allura/blob/81cfcf9a/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 ce8c8d8..fb48faa 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -513,7 +513,7 @@ class TestNeighborhood(TestController):
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 @@ class TestNeighborhood(TestController):
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 @@ class TestNeighborhood(TestController):
'/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, {})