You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/29 22:39:49 UTC
[1/5] git commit: [#5716] add support option for contacting members
Updated Branches:
refs/heads/master 4307a3da0 -> 4727a8b98
[#5716] add support option for contacting members
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/17c0937f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/17c0937f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/17c0937f
Branch: refs/heads/master
Commit: 17c0937f958bdb7448e751fe8d12e7360264b5c7
Parents: 4307a3d
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue May 28 19:03:29 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 29 19:01:55 2013 +0000
----------------------------------------------------------------------
.../templates/admin_widgets/metadata_admin.html | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/17c0937f/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index ff60ab3..c21bce8 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -41,7 +41,7 @@
{{widget.display_field(widget.fields.short_description) }}
<div style="clear:both"> </div>
- Support Page:
+ Preferred Support Page (for users of your project):
<br>
<input name="support_page" type="radio" value=""{% if value.support_page == '' %} checked{% endif %} id="support_page_none">
<label for="support_page_none">None</label><br>
@@ -52,6 +52,8 @@
<label for="support_page_{{ac.options.mount_point}}">{{ac.options.mount_label}}</label><br>
{% endif %}
{% endfor %}
+ <input name="support_page" type="radio" value="_members" {% if value.support_page == '_members' %} checked{% endif %} id="support_page_members">
+ <label for="support_page_members">Contact project admins</label><br>
<input name="support_page" type="radio" value="_url" id="support_page_url_cb"
{% if value.support_page == '_url' %} checked{% endif %}>
<label for="support_page_url_cb">URL: </label>
[5/5] git commit: [#5716] expose tool type in _nav.json
Posted by jo...@apache.org.
[#5716] expose tool type in _nav.json
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/06d4a2a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/06d4a2a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/06d4a2a1
Branch: refs/heads/master
Commit: 06d4a2a1d7f881a3a63a346136e3abb2f819d67a
Parents: 17c0937
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue May 28 19:07:16 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 29 19:01:56 2013 +0000
----------------------------------------------------------------------
Allura/allura/controllers/project.py | 5 +++--
Allura/allura/tests/functional/test_home.py | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06d4a2a1/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index cc80ad3..da39e5d 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -311,9 +311,10 @@ class ProjectController(FeedController):
def _nav(self):
menu = []
for s in c.project.grouped_navbar_entries():
- entry = dict(name=s.label, url=s.url, icon=s.ui_icon)
+ entry = dict(name=s.label, url=s.url, icon=s.ui_icon, tool_name=s.tool_name)
if s.children:
- entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon) for child in s.children]
+ entry['children'] = [dict(name=child.label, url=child.url, icon=child.ui_icon, tool_name=child.tool_name)
+ for child in s.children]
menu.append(entry)
return dict(menu=menu)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/06d4a2a1/Allura/allura/tests/functional/test_home.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index 3e11437..5e9ec2e 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -50,8 +50,8 @@ class TestProjectHome(TestController):
response = self.app.get('/p/test/_nav.json')
menu = response.json['menu']
assert_equal(len(menu[1]['children']), 2)
- assert {u'url': u'/p/test/wiki/', u'name': u'Wiki', u'icon': u'tool-wiki'} in menu[1]['children'], menu[1]['children']
- assert {u'url': u'/p/test/wiki2/', u'name': u'wiki2', u'icon': u'tool-wiki'} in menu[1]['children'], menu[1]['children']
+ assert {u'url': u'/p/test/wiki/', u'name': u'Wiki', u'icon': u'tool-wiki', 'tool_name': 'wiki'} in menu[1]['children'], menu[1]['children']
+ assert {u'url': u'/p/test/wiki2/', u'name': u'wiki2', u'icon': u'tool-wiki', 'tool_name': 'wiki'} in menu[1]['children'], menu[1]['children']
@td.with_wiki
def test_project_group_nav_more_than_ten(self):
@@ -65,7 +65,7 @@ class TestProjectHome(TestController):
response = self.app.get('/p/test/_nav.json')
menu = response.json['menu']
assert_equal(len(menu[1]['children']), 11)
- assert {u'url': u'/p/test/_list/wiki', u'name': u'More...', u'icon': u'tool-wiki'} in menu[1]['children']
+ assert {u'url': u'/p/test/_list/wiki', u'name': u'More...', u'icon': u'tool-wiki', 'tool_name': 'wiki'} in menu[1]['children']
@td.with_wiki
def test_neighborhood_home(self):
[4/5] git commit: [#5716] make project admin's support choices
configurable, and off by default
Posted by jo...@apache.org.
[#5716] make project admin's support choices configurable, and off by default
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4727a8b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4727a8b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4727a8b9
Branch: refs/heads/master
Commit: 4727a8b983e8220c8d2a36f9be761f72be2549fb
Parents: 4c8116d
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed May 29 14:08:58 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 29 19:01:56 2013 +0000
----------------------------------------------------------------------
.../templates/admin_widgets/metadata_admin.html | 6 +++++-
Allura/development.ini | 6 ++++++
Allura/test.ini | 2 ++
3 files changed, 13 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4727a8b9/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index b37d638..454f33a 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -41,6 +41,8 @@
{{widget.display_field(widget.fields.short_description) }}
<div style="clear:both"> </div>
+
+ {% if tg.config.get('support_tool_choices') %}
Preferred Support Page (for users of your project):<br>
{% if c.form_errors.get('support_page_url') %}
<div class="error">{{c.form_errors.get('support_page_url')}}</div>
@@ -48,7 +50,7 @@
<input name="support_page" type="radio" value=""{% if value.support_page == '' %} checked{% endif %} id="support_page_none">
<label for="support_page_none">None</label><br>
{% for ac in c.project.app_configs %}
- {% if ac.tool_name.lower() in ['wiki', 'tickets', 'discussion'] %}
+ {% if ac.tool_name.lower() in tg.config['support_tool_choices'].split() %}
<input name="support_page" type="radio" value="{{ac.options.mount_point}}" id="support_page_{{ac.options.mount_point}}"
{% if value.support_page == ac.options.mount_point %} checked{% endif %}>
<label for="support_page_{{ac.options.mount_point}}">{{ac.options.mount_label}}</label><br>
@@ -60,6 +62,8 @@
{% if value.support_page == '_url' %} checked{% endif %}>
<label for="support_page_url_cb">URL: </label>
<input type="text" name="support_page_url" value="{{value.support_page_url}}" style="width: 70%"><br>
+ {% endif %}
+
{{ widget.display_label(widget.fields.twitter_handle) }}
<br>
{{widget.display_field(widget.fields.twitter_handle) }}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4727a8b9/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index cdde88e..b3c084f 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -141,6 +141,12 @@ scm.repos.tarball.root = /usr/share/nginx/www/
scm.repos.tarball.url_prefix = http://localhost/
scm.repos.tarball.zip_binary = /usr/bin/zip
+# space-separated list of tool names that are valid options
+# for project admins to set for their 'support_page' field
+# this field is not used by default in Allura, so this option
+# is disabled by default
+#support_tool_choices = wiki tickets discussion
+
trovecategories.enableediting = true
# ActivityStream
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4727a8b9/Allura/test.ini
----------------------------------------------------------------------
diff --git a/Allura/test.ini b/Allura/test.ini
index f749705..b3d9760 100644
--- a/Allura/test.ini
+++ b/Allura/test.ini
@@ -101,6 +101,8 @@ scm.repos.tarball.enable = true
scm.repos.tarball.root = /tmp/tarball
scm.repos.tarball.url_prefix = file://
+support_tool_choices = wiki tickets discussion
+
#stats.sample_rate = 0
disable_csrf_protection=1
[2/5] git commit: [#5716] show "Saved" message after saving main
project info
Posted by jo...@apache.org.
[#5716] show "Saved" message after saving main project info
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/8fc71796
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8fc71796
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8fc71796
Branch: refs/heads/master
Commit: 8fc71796c30c5807d64987d00be6eda58376db15
Parents: 06d4a2a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue May 28 21:58:14 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 29 19:01:56 2013 +0000
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8fc71796/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 6f6dcea..7b188c9 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -392,6 +392,7 @@ class ProjectAdminController(BaseController):
square=True, thumbnail_size=(48,48),
thumbnail_meta=dict(project_id=c.project._id,category='icon'))
g.post_event('project_updated')
+ flash('Saved', 'success')
redirect('overview')
def _add_trove(self, type, new_trove):
[3/5] git commit: [#5716] show URL validation errors on project
metadata page
Posted by jo...@apache.org.
[#5716] show URL validation errors on project metadata page
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4c8116d2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4c8116d2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4c8116d2
Branch: refs/heads/master
Commit: 4c8116d2022ee6579f07935ff78e7de66a98b63a
Parents: 8fc7179
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed May 29 01:05:52 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed May 29 19:01:56 2013 +0000
----------------------------------------------------------------------
.../templates/admin_widgets/metadata_admin.html | 23 +++++++++------
Allura/allura/ext/admin/widgets.py | 12 +++++--
2 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4c8116d2/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
index c21bce8..b37d638 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -21,11 +21,11 @@
{{ widget.display_label(widget.fields.name) }}
<br>
{{widget.display_field(widget.fields.name) }}
- {%if value.neighborhood.name != 'Users'%}
+ {%if c.project.neighborhood.name != 'Users'%}
<label for="shortname">Unixname</label>
<br>
<input id="shortname" type="text" disabled="disabled"
- value="{{value.shortname}}">
+ value="{{c.project.shortname}}">
{{ widget.display_label(widget.fields.external_homepage) }}
<br>
@@ -41,11 +41,13 @@
{{widget.display_field(widget.fields.short_description) }}
<div style="clear:both"> </div>
- Preferred Support Page (for users of your project):
- <br>
+ Preferred Support Page (for users of your project):<br>
+ {% if c.form_errors.get('support_page_url') %}
+ <div class="error">{{c.form_errors.get('support_page_url')}}</div>
+ {% endif %}
<input name="support_page" type="radio" value=""{% if value.support_page == '' %} checked{% endif %} id="support_page_none">
<label for="support_page_none">None</label><br>
- {% for ac in value.app_configs %}
+ {% for ac in c.project.app_configs %}
{% if ac.tool_name.lower() in ['wiki', 'tickets', 'discussion'] %}
<input name="support_page" type="radio" value="{{ac.options.mount_point}}" id="support_page_{{ac.options.mount_point}}"
{% if value.support_page == ac.options.mount_point %} checked{% endif %}>
@@ -57,14 +59,14 @@
<input name="support_page" type="radio" value="_url" id="support_page_url_cb"
{% if value.support_page == '_url' %} checked{% endif %}>
<label for="support_page_url_cb">URL: </label>
- <input type="text" name="support_page_url" value="{{value.support_page_url}}" style="width: 70%">
+ <input type="text" name="support_page_url" value="{{value.support_page_url}}" style="width: 70%"><br>
{{ widget.display_label(widget.fields.twitter_handle) }}
<br>
{{widget.display_field(widget.fields.twitter_handle) }}
{{ widget.display_label(widget.fields.facebook_page) }}
<br>
{{widget.display_field(widget.fields.facebook_page) }}
- {% if value.neighborhood.features['google_analytics'] %}
+ {% if c.project.neighborhood.features['google_analytics'] %}
{{ widget.display_label(widget.fields.tracking_id) }}
<br>
{{widget.display_field(widget.fields.tracking_id) }}
@@ -94,7 +96,7 @@
<input type="submit" value="Save" name="save" style="float: none" />
</div>
</div>
- {%if value.neighborhood.name != 'Users'%}
+ {%if c.project.neighborhood.name != 'Users'%}
<div style="clear:both"> </div>
<div id="project-status">
@@ -109,8 +111,11 @@
Deleted
{% endif %}
<a href="#" title="Edit"><b data-icon="p" class="ico ico-pencil"></b></a>
- <div id="project-status-edit" class="hidden">
+ <div id="project-status-edit" class="{% if not c.form_errors %}hidden{% endif %}">
<br>
+ {% if c.form_errors.get('moved_to_url') %}
+ <div class="error">{{c.form_errors.get('moved_to_url')}}</div>
+ {% endif %}
<input name="removal" type="radio" value="" id="removal_active_cb"
{% if value.removal == '' %} checked{% endif %}>
<label for="removal_active_cb">Active Project</label>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4c8116d2/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 8719c65..e663687 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -168,11 +168,14 @@ class MetadataAdmin(ff.AdminForm):
V.MaxBytesValidator(max=1000)),
attrs=dict(title="Add a few paragraphs describing your project to new users."))
icon = ew.FileField(label='Icon')
- external_homepage = ew.InputField(field_type="text", label='Homepage')
+ external_homepage = ew.InputField(field_type="text", label='Homepage',
+ validator=fev.URL(add_http=True))
support_page = ew.InputField(field_type="text", label='Support Page')
- support_page_url = ew.InputField(field_type="text", label='Support Page URL')
+ support_page_url = ew.InputField(field_type="text", label='Support Page URL',
+ validator=fev.URL(add_http=True, if_empty=''))
removal = ew.InputField(field_type="text", label='Removal')
- moved_to_url = ew.InputField(field_type="text", label='Moved Project to URL')
+ moved_to_url = ew.InputField(field_type="text", label='Moved Project to URL',
+ validator=fev.URL(add_http=True, if_empty=''))
export_controlled = ew.InputField(field_type="text", label='Export Control')
export_control_type = ew.InputField(field_type="text", label='Export Control Type')
delete = ew.InputField(field_type="hidden", label='Delete')
@@ -180,7 +183,8 @@ class MetadataAdmin(ff.AdminForm):
undelete = ew.InputField(field_type="hidden", label='Undelete')
tracking_id = ew.InputField(field_type="text", label="Analytics Tracking ID")
twitter_handle = ew.InputField(field_type="text", label='Twitter Handle')
- facebook_page = ew.InputField(field_type="text", label='Facebook page')
+ facebook_page = ew.InputField(field_type="text", label='Facebook page',
+ validator=fev.URL(add_http=True))
class AuditLog(ew_core.Widget):
template='jinja:allura.ext.admin:templates/widgets/audit.html'