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 2014/03/04 17:17:16 UTC
[1/7] git commit: [#7229] Handle errors in profile sections
gracefully, and log
Repository: incubator-allura
Updated Branches:
refs/heads/cj/7204 33e450d22 -> 3b1b9dae6 (forced update)
[#7229] Handle errors in profile sections gracefully, and log
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/d26d6e56
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d26d6e56
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d26d6e56
Branch: refs/heads/cj/7204
Commit: d26d6e56cfe8f06084e5d7277acfd2107db8d6a0
Parents: 44751e6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Mar 3 15:43:52 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Mar 3 15:46:07 2014 +0000
----------------------------------------------------------------------
Allura/allura/ext/user_profile/user_main.py | 28 +++++++++++++++---------
1 file changed, 18 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d26d6e56/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index 7065a32..9a9e5f1 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -29,6 +29,7 @@ from webob import exc
from jinja2 import Markup
from pytz import timezone
from datetime import datetime
+from paste.deploy.converters import asbool
from allura import version
from allura.app import Application, SitemapEntry
@@ -258,16 +259,23 @@ class ProfileSectionBase(object):
"""
if not self.check_display():
return ''
- tmpl = g.jinja2_env.get_template(self.template)
- context = self.prepare_context({
- 'h': h,
- 'c': c,
- 'g': g,
- 'user': self.user,
- 'config': tg.config,
- 'auth': AuthenticationProvider.get(request),
- })
- return Markup(tmpl.render(context))
+ try:
+ tmpl = g.jinja2_env.get_template(self.template)
+ context = self.prepare_context({
+ 'h': h,
+ 'c': c,
+ 'g': g,
+ 'user': self.user,
+ 'config': tg.config,
+ 'auth': AuthenticationProvider.get(request),
+ })
+ return Markup(tmpl.render(context))
+ except Exception as e:
+ log.exception('Error rendering profile section %s: %s', type(self).__name__, e)
+ if asbool(tg.config.get('debug')):
+ raise
+ else:
+ return ''
class PersonalDataSection(ProfileSectionBase):
[6/7] git commit: [#7204] Show project last-updated on user profile
Posted by jo...@apache.org.
[#7204] Show project last-updated on user profile
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/9cc7b0e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9cc7b0e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9cc7b0e3
Branch: refs/heads/cj/7204
Commit: 9cc7b0e3a710b203c4f44abca74513b11bf65ddb
Parents: e218270
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Mar 3 16:26:13 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Mar 4 15:54:26 2014 +0000
----------------------------------------------------------------------
.../allura/ext/user_profile/templates/sections/projects.html | 6 ++++++
Allura/allura/nf/allura/css/site_style.css | 6 ++++++
2 files changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9cc7b0e3/Allura/allura/ext/user_profile/templates/sections/projects.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/projects.html b/Allura/allura/ext/user_profile/templates/sections/projects.html
index 4f9fbc2..2b7d1a2 100644
--- a/Allura/allura/ext/user_profile/templates/sections/projects.html
+++ b/Allura/allura/ext/user_profile/templates/sections/projects.html
@@ -43,6 +43,12 @@
<a href="{{project.url()}}">{{project.name}}</a>
{{project.summary}}
</span>
+ <span class="project-last-updated">
+ Last Updated:
+ <time datetime="{{project.last_updated}}" title="{{project.last_updated}}">
+ {{h.ago(project.last_updated)}}
+ </time>
+ </span>
</li>
{% else %}
<li class="empty">No projects to display.</li>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9cc7b0e3/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index b83a43c..9827e84 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3385,6 +3385,12 @@ ul.dropdown ul li a:hover {
content: '\A';
white-space: pre;
}
+.profile-section.projects ul .project-last-updated {
+ display: block;
+ text-align: right;
+ font-style: italic;
+ font-size: 10px;
+}
.profile-section.projects .show-more-projects {
text-align: center;
}
[5/7] git commit: [#7204] Order user projects list by name
Posted by jo...@apache.org.
[#7204] Order user projects list by name
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/055689ee
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/055689ee
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/055689ee
Branch: refs/heads/cj/7204
Commit: 055689ee8a313c4afb587596212547deafb49a46
Parents: 8fbd4d6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 28 22:51:08 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Mar 4 15:54:26 2014 +0000
----------------------------------------------------------------------
Allura/allura/ext/user_profile/user_main.py | 5 ++++-
Allura/allura/model/auth.py | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/055689ee/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index 9a9e5f1..881a9ec 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -296,7 +296,10 @@ class ProjectsSection(ProfileSectionBase):
context['projects'] = [
project
for project in self.user.my_projects()
- if project != c.project and (self.user == c.user or h.has_access(project, 'read'))]
+ if project != c.project
+ and (self.user == c.user or h.has_access(project, 'read'))
+ and not project.is_nbhd_project
+ and not project.is_user_project]
return context
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/055689ee/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index fbb06bc..4e93581 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -706,7 +706,7 @@ class User(MappedClass, ActivityNode, ActivityObject):
# filter out projects to which the user belongs to no named groups (i.e., role['roles'] is empty)
projects = [r['project_id'] for r in roles if r['roles']]
from .project import Project
- return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).sort('last_updated', pymongo.DESCENDING)
+ return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).sort('name', pymongo.ASCENDING)
def my_projects_by_role_name(self, role_name):
"""
[7/7] git commit: [#7204] Added basic test of standard profile
sections
Posted by jo...@apache.org.
[#7204] Added basic test of standard profile sections
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3b1b9dae
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3b1b9dae
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3b1b9dae
Branch: refs/heads/cj/7204
Commit: 3b1b9dae6ec7cd6d763f670becfab0db536b7d41
Parents: 9cc7b0e
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Mar 4 16:17:02 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Mar 4 16:17:02 2014 +0000
----------------------------------------------------------------------
Allura/allura/tests/functional/test_user_profile.py | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3b1b9dae/Allura/allura/tests/functional/test_user_profile.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_user_profile.py b/Allura/allura/tests/functional/test_user_profile.py
index 3d1270a..a3ea741 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -30,7 +30,17 @@ class TestUserProfile(TestController):
def test_profile(self):
r = self.app.get('/u/test-admin/profile/')
assert_equal('Test Admin',
- r.html.find('h1', 'project_title').find('a').text)
+ r.html.find('h1', 'project_title').find('a').text)
+ sections = set([c for s in r.html.findAll(None, 'profile-section') for c in s['class'].split()])
+ assert_in('personal-data', sections)
+ assert_in('Username:test-admin', r.html.find(None, 'personal-data').getText())
+ assert_in('projects', sections)
+ assert_in('Test Project', r.html.find(None, 'projects').getText())
+ assert_in('Last Updated:less than 1 minute ago', r.html.find(None, 'projects').getText())
+ assert_in('tools', sections)
+ assert_in('Admin', r.html.find(None, 'tools').getText())
+ assert_in('skills', sections)
+ assert_in('No skills entered', r.html.find(None, 'skills').getText())
def test_wrong_profile(self):
self.app.get('/u/no-such-user/profile/', status=404)
[4/7] git commit: [#7204] Added Social Networks user profile section
Posted by jo...@apache.org.
[#7204] Added Social Networks user profile section
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e2182703
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e2182703
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e2182703
Branch: refs/heads/cj/7204
Commit: e2182703148f4d438e3461edda64ca6457d3b34f
Parents: 055689e
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 28 23:14:48 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Mar 4 15:54:26 2014 +0000
----------------------------------------------------------------------
.../user_profile/templates/sections/social.html | 41 ++++++++++++++++++++
Allura/allura/ext/user_profile/user_main.py | 4 ++
Allura/allura/nf/allura/css/site_style.css | 26 +++++++++++++
Allura/setup.py | 1 +
4 files changed, 72 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e2182703/Allura/allura/ext/user_profile/templates/sections/social.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/social.html b/Allura/allura/ext/user_profile/templates/sections/social.html
new file mode 100644
index 0000000..4d2ea8c
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/sections/social.html
@@ -0,0 +1,41 @@
+{#-
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-#}
+{% extends "allura.ext.user_profile:templates/profile_section_base.html" %}
+
+{% block title %}
+ Social Networks
+{% endblock %}
+
+{% block actions %}
+ {% if user == c.user %}
+ <a href="{{auth.account_urls['account_user_info']}}/contacts">Edit Social Networks</a>
+ {% endif %}
+{% endblock %}
+
+{% block section_class %}social{% endblock %}
+
+{% block content %}
+ <dl>
+ {% for contact in user.get_pref('socialnetworks') %}
+ <dt>{{ contact.socialnetwork }}</dt><dd>{{ contact.accounturl|urlize }}</dd>
+ {% else %}
+ <dd class="empty">No social networks entered.</dd>
+ {% endfor %}
+ </dl>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e2182703/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index 881a9ec..cd7bac9 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -309,3 +309,7 @@ class SkillsSection(ProfileSectionBase):
class ToolsSection(ProfileSectionBase):
template = 'allura.ext.user_profile:templates/sections/tools.html'
+
+
+class SocialSection(ProfileSectionBase):
+ template = 'allura.ext.user_profile:templates/sections/social.html'
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e2182703/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index 17cf48a..b83a43c 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3417,6 +3417,32 @@ ul.dropdown ul li a:hover {
.profile-section.tools .section-body li.empty {
margin-left: 10px;
}
+.profile-section.social {
+ margin-top: 10px;
+}
+.profile-section.social .section-body {
+ padding: 10px;
+}
+.profile-section.social dl dt {
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 4px;
+ width: 100px;
+ vertical-align: top;
+}
+.profile-section.social dl dd {
+ display: inline;
+}
+.profile-section.social dl dd:after {
+ content: '\A';
+ white-space: pre;
+}
+.profile-section.social dl dd.empty {
+ margin-left: 10px;
+}
+.profile-section.social dl dd a {
+ margin: 0;
+}
#user-message {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e2182703/Allura/setup.py
----------------------------------------------------------------------
diff --git a/Allura/setup.py b/Allura/setup.py
index 1d04828..f3a1a20 100644
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -132,6 +132,7 @@ setup(
projects = allura.ext.user_profile.user_main:ProjectsSection
skills = allura.ext.user_profile.user_main:SkillsSection
tools = allura.ext.user_profile.user_main:ToolsSection
+ social = allura.ext.user_profile.user_main:SocialSection
[paste.paster_command]
taskd = allura.command.taskd:TaskdCommand
[2/7] git commit: [#7229] Handle activity objects not having project
attribute gracefully on user profile
Posted by jo...@apache.org.
[#7229] Handle activity objects not having project attribute gracefully on user profile
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/adf92cf1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/adf92cf1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/adf92cf1
Branch: refs/heads/cj/7204
Commit: adf92cf18c2ac332ad41865d684a8bb7c9506938
Parents: d26d6e5
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Mar 3 15:47:35 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Mar 3 15:47:35 2014 +0000
----------------------------------------------------------------------
ForgeActivity/forgeactivity/main.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/adf92cf1/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 6af2da8..37c7ff5 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -265,7 +265,7 @@ class ForgeActivityProfileSection(ProfileSectionBase):
# calls are made by perm_check() above.
session(activity).expunge(activity)
activity_obj = get_activity_object(activity.obj)
- activity.obj.project = activity_obj.project if activity_obj else None
+ activity.obj.project = getattr(activity_obj, 'project', None)
context.update({
'follow_toggle': W.follow_toggle,
[3/7] git commit: [#7021] Bump version of GitPython for gpg-signed
commit fix
Posted by jo...@apache.org.
[#7021] Bump version of GitPython for gpg-signed commit fix
Signed-off-by: Cory Johns <cj...@slashdotmedia.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/8fbd4d6e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/8fbd4d6e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/8fbd4d6e
Branch: refs/heads/cj/7204
Commit: 8fbd4d6ee7fcc315f093fd8120fe974485e4fe65
Parents: adf92cf
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Mar 4 15:50:07 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Mar 4 15:50:07 2014 +0000
----------------------------------------------------------------------
requirements-sf.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8fbd4d6e/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 5df966f..68b5e5b 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -26,7 +26,7 @@ Unidecode==0.04.14
# use version built from https://github.com/johnsca/GitPython/tree/sf-master
# for unmerged fixes for [#5411], [#6000], and [#6078]
-GitPython==0.3.2.RC1-20140130
+GitPython==0.3.2.RC1-20140303
WebError==0.10.3-20130423