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/01 00:14:58 UTC
[1/2] git commit: [#7204] Order user projects list by name
Repository: incubator-allura
Updated Branches:
refs/heads/cj/7204 [created] 3bef98b95
[#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/22270943
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/22270943
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/22270943
Branch: refs/heads/cj/7204
Commit: 2227094351892493f6e8a717b00e48db7f5d94af
Parents: 44751e6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 28 22:51:08 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Fri Feb 28 22:51:08 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/22270943/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..f4591a8 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -288,7 +288,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/22270943/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):
"""
[2/2] 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/3bef98b9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3bef98b9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3bef98b9
Branch: refs/heads/cj/7204
Commit: 3bef98b957614564aac53d6163eaf5d0cef6c47d
Parents: 2227094
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 28 23:14:48 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Fri Feb 28 23:14:48 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/3bef98b9/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/3bef98b9/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 f4591a8..a799e4e 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -301,3 +301,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/3bef98b9/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/3bef98b9/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