You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2014/02/21 23:21:49 UTC
[01/10] git commit: [#7097] Tweaks per discussion for empty item
display, and showing more activities
Repository: incubator-allura
Updated Branches:
refs/heads/master 7ad2a9acb -> fc1c466ab
[#7097] Tweaks per discussion for empty item display, and showing more activities
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/34d6c93b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/34d6c93b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/34d6c93b
Branch: refs/heads/master
Commit: 34d6c93b3b7b9bcc082d226aa6c4ce421569f11f
Parents: 64ffd1d
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 14 17:30:45 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
.../templates/sections/personal-data.html | 14 +++++++++-
.../templates/sections/projects.html | 2 ++
.../user_profile/templates/sections/skills.html | 6 +++--
Allura/allura/nf/allura/css/site_style.css | 28 +++++++++++++++++---
ForgeActivity/forgeactivity/main.py | 2 +-
5 files changed, 45 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34d6c93b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/personal-data.html b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
index 81b9f69..4637a5d 100644
--- a/Allura/allura/ext/user_profile/templates/sections/personal-data.html
+++ b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
@@ -38,19 +38,28 @@
<dt>Joined:</dt><dd>
{{auth.user_registration_date(user)}}
</dd>
+ {% set loc = user.get_pref('localization') %}
+ {% if loc.city or loc.country or timezone %}
<dt>Location:</dt><dd>
- {% set loc = user.get_pref('localization') %}
{{ [loc.city, loc.country, timezone]|filter|join(' / ') }}
</dd>
+ {% endif %}
+ {% if user.get_pref('sex') not in (None, 'Unknown') %}
<dt>Gender:</dt><dd>
{{user.get_pref('sex')}}
</dd>
+ {% endif %}
+ {% if user.get_pref('telnumbers') %}
<dt>Phone Number:</dt><dd>
{{user.get_pref('telnumbers')|join(', ')}}
</dd>
+ {% endif %}
+ {% if user.get_pref('skypeaccount') %}
<dt>Skype:</dt><dd>
{{user.get_pref('skypeaccount')}}
</dd>
+ {% endif %}
+ {% if user.get_pref('webpages') %}
<dt>Web Site{% if user.get_pref('webpages')|length > 1 %}s{% endif %}:</dt><dd>
<ol>
{% for webpage in user.get_pref('webpages') %}
@@ -58,6 +67,8 @@
{% endfor %}
</ol>
</dd>
+ {% endif %}
+ {% if user.get_pref('availability') %}
<dt>Availability (UTC):</dt><dd>
<ol>
{% for slot in user.get_localized_availability('utc') %}
@@ -65,5 +76,6 @@
{% endfor %}
</ol>
</dd>
+ {% endif %}
</dl>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34d6c93b/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 e690748..4f9fbc2 100644
--- a/Allura/allura/ext/user_profile/templates/sections/projects.html
+++ b/Allura/allura/ext/user_profile/templates/sections/projects.html
@@ -44,6 +44,8 @@
{{project.summary}}
</span>
</li>
+ {% else %}
+ <li class="empty">No projects to display.</li>
{% endfor %}
</ul>
{% if projects|length > 5 %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34d6c93b/Allura/allura/ext/user_profile/templates/sections/skills.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/skills.html b/Allura/allura/ext/user_profile/templates/sections/skills.html
index 104cc7a..966ce0a 100644
--- a/Allura/allura/ext/user_profile/templates/sections/skills.html
+++ b/Allura/allura/ext/user_profile/templates/sections/skills.html
@@ -32,8 +32,10 @@
{% block content %}
<ul>
- {% for skill in user.get_skills() %}
+ {% for skill in user.get_skills() %}
<li>{{ skill.skill.fullname }}</li>
- {% endfor %}
+ {% else %}
+ <li class="empty">No skills entered.</li>
+ {% endfor %}
</ul>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34d6c93b/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 a35d4a2..e616ef0 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3294,6 +3294,10 @@ ul.dropdown ul li a:hover {
.profile-section .section-body {
background-color: #fff;
}
+.profile-section .section-body .empty {
+ font-style: italic;
+ list-style: none;
+}
.profile-section.activity {
width: 260px;
@@ -3307,7 +3311,6 @@ ul.dropdown ul li a:hover {
}
.profile-section.activity .empty {
padding: 10px;
- font-style: italic;
margin-bottom: 0;
}
.profile-section.activity ul {
@@ -3385,17 +3388,36 @@ ul.dropdown ul li a:hover {
}
.profile-section.projects .show-more-projects {
text-align: center;
- }
+}
.profile-section.projects .show-more-projects button {
float: none;
}
.profile-section.skills .section-body {
padding: 10px 0;
}
-
+.profile-section.skills .section-body ul {
+ margin-bottom: 0;
+ margin-left: 0;
+}
+.profile-section.skills .section-body li {
+ margin-left: 25px;
+}
+.profile-section.skills .section-body li.empty {
+ margin-left: 10px;
+}
.profile-section.tools .section-body {
padding: 10px 0;
}
+.profile-section.tools .section-body ul {
+ margin-bottom: 0;
+ margin-left: 0;
+}
+.profile-section.tools .section-body li {
+ margin-left: 25px;
+}
+.profile-section.tools .section-body li.empty {
+ margin-left: 10px;
+}
#user-message {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/34d6c93b/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index e82cca7..ca6ceaf 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -253,7 +253,7 @@ class ForgeActivityProfileSection(ProfileSectionBase):
actor_only=True,
)
filtered_timeline = list(islice(ifilter(perm_check(c.user), full_timeline),
- 0, 5))
+ 0, 8))
context.update({
'follow_toggle': W.follow_toggle,
'following': g.director.is_connected(c.user, self.user),
[04/10] git commit: [#7097] Changes for new User Profile
Posted by tv...@apache.org.
[#7097] Changes for new 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/93658ddd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/93658ddd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/93658ddd
Branch: refs/heads/master
Commit: 93658ddd0682daa96d1cfab513f9fd564a9e180d
Parents: bd978f7
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Feb 12 04:01:38 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
.../templates/sections/personal-data.html | 12 +-
.../templates/sections/projects.html | 2 +
.../ext/user_profile/templates/user_index.html | 23 +-
Allura/allura/model/auth.py | 2 +-
Allura/allura/model/project.py | 5 +-
Allura/allura/nf/allura/css/site_style.css | 220 +++++++++++++++----
.../allura/templates/jinja_master/master.html | 2 +
.../allura/templates/jinja_master/nav_menu.html | 2 +
.../templates/widgets/profile_section.html | 2 +-
9 files changed, 205 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/ext/user_profile/templates/sections/personal-data.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/personal-data.html b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
index 94b0421..3d2f2ef 100644
--- a/Allura/allura/ext/user_profile/templates/sections/personal-data.html
+++ b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
@@ -32,14 +32,16 @@
{% block content %}
<dl class="personal-data">
- <dt>Joined:</dt><dd>{{auth.user_registration_date(user)}}</dd>
+ <dt>Username:</dt><dd>
+ {{user.username}}
+ </dd>
+ <dt>Joined:</dt><dd>
+ {{auth.user_registration_date(user)}}
+ </dd>
<dt>Location:</dt><dd>
{% set loc = user.get_pref('localization') %}
{{ [loc.city, loc.country, timezone]|filter|join(' / ') }}
</dd>
- <dt>Username:</dt><dd>
- {{user.username}}
- </dd>
<dt>Gender:</dt><dd>
{{user.get_pref('sex')}}
</dd>
@@ -52,7 +54,7 @@
<dt>Web Site{% if user.get_pref('webpages')|length > 1 %}s{% endif %}:</dt><dd>
{{user.get_pref('webpages')|filter|map('urlize', 20, true)|join(', ')}}
</dd>
- <dt>Availability:</dt><dd>
+ <dt>Availability (UTC):</dt><dd>
<ol>
{% for slot in user.get_localized_availability('utc') %}
<li>{{ slot.week_day }}: {{ slot.start_time.strftime('%H:%M') }} to {{ slot.end_time.strftime('%H:%M') }}</li>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/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 4fc5eda..3f517de 100644
--- a/Allura/allura/ext/user_profile/templates/sections/projects.html
+++ b/Allura/allura/ext/user_profile/templates/sections/projects.html
@@ -33,6 +33,7 @@
{% block content %}
<ul>
{% for project in user.my_projects() %}
+ {% if project != c.project and not project.is_nbhd_project %}
<li>
{% if project.icon -%}
<img src="{{project.url()}}/icon?{{project.icon._id.generation_time}}" alt="Project Logo"/>
@@ -44,6 +45,7 @@
{{project.summary}}
</span>
</li>
+ {% endif %}
{% endfor %}
</ul>
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/ext/user_profile/templates/user_index.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/user_index.html b/Allura/allura/ext/user_profile/templates/user_index.html
index 30e4ea3..3e4ed44 100644
--- a/Allura/allura/ext/user_profile/templates/user_index.html
+++ b/Allura/allura/ext/user_profile/templates/user_index.html
@@ -32,23 +32,20 @@
<a href="{{c.app.url}}feed.rss" title="Follow"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
{% endblock %}
-{% block nav_menu %}{{super()}}{% endblock %}
+{% block nav_menu %}
+ {% if user != c.user %}
+ <a id="user-message" href="send_message" class="btn">
+ <b data-icon="{{g.icons['mail'].char}}" class="ico {{g.icons['mail'].css}}"></b>
+ <span>Send Message</span>
+ </a>
+ {% endif %}
+ {{super()}}
+{% endblock %}
{% block top_nav %}{# disabled #}{% endblock %}
-{% block content %}
+{% block content_base %}
{% for section in sections %}
{{ section.display() }}
{% endfor %}
{% endblock %}
-
-{% block extra_js %}
- <script type="text/javascript">
- function changeTimezone(opt){
- $("#timeslotslocal").hide();
- $("#timeslotsutc").hide();
- $("#timeslotsconverted").hide();
- $("#timeslots" + opt).show();
- }
- </script>
-{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 357afe8..fbb06bc 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -479,7 +479,7 @@ class User(MappedClass, ActivityNode, ActivityObject):
week_day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday', 'Sunday']
avail = self.get_availability_timeslots()
- usertimezone = timezone(self.get_pref('timezone'))
+ usertimezone = timezone(self.get_pref('timezone') or 'UTC')
chosentimezone = timezone(tz_name)
retlist = []
for t in avail:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 26291be..25d0d9a 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -751,7 +751,10 @@ class Project(MappedClass, ActivityNode, ActivityObject):
MappedClass.delete(self)
def breadcrumbs(self):
- entry = (self.name, self.url())
+ if self.is_user_project:
+ entry = (self.user_project_of.display_name, self.url())
+ else:
+ entry = (self.name, self.url())
if self.parent_project:
return self.parent_project.breadcrumbs() + [entry]
else:
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/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 94f5d09..d018945 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -2211,6 +2211,7 @@ nav .ico {
#nav_menu_holder h2.project_summary {
line-height: 1em;
font-size: 16px;
+ height: 16px;
font-weight: normal;
margin-bottom: 0;
}
@@ -3241,56 +3242,187 @@ ul.dropdown ul li a:hover {
display: inline;
}
-.user-activity {
- position: absolute;
- top: 60px;
- right: 0px;
- border: 1px solid #ccc;
- border-radius: 4px;
+/* User Profile styles generated from _user_profile.scss */
+.profile-section {
+ width: 660px;
+ display: inline;
+ float: left;
+ overflow: hidden;
+ *zoom: 1;
+ margin: 0 10px;
+ margin: 0 0 10px 10px;
+ border: 1px solid #aaaaaa;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
}
-.user-activity h3 {
- background-color: #555555;
- background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #666666), color-stop(100%, #555555));
- background-image: -moz-linear-gradient(top, #666666 0%, #555555 100%);
- background-image: linear-gradient(top, #666666 0%, #555555 100%);
- border: 1px solid #333333;
- color: #fff;
- padding: 10px;
- font-weight: normal;
- font-size: 14px;
-}
-.user-activity h3 a {
- float: right;
- margin-left: 8px;
-}
-.user-activity h3 b.ico {
- background-image: url('../images/neo-icon-set-ffffff-256x350.png');
+.profile-section > h3 {
+ background-color: #555555;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #666666), color-stop(100%, #555555));
+ background-image: -webkit-linear-gradient(#666666, #555555);
+ background-image: -moz-linear-gradient(#666666, #555555);
+ background-image: -o-linear-gradient(#666666, #555555);
+ background-image: linear-gradient(#666666, #555555);
+ border: 1px solid #333333;
+ color: #fff;
+ font-weight: normal;
+ font-size: 16px;
+ padding: 10px;
}
-.user-activity .empty {
- padding: 10px;
- font-style: italic;
+.profile-section > h3 hr {
+ border: 1px solid #000;
+ background-color: #111;
+ opacity: .4;
}
-.user-activity ul {
- margin: 0px;
- list-style: none;
+.profile-section > h3 .actions {
+ float: right;
+ color: #fff;
+ font-size: 14px;
}
-.user-activity ul li {
- padding: 10px;
- border-bottom: 1px solid #ccc;
+.profile-section > h3 .actions a {
+ color: #fff;
+ text-decoration: underline;
}
-.user-activity ul li img {
- vertical-align: text-bottom;
+.profile-section > h3 .actions a.icon {
+ text-decoration: none;
}
-.user-activity ul li p {
- padding: 5px 0 0 0;
+.profile-section > h3 .actions.active {
+ color: #cccccc !important;
}
-.user-activity ul li time {
- display: block;
- text-align: right;
- font-size: 10px;
+.profile-section .section-body {
+ background-color: #fff;
}
-.user-activity a.view-all {
- display: block;
- text-align: right;
- padding: 5px 10px 5px 0;
+
+.profile-section.activity {
+ width: 260px;
+ display: inline;
+ float: left;
+ overflow: hidden;
+ *zoom: 1;
+ margin: 0 10px;
+ float: right;
+ margin: 10px 10px 0 0;
+}
+.profile-section.activity .empty {
+ padding: 10px;
+ font-style: italic;
+ margin-bottom: 0;
+}
+.profile-section.activity ul {
+ margin: 0;
+ list-style: none;
+}
+.profile-section.activity ul li {
+ padding: 10px;
+ padding-bottom: 0;
+ border-bottom: 1px solid #cccccc;
+}
+.profile-section.activity ul li img {
+ vertical-align: text-bottom;
+}
+.profile-section.activity ul li p {
+ padding: 5px 0 0 0;
+}
+.profile-section.activity ul li time {
+ display: block;
+ text-align: right;
+ font-size: 10px;
+}
+.profile-section.activity a.view-all {
+ display: block;
+ text-align: right;
+ padding: 5px 10px;
+}
+.profile-section.personal-data {
+ margin-top: 10px;
+}
+.profile-section.personal-data .section-body {
+ padding: 10px;
+}
+.profile-section.personal-data dl dt {
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 4px;
+ width: 130px;
+ vertical-align: top;
+}
+.profile-section.personal-data dl dd {
+ display: inline;
+}
+.profile-section.personal-data dl dd:after {
+ content: '\A';
+ white-space: pre;
+}
+.profile-section.personal-data dl dd ol {
+ list-style: none;
+ display: inline-block;
+ margin-left: 0;
+}
+.profile-section.projects ul, .profile-section.projects ol {
+ list-style: none;
+ margin: 0;
+}
+.profile-section.projects ul li, .profile-section.projects ol li {
+ clear: both;
+ border-top: 1px solid #e5e5e5;
+ padding: 10px;
+}
+.profile-section.projects ul img, .profile-section.projects ol img {
+ vertical-align: top;
+ margin-right: 10px;
+}
+.profile-section.projects ul .project-info, .profile-section.projects ol .project-info {
+ display: inline-block;
+}
+.profile-section.projects ul .project-info a, .profile-section.projects ol .project-info a {
+ font-weight: bold;
+}
+.profile-section.projects ul .project-info a:after, .profile-section.projects ol .project-info a:after {
+ content: '\A';
+ white-space: pre;
+}
+.profile-section.skills .section-body {
+ padding: 10px 0;
+}
+
+.profile-section.tools .section-body {
+ padding: 10px 0;
+}
+#user-message {
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ -ms-border-radius: 4px;
+ -o-border-radius: 4px;
+ border-radius: 4px;
+ color: #fff;
+ text-shadow: #333333 0 1px 0 !important;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0099cc), color-stop(100%, #0077aa));
+ background-image: -webkit-linear-gradient(#0099cc 0%, #0077aa 100%);
+ background-image: -moz-linear-gradient(#0099cc 0%, #0077aa 100%);
+ background-image: -o-linear-gradient(#0099cc 0%, #0077aa 100%);
+ background-image: linear-gradient(#0099cc 0%, #0077aa 100%);
+ float: right;
+ display: block;
+ font-size: 15px;
+}
+#user-message b.ico {
+ font-size: 26px;
+ width: 26px;
+ height: 26px;
+}
+#user-message span {
+ display: block;
+}
+/* end of User Profile styles from _user_profile.scss */
+/* Use the right icon set for the User Activity and Send Message action buttons on User Profile */
+.profile-section.activity h3 b.ico,
+#user-message b.ico {
+ background-image: url('../images/neo-icon-set-ffffff-256x350.png');
+ width: 16px;
+ height: 16px;
+}
+#user-message {
+ top: 10px;
}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/templates/jinja_master/master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/master.html b/Allura/allura/templates/jinja_master/master.html
index dd9c313..0c4d188 100644
--- a/Allura/allura/templates/jinja_master/master.html
+++ b/Allura/allura/templates/jinja_master/master.html
@@ -99,6 +99,7 @@
{% endblock %}
</div>
<div id="content_base">
+ {% block content_base %}
{% if not hide_left_bar %}
{% block sidebar_menu %}
{% include g.theme.sidebar_menu %}
@@ -132,6 +133,7 @@
{% endif %}
{% block after_content %}{% endblock %}
</div>
+ {% endblock %}
</div>
</section>
{{theme_macros.footer(g.year(), g.theme_href(''))}}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index b29d566..520267e 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -22,7 +22,9 @@
{% if not c.project or (n.neighborhood_project == c.project and not n.show_title) %}
<div id="nav_menu_missing"></div>
{% else %}
+ {% if not c.project.is_user_project %}
{{ theme_macros.breadcrumbs(c.project, c.app) }}
+ {% endif %}
{{ theme_macros.project_header_right(c.project, c.app) }}
{% if c.project.is_user_project %}
{{lib.gravatar(c.project.user_project_of, size=48, className='project_icon')}}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/93658ddd/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/templates/widgets/profile_section.html b/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
index 5f2230e..28ba645 100644
--- a/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
+++ b/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
@@ -31,7 +31,7 @@
<a href="feed.rss" title="RSS"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}" title="Feed"></b></a>
{% endblock %}
-{% block section_class %}user-activity{% endblock %}
+{% block section_class %}activity{% endblock %}
{% block content %}
{% if not timeline %}
[03/10] git commit: [#7097] Better display of User Profile Tools
section items
Posted by tv...@apache.org.
[#7097] Better display of User Profile Tools section items
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/03081c2c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/03081c2c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/03081c2c
Branch: refs/heads/master
Commit: 03081c2c025942b9fffa1b78b8dfed48087fb624
Parents: 04a6a13
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Feb 13 21:43:08 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
.../ext/user_profile/templates/sections/tools.html | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/03081c2c/Allura/allura/ext/user_profile/templates/sections/tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/tools.html b/Allura/allura/ext/user_profile/templates/sections/tools.html
index 4427c8b..edcdbb9 100644
--- a/Allura/allura/ext/user_profile/templates/sections/tools.html
+++ b/Allura/allura/ext/user_profile/templates/sections/tools.html
@@ -32,8 +32,17 @@
{% block content %}
<ul>
- {% for tool in c.project.ordered_mounts() %}
- <li><a href="{{tool['ac'].url()}}">{{ tool['ac'].options.mount_label }}</a></li>
- {% endfor %}
+ {% for tool in c.project.grouped_navbar_entries() %}
+ <li>
+ <a href="{{tool.url}}">{{ tool.label }}</a>
+ {% if tool.children %}
+ <ul>
+ {% for child in tool.children %}
+ <li><a href="{{child.url}}">{{ child.label }}</a></li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </li>
+ {% endfor %}
</ul>
{% endblock %}
[07/10] git commit: [#7097] Switch user project name to summary for
better tagline implementation
Posted by tv...@apache.org.
[#7097] Switch user project name to summary for better tagline implementation
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/04a6a136
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/04a6a136
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/04a6a136
Branch: refs/heads/master
Commit: 04a6a1363daea7d3f01c179ab8dd6543bd151231
Parents: 93658dd
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Feb 13 21:31:47 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
Allura/allura/ext/admin/admin_main.py | 2 +-
.../allura/ext/admin/templates/admin_widgets/metadata_admin.html | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/04a6a136/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 0c79fea..e19572b 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -386,7 +386,7 @@ class ProjectAdminController(BaseController):
plugin.ProjectRegistrationProvider.get().undelete_project(
c.project, c.user)
redirect('overview')
- if name != c.project.name:
+ if name and name != c.project.name:
h.log_action(log, 'change project name').info('')
M.AuditLog.log('change project name to %s', name)
c.project.name = name
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/04a6a136/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 16b303b..f894be5 100644
--- a/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
+++ b/Allura/allura/ext/admin/templates/admin_widgets/metadata_admin.html
@@ -19,10 +19,10 @@
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
<form method="POST" action="update" enctype="multipart/form-data" id="metadata_form">
<div class="grid-9">
+ {%if not c.project.is_user_project %}
{{ widget.display_label(widget.fields.name) }}
<br>
{{widget.display_field(widget.fields.name) }}
- {%if c.project.neighborhood.name != 'Users'%}
<label for="shortname">Unixname</label>
<br>
<input id="shortname" type="text" disabled="disabled"
@@ -35,12 +35,14 @@
{{ widget.display_label(widget.fields.video_url) }}
<br>
{{widget.display_field(widget.fields.video_url) }}
+ {% endif %}
{{ widget.display_label(widget.fields.summary) }}
<br>
{{widget.display_field(widget.fields.summary) }}
<br>
+ {%if not c.project.is_user_project %}
{{ widget.display_label(widget.fields.short_description) }}
<br>
{{widget.display_field(widget.fields.short_description) }}
[10/10] git commit: [#7097] Bug fixes and test fixes
Posted by tv...@apache.org.
[#7097] Bug fixes and test fixes
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/fc1c466a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fc1c466a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fc1c466a
Branch: refs/heads/master
Commit: fc1c466abc8513020907094b68046f863d999ccc
Parents: 881ddc1
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Fri Feb 21 22:21:07 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 22:21:07 2014 +0000
----------------------------------------------------------------------
.../user_profile/templates/sections/tools.html | 2 +-
Allura/allura/model/project.py | 2 +-
.../tests/functional/test_neighborhood.py | 4 ++--
.../tests/functional/test_user_profile.py | 24 ++++----------------
4 files changed, 8 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fc1c466a/Allura/allura/ext/user_profile/templates/sections/tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/tools.html b/Allura/allura/ext/user_profile/templates/sections/tools.html
index d6629fd..da0db03 100644
--- a/Allura/allura/ext/user_profile/templates/sections/tools.html
+++ b/Allura/allura/ext/user_profile/templates/sections/tools.html
@@ -24,7 +24,7 @@
{% block actions %}
{% if user == c.user %}
- <a href="{{c.project.url()}}/admin/tools">Add Tools</a>
+ <a href="{{c.project.url()}}admin/tools">Add Tools</a>
{% endif %}
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fc1c466a/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 25d0d9a..452652c 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -367,7 +367,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
@property
def is_user_project(self):
- return self.shortname.startswith('u/')
+ return self.is_root and self.shortname.startswith('u/')
@LazyProperty
def user_project_of(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fc1c466a/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 21b8e37..e66445a 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -900,10 +900,10 @@ class TestNeighborhood(TestController):
assert 'macro' in r
@td.with_user_project('test-user')
- def test_profile_topnav_menu(self):
+ def test_profile_tools(self):
r = self.app.get('/u/test-user/',
extra_environ=dict(username='test-user')).follow()
- assert r.html.find('div', id='top_nav').find(
+ assert r.html.find('div', 'profile-section tools').find(
'a', href='/u/test-user/profile/'), r.html
def test_user_project_creates_on_demand(self):
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fc1c466a/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 a09bf83..3d1270a 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -28,29 +28,19 @@ class TestUserProfile(TestController):
@td.with_user_project('test-admin')
def test_profile(self):
- response = self.app.get('/u/test-admin/profile/')
- assert '<h2 class="dark title">Test Admin' in response
+ r = self.app.get('/u/test-admin/profile/')
+ assert_equal('Test Admin',
+ r.html.find('h1', 'project_title').find('a').text)
def test_wrong_profile(self):
self.app.get('/u/no-such-user/profile/', status=404)
- @td.with_user_project('test-admin')
- @td.with_user_project('test-user')
- def test_seclusion(self):
- response = self.app.get('/u/test-admin/profile/')
- assert 'Email Addresses' in response
- self.app.get('/u/test-user', extra_environ=dict(
- username='test-user'))
- response = self.app.get('/u/test-user/profile/')
- assert 'Email Addresses' not in response
-
@td.with_user_project('test-user')
def test_missing_user(self):
User.query.remove(dict(username='test-user'))
p = Project.query.get(shortname='u/test-user')
assert p is not None and p.is_user_project
response = self.app.get('/u/test-user/profile/', status=404)
- assert 'Email Addresses' not in response
@td.with_user_project('test-admin')
@td.with_wiki
@@ -130,13 +120,7 @@ class TestUserProfile(TestController):
'user@example.com')
r = self.app.get('/u/test-user/profile',
status=200)
- assert '<a href="send_message">Send me a message</a>' in r
-
- r = self.app.get('/u/test-user/profile',
- extra_environ={'username': '*anonymous'},
- status=200)
-
- assert '<a href="send_message">Send me a message</a>' not in r
+ assert r.html.find('a', dict(href='send_message'))
@td.with_user_project('test-user')
def test_disable_user_messages(self):
[02/10] git commit: [#7097] Show only 5 projects on User Profile with
Show More button
Posted by tv...@apache.org.
[#7097] Show only 5 projects on User Profile with Show More button
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/927580b3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/927580b3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/927580b3
Branch: refs/heads/master
Commit: 927580b39d13e9f61c4770deb096f0a4923271b8
Parents: 03081c2
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Feb 13 23:17:35 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
.../templates/sections/projects.html | 20 +++++++++++++-------
Allura/allura/ext/user_profile/user_main.py | 7 +++++++
Allura/allura/nf/allura/css/site_style.css | 6 ++++++
3 files changed, 26 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/927580b3/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 3f517de..e690748 100644
--- a/Allura/allura/ext/user_profile/templates/sections/projects.html
+++ b/Allura/allura/ext/user_profile/templates/sections/projects.html
@@ -32,20 +32,26 @@
{% block content %}
<ul>
- {% for project in user.my_projects() %}
- {% if project != c.project and not project.is_nbhd_project %}
- <li>
+ {% for project in projects %}
+ <li{% if loop.index > 5 %} class="hidden"{% endif %}>
{% if project.icon -%}
- <img src="{{project.url()}}/icon?{{project.icon._id.generation_time}}" alt="Project Logo"/>
+ <img src="{{project.url()}}/icon?{{project.icon._id.generation_time}}" alt="Project Logo" width="48" height="48"/>
{%- else -%}
- <img src="{{g.forge_static('images/project_default.png')}}" alt="Project Logo"/>
+ <img src="{{g.forge_static('images/project_default.png')}}" alt="Project Logo" width="48" height="48"/>
{%- endif -%}
<span class="project-info">
<a href="{{project.url()}}">{{project.name}}</a>
{{project.summary}}
</span>
</li>
- {% endif %}
- {% endfor %}
+ {% endfor %}
</ul>
+ {% if projects|length > 5 %}
+ <div class="show-more-projects">
+ <button onclick="$(this).hide().closest('.section-body').find('li.hidden').show()">
+ Show More
+ <b data-icon="{{g.icons['plus'].char}}" class="ico {{g.icons['plus'].css}}"></b>
+ </button>
+ </div>
+ {% endif %}
{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/927580b3/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 01bb6b8..7065a32 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -284,6 +284,13 @@ class PersonalDataSection(ProfileSectionBase):
class ProjectsSection(ProfileSectionBase):
template = 'allura.ext.user_profile:templates/sections/projects.html'
+ def prepare_context(self, context):
+ 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'))]
+ return context
+
class SkillsSection(ProfileSectionBase):
template = 'allura.ext.user_profile:templates/sections/skills.html'
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/927580b3/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 d018945..a35d4a2 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3383,6 +3383,12 @@ ul.dropdown ul li a:hover {
content: '\A';
white-space: pre;
}
+.profile-section.projects .show-more-projects {
+ text-align: center;
+ }
+.profile-section.projects .show-more-projects button {
+ float: none;
+}
.profile-section.skills .section-body {
padding: 10px 0;
}
[09/10] git commit: [#7097] Update test due to new profile layout
Posted by tv...@apache.org.
[#7097] Update test due to new profile layout
- Tools are now in a page section, not in navbar
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/881ddc1f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/881ddc1f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/881ddc1f
Branch: refs/heads/master
Commit: 881ddc1f8ab31eb29888e355d68eda438669281b
Parents: b6120bf
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Fri Feb 21 21:23:51 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:23:51 2014 +0000
----------------------------------------------------------------------
ForgeActivity/forgeactivity/tests/functional/test_root.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/881ddc1f/ForgeActivity/forgeactivity/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/tests/functional/test_root.py b/ForgeActivity/forgeactivity/tests/functional/test_root.py
index b57c149..a2b3d55 100644
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -52,7 +52,7 @@ class TestActivityController(TestController):
def test_anon_read(self):
r = self.app.get('/u/test-user-1',
extra_environ={'username': '*anonymous'}).follow().follow()
- assert r.html.find('div', dict(id='top_nav')).find('a',
+ assert r.html.find('div', 'profile-section tools').find('a',
dict(href='/u/test-user-1/activity/')), \
'No Activity tool in top nav'
[08/10] git commit: [#7097] Fix wrapping of project descriptions
Posted by tv...@apache.org.
[#7097] Fix wrapping of project descriptions
Signed-off-by: Tim Van Steenburgh <tv...@gmail.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/b6120bf2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/b6120bf2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/b6120bf2
Branch: refs/heads/master
Commit: b6120bf28d760506e2e28d03412d94d9cfde7e16
Parents: 34d6c93
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Fri Feb 21 21:15:38 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:15:38 2014 +0000
----------------------------------------------------------------------
Allura/allura/ext/user_profile/templates/sections/tools.html | 2 +-
Allura/allura/nf/allura/css/site_style.css | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b6120bf2/Allura/allura/ext/user_profile/templates/sections/tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/tools.html b/Allura/allura/ext/user_profile/templates/sections/tools.html
index edcdbb9..d6629fd 100644
--- a/Allura/allura/ext/user_profile/templates/sections/tools.html
+++ b/Allura/allura/ext/user_profile/templates/sections/tools.html
@@ -19,7 +19,7 @@
{% extends "allura.ext.user_profile:templates/profile_section_base.html" %}
{% block title %}
- Tools
+ Personal Tools
{% endblock %}
{% block actions %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b6120bf2/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 e616ef0..17cf48a 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3375,9 +3375,8 @@ ul.dropdown ul li a:hover {
.profile-section.projects ul img, .profile-section.projects ol img {
vertical-align: top;
margin-right: 10px;
-}
-.profile-section.projects ul .project-info, .profile-section.projects ol .project-info {
- display: inline-block;
+ margin-bottom: 10px;
+ float: left;
}
.profile-section.projects ul .project-info a, .profile-section.projects ol .project-info a {
font-weight: bold;
[06/10] git commit: [#7097] Refactored User Profile to use Profile
Sections
Posted by tv...@apache.org.
[#7097] Refactored User Profile to use 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/bd978f79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/bd978f79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/bd978f79
Branch: refs/heads/master
Commit: bd978f7951248d537de2d9d680c3665624e7acbf
Parents: 7ad2a9a
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Feb 12 02:00:38 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
Allura/allura/config/app_cfg.py | 3 +
.../templates/profile_section_base.html | 28 +++
.../templates/sections/personal-data.html | 63 +++++
.../templates/sections/projects.html | 49 ++++
.../user_profile/templates/sections/skills.html | 39 +++
.../user_profile/templates/sections/tools.html | 39 +++
.../ext/user_profile/templates/user_index.html | 245 +------------------
Allura/allura/ext/user_profile/user_main.py | 34 ++-
Allura/allura/lib/helpers.py | 26 ++
Allura/allura/lib/plugin.py | 6 +-
.../allura/templates/jinja_master/nav_menu.html | 14 +-
Allura/setup.py | 6 +
ForgeActivity/forgeactivity/main.py | 1 -
.../templates/widgets/profile_section.html | 24 +-
14 files changed, 321 insertions(+), 256 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/config/app_cfg.py
----------------------------------------------------------------------
diff --git a/Allura/allura/config/app_cfg.py b/Allura/allura/config/app_cfg.py
index 1661356..bcca0c2 100644
--- a/Allura/allura/config/app_cfg.py
+++ b/Allura/allura/config/app_cfg.py
@@ -31,6 +31,7 @@ convert them into boolean, for example, you should use the
"""
import logging
+from functools import partial
import tg
import jinja2
@@ -102,6 +103,8 @@ class ForgeConfig(AppConfig):
jinja2_env.install_gettext_translations(pylons.i18n)
jinja2_env.filters['filesizeformat'] = helpers.do_filesizeformat
jinja2_env.filters['datetimeformat'] = helpers.datetimeformat
+ jinja2_env.filters['filter'] = lambda s,t=None: filter(t and jinja2_env.tests[t], s)
+ jinja2_env.filters['map'] = helpers.map_jinja_filter
jinja2_env.globals.update({'hasattr': hasattr})
config['pylons.app_globals'].jinja2_env = jinja2_env
# Jinja's unable to request c's attributes without strict_c
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/ext/user_profile/templates/profile_section_base.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/profile_section_base.html b/Allura/allura/ext/user_profile/templates/profile_section_base.html
new file mode 100644
index 0000000..7e15dad
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/profile_section_base.html
@@ -0,0 +1,28 @@
+{#-
+ 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.
+-#}
+<div class="profile-section {% block section_class %}{% endblock %}">
+ <h3>
+ {% block title %}{% endblock %}
+ <span class="actions">{% block actions %}{% endblock %}</span>
+ </h3>
+
+ <div class="section-body">
+ {% block content %}{% endblock %}
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/ext/user_profile/templates/sections/personal-data.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/personal-data.html b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
new file mode 100644
index 0000000..94b0421
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
@@ -0,0 +1,63 @@
+{#-
+ 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 %}
+ Personal Data
+{% endblock %}
+
+{% block actions %}
+ {% if user == c.user %}
+ <a href="{{auth.account_urls['account_user_info']}}">Edit Personal Data</a>
+ {% endif %}
+{% endblock %}
+
+{% block section_class %}personal-data{% endblock %}
+
+{% block content %}
+ <dl class="personal-data">
+ <dt>Joined:</dt><dd>{{auth.user_registration_date(user)}}</dd>
+ <dt>Location:</dt><dd>
+ {% set loc = user.get_pref('localization') %}
+ {{ [loc.city, loc.country, timezone]|filter|join(' / ') }}
+ </dd>
+ <dt>Username:</dt><dd>
+ {{user.username}}
+ </dd>
+ <dt>Gender:</dt><dd>
+ {{user.get_pref('sex')}}
+ </dd>
+ <dt>Phone Number:</dt><dd>
+ {{user.get_pref('telnumbers')|join(', ')}}
+ </dd>
+ <dt>Skype:</dt><dd>
+ {{user.get_pref('skypeaccount')}}
+ </dd>
+ <dt>Web Site{% if user.get_pref('webpages')|length > 1 %}s{% endif %}:</dt><dd>
+ {{user.get_pref('webpages')|filter|map('urlize', 20, true)|join(', ')}}
+ </dd>
+ <dt>Availability:</dt><dd>
+ <ol>
+ {% for slot in user.get_localized_availability('utc') %}
+ <li>{{ slot.week_day }}: {{ slot.start_time.strftime('%H:%M') }} to {{ slot.end_time.strftime('%H:%M') }}</li>
+ {% endfor %}
+ </ol>
+ </dd>
+ </dl>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/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
new file mode 100644
index 0000000..4fc5eda
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/sections/projects.html
@@ -0,0 +1,49 @@
+{#-
+ 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 %}
+ Projects
+{% endblock %}
+
+{% block actions %}
+ {% if user == c.user %}
+ <a href="/{{config.get('default_neighborhood', 'p')}}/add_project">Add Project</a>
+ {% endif %}
+{% endblock %}
+
+{% block section_class %}projects{% endblock %}
+
+{% block content %}
+ <ul>
+ {% for project in user.my_projects() %}
+ <li>
+ {% if project.icon -%}
+ <img src="{{project.url()}}/icon?{{project.icon._id.generation_time}}" alt="Project Logo"/>
+ {%- else -%}
+ <img src="{{g.forge_static('images/project_default.png')}}" alt="Project Logo"/>
+ {%- endif -%}
+ <span class="project-info">
+ <a href="{{project.url()}}">{{project.name}}</a>
+ {{project.summary}}
+ </span>
+ </li>
+ {% endfor %}
+ </ul>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/ext/user_profile/templates/sections/skills.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/skills.html b/Allura/allura/ext/user_profile/templates/sections/skills.html
new file mode 100644
index 0000000..104cc7a
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/sections/skills.html
@@ -0,0 +1,39 @@
+{#-
+ 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 %}
+ Skills
+{% endblock %}
+
+{% block actions %}
+ {% if user == c.user %}
+ <a href="{{auth.account_urls['account_user_info']}}/skills">Edit Skills</a>
+ {% endif %}
+{% endblock %}
+
+{% block section_class %}skills{% endblock %}
+
+{% block content %}
+ <ul>
+ {% for skill in user.get_skills() %}
+ <li>{{ skill.skill.fullname }}</li>
+ {% endfor %}
+ </ul>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/ext/user_profile/templates/sections/tools.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/tools.html b/Allura/allura/ext/user_profile/templates/sections/tools.html
new file mode 100644
index 0000000..4427c8b
--- /dev/null
+++ b/Allura/allura/ext/user_profile/templates/sections/tools.html
@@ -0,0 +1,39 @@
+{#-
+ 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 %}
+ Tools
+{% endblock %}
+
+{% block actions %}
+ {% if user == c.user %}
+ <a href="{{c.project.url()}}/admin/tools">Add Tools</a>
+ {% endif %}
+{% endblock %}
+
+{% block section_class %}tools{% endblock %}
+
+{% block content %}
+ <ul>
+ {% for tool in c.project.ordered_mounts() %}
+ <li><a href="{{tool['ac'].url()}}">{{ tool['ac'].options.mount_label }}</a></li>
+ {% endfor %}
+ </ul>
+{% endblock %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/ext/user_profile/templates/user_index.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/user_index.html b/Allura/allura/ext/user_profile/templates/user_index.html
index 047c21e..30e4ea3 100644
--- a/Allura/allura/ext/user_profile/templates/user_index.html
+++ b/Allura/allura/ext/user_profile/templates/user_index.html
@@ -32,250 +32,11 @@
<a href="{{c.app.url}}feed.rss" title="Follow"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}"></b></a>
{% endblock %}
-{% block content %}
- {% if user.preferences.email_address %}
- <p>{{lib.gravatar(user)}}</p>
- {% endif %}
- <div class="project-list grid-18">
- <b>Projects</b>
- <ul>
- {% for p in user.my_projects() %}
- {% if (c.user == user) or h.has_access(p, 'read') %}
- <li>
- <a class="project-name" href="{{p.url()}}">{{p.name}}</a>
- </li>
- {% endif %}
- {% endfor %}
- </ul>
- </div>
-
- <div class="grid-24">
- <div class="grid-24" style="margin:0;"><b>Personal data</b></div>
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Registration Date:</div>
- <div class="grid-8">{{reg_date}}</div>
- </div>
- {% if user.get_pref('sex') == 'Male' or user.get_pref('sex') == 'Female' %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Gender:</div>
- <div class="grid-8">{{user.get_pref('sex')}}</div>
- </div>
- {% endif %}
- {% if user.get_pref('birthdate') %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Birthdate:</div>
- <div class="grid-8">
- {{ user.get_pref('birthdate').strftime('%d %B %Y')}}
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('localization').country or user.get_pref('localization').city %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Localization:</div>
- <div class="grid-8">
- {% if user.get_pref('localization').city %}
- {{user.get_pref('localization').city}}{{ ',' if user.get_pref('localization').country else '' }}
- {% endif %}
- {% if user.get_pref('localization').country %}
- {{user.get_pref('localization').country}}
- {% endif %}
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('timezone') %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Timezone:</div>
- <div class="grid-8">
- {{user.get_pref('timezone')}}
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('socialnetworks')|length > 0 %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Social networks:</div>
- <div class="grid-18">
- {{user.get_pref('display_name')}}'s account(s):
- <ul>
- {% for i in user.get_pref('socialnetworks') %}
- <li>{{i.socialnetwork}}: <a href="{{i.accounturl}}">{{i.accounturl}}</a></li>
- {% endfor %}
- </ul>
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('webpages')|length > 0 %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Websites:</div>
- <div class="grid-18">
- {{user.get_pref('display_name')}}'s website(s):
- <ul>
- {% for i in user.get_pref('webpages') %}
- <li><a href="{{i}}">{{i}}</a></li>
- {% endfor %}
- </ul>
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('telnumbers')|length > 0 %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Telephone number(s):</div>
- <div class="grid-18">
- {{user.get_pref('display_name')}}'s telephone number(s):
- <ul>
- {% for i in user.get_pref('telnumbers') %}
- <li>{{i}}</li>
- {% endfor %}
- </ul>
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('skypeaccount') %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Skype account:</div>
- <div class="grid-8">{{user.get_pref('skypeaccount')}}</div>
- </div>
- {% endif %}
+{% block nav_menu %}{{super()}}{% endblock %}
- {% if user.get_pref('timezone') and user.get_availability_timeslots() |length > 0 %}
- <div class="grid-24" style="margin:0;">
- <div class="grid-4">Availability:</div>
-
- {% if c.user.get_pref('timezone') %}
- <div class="grid-18" id="timeslotsconverted" style="visibility: visible; display:none;">
- {{user.get_pref('display_name')}}'s availability time-slots.
- <div style="float:right;">
- See timeslots in:
- <a href="JavaScript:void(0);" onclick="changeTimezone('utc')">UTC</a> |
- <a href="JavaScript:void(0);" onclick="changeTimezone('local')">
- {{user.get_pref('display_name')}}'s local time
- </a> |
- <b>Your local time</b>
- </div>
- <ul>
- {% for i in user.get_localized_availability(c.user.get_pref('timezone')) %}
- <li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
-
- <div class="grid-18" id="timeslotsutc" style="visibility: visible; display:block;">
- {{user.get_pref('display_name')}}'s availability time-slots.
- <div style="float:right;">
- See timeslots in:
- <b>UTC</b> |
- <a href="JavaScript:void(0);" onclick="changeTimezone('local')">
- {{user.get_pref('display_name')}}'s local time
- </a>
- {% if c.user.get_pref('timezone') %} |
- <a href="JavaScript:void(0);" onclick="changeTimezone('converted')">
- Your local time
- </a>
- {% endif %}
- </div>
- <ul>
- {% for i in user.get_localized_availability('utc') %}
- <li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
- {% endfor %}
- </ul>
- </div>
-
- <div class="grid-18" id="timeslotslocal" style="visibility: visible; display:none;">
- {{user.get_pref('display_name')}}'s availability time-slots.
- <div style="float:right;">
- See timeslots in:
- <a href="JavaScript:void(0);" onclick="changeTimezone('utc')">UTC</a> |
- <b>
- {{user.get_pref('display_name')}}'s local time
- </b>
- {% if c.user.get_pref('timezone') %} |
- <a href="JavaScript:void(0);" onclick="changeTimezone('converted')">
- Your local time
- </a>
- {% endif %}
- </div>
- <ul>
- {% for i in user.get_availability_timeslots() %}
- <li>{{i.week_day}}: from {{i.start_time.strftime("%H:%M")}} to {{i.end_time.strftime("%H:%M")}} </li>
- {% endfor %}
- </ul>
- </div>
-
- </div>
- </div>
- {% endif %}
-
- {% if user.get_inactive_periods(include_past_periods=False)|length > 0 %}
- <div class="grid-24">
- <div class="grid-4">Inactive periods:</div>
- <div class="grid-18">
- This user won't be able to work on the forge in the following period(s):
- <ul>
- {% for p in user.get_inactive_periods(include_past_periods=False) %}
- <li>From {{p.start_date.strftime('%d %B %Y')}} to {{p.end_date.strftime('%d %B %Y')}}.</li>
- {% endfor %}
- </div>
- </div>
- {% endif %}
-
- {% if user.get_pref('email_address') and c.user.get_pref('email_address') and not user.get_pref('disable_user_messages') %}
- <div class="grid-24">
- <b><a href="send_message">Send me a message</a></b>
- </div>
- {% endif %}
- </div><!-- end of Personal data section -->
- <div class="grid-24">
- <b>Current {{user.get_pref('display_name')}}'s skills list</b>
- <div class="grid-24">
- {% if user.get_skills()|length > 0 %}
- <table>
- <thead>
- <tr>
- <th>Skill</th>
- <th>Level</th>
- <th>Comments</th>
- </tr>
- </thead>
- <tbody>
- {% for s in user.get_skills() %}
- <tr>
- <td>{{s.skill.fullpath}}</td>
- <td>{{s.level}}</td>
- <td>{{s.comment}}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% else %}
- <div class="grid-24">At the moment, {{user.get_pref('display_name')}}'s skills list is empty!</div>
- {% endif %}
- </div>
- </div>
-
- {% if c.user.username == user.username %}
- <div class="address-list grid-18">
- <b>Email Addresses</b>
- <ul>
- {% for email in user.email_addresses %}
- <li>
- {{lib.email_gravatar(email, size=24)}}
- {% if email == user.preferences.email_address %}
- <span class="prime email-address">{{email}}</span>
- {% else %}
- <span class="email-address">{{email}}</span>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
+{% block top_nav %}{# disabled #}{% endblock %}
+{% block content %}
{% for section in sections %}
{{ section.display() }}
{% endfor %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/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 1112aa8..01bb6b8 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -27,6 +27,8 @@ from tg import expose, redirect, validate, flash
import tg
from webob import exc
from jinja2 import Markup
+from pytz import timezone
+from datetime import datetime
from allura import version
from allura.app import Application, SitemapEntry
@@ -257,5 +259,35 @@ 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})
+ 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))
+
+
+class PersonalDataSection(ProfileSectionBase):
+ template = 'allura.ext.user_profile:templates/sections/personal-data.html'
+
+ def prepare_context(self, context):
+ context['timezone'] = self.user.get_pref('timezone')
+ if context['timezone']:
+ tz = timezone(context['timezone'])
+ context['timezone'] = tz.tzname(datetime.utcnow())
+ return context
+
+
+class ProjectsSection(ProfileSectionBase):
+ template = 'allura.ext.user_profile:templates/sections/projects.html'
+
+
+class SkillsSection(ProfileSectionBase):
+ template = 'allura.ext.user_profile:templates/sections/skills.html'
+
+
+class ToolsSection(ProfileSectionBase):
+ template = 'allura.ext.user_profile:templates/sections/tools.html'
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index ac54d13..83992aa 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -32,6 +32,7 @@ from datetime import datetime, timedelta
from collections import defaultdict
import shlex
import socket
+from functools import partial
import tg
import genshi.template
@@ -49,6 +50,7 @@ from tg.decorators import before_validate
from formencode.variabledecode import variable_decode
import formencode
from jinja2 import Markup
+from jinja2.filters import contextfilter
from paste.deploy.converters import asbool, aslist
from webhelpers import date, feedgenerator, html, number, misc, text
@@ -1154,3 +1156,27 @@ def login_overlay(exceptions=None):
if request.path.rstrip('/').endswith('/%s' % exception):
raise
c.show_login_overlay = True
+
+
+def get_filter(ctx, filter_name):
+ """
+ Gets a named Jinja2 filter, passing through
+ any context requested by the filter.
+ """
+ filter_ = ctx.environment.filters[filter_name]
+ if getattr(filter_, 'contextfilter', False):
+ return partial(filter_, ctx)
+ elif getattr(filter_, 'evalcontextfilter', False):
+ return partial(filter_, ctx.eval_ctx)
+ elif getattr(filter_, 'environmentfilter', False):
+ return partial(filter_, ctx.environment)
+
+
+@contextfilter
+def map_jinja_filter(ctx, seq, filter_name, *a, **kw):
+ """
+ A Jinja2 filter that applies the named filter with the
+ given args to the sequence this filter is applied to.
+ """
+ filter_ = get_filter(ctx, filter_name)
+ return [filter_(value, *a, **kw) for value in seq]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index cd0ed23..084501f 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -173,7 +173,7 @@ class AuthenticationProvider(object):
'alt': 'Manage Personal Information',
},
{
- 'tabid': 'account_sfnet_beta_index',
+ 'tabid': 'account_subscriptions',
'title': 'Subscriptions',
'target': "/auth/subscriptions",
'alt': 'Manage Subscription Preferences',
@@ -186,6 +186,10 @@ class AuthenticationProvider(object):
},
]
+ @LazyProperty
+ def account_urls(self):
+ return {m['tabid']: m['target'] for m in self.account_navigation()}
+
def user_project_shortname(self, user):
'''
:param user: a :class:`User <allura.model.auth.User>`
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/allura/templates/jinja_master/nav_menu.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/nav_menu.html b/Allura/allura/templates/jinja_master/nav_menu.html
index 4280881..b29d566 100644
--- a/Allura/allura/templates/jinja_master/nav_menu.html
+++ b/Allura/allura/templates/jinja_master/nav_menu.html
@@ -24,13 +24,21 @@
{% else %}
{{ theme_macros.breadcrumbs(c.project, c.app) }}
{{ theme_macros.project_header_right(c.project, c.app) }}
- {% if c.project.user_project_of %}
+ {% if c.project.is_user_project %}
{{lib.gravatar(c.project.user_project_of, size=48, className='project_icon')}}
{% elif c.project.icon %}
<img src="{{c.project.url()}}/icon?{{c.project.icon._id.generation_time}}" class="project_icon" alt="Project Logo">
{% endif %}
<h1 class="project_title">
- <a href="{{c.project.url()}}" class="project_link">{{ c.project.neighborhood.name if c.project.is_nbhd_project else c.project.name }}</a>
+ <a href="{{c.project.url()}}" class="project_link">
+ {%- if c.project.is_user_project -%}
+ {{ c.project.user_project_of.display_name }}
+ {%- elif c.project.is_nbhd_project -%}
+ {{ c.project.neighborhood.name }}
+ {%- else -%}
+ {{ c.project.name }}
+ {%- endif -%}
+ </a>
</h1>
{% set status = c.project.troves_by_type('developmentstatus')|sort(attribute='fullname') %}
{% set status = status[-1] %}
@@ -40,6 +48,7 @@
<h2 class="project_summary{% if c.project.icon %} with-icon{% endif %}">
{{c.project.summary}}
</h2>
+ {% if not c.project.is_user_project %}
<div class="brought-by{% if c.project.icon %} with-icon{% endif %}">
Brought to you by:
{% set admins = c.project.admins()|sort(attribute='username') %}
@@ -51,4 +60,5 @@
{% endif %}
{%- endfor -%}
</div>
+ {% endif %}
{% endif %}
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/Allura/setup.py
----------------------------------------------------------------------
diff --git a/Allura/setup.py b/Allura/setup.py
index 252328c..7d2d924 100644
--- a/Allura/setup.py
+++ b/Allura/setup.py
@@ -126,6 +126,12 @@ setup(
[allura.site_admin]
stats = allura.controllers.site_admin:StatsSiteAdminExtension
+ [allura.user_profile.sections]
+ personal-data = allura.ext.user_profile.user_main:PersonalDataSection
+ projects = allura.ext.user_profile.user_main:ProjectsSection
+ skills = allura.ext.user_profile.user_main:SkillsSection
+ tools = allura.ext.user_profile.user_main:ToolsSection
+
[paste.paster_command]
taskd = allura.command.taskd:TaskdCommand
taskd_cleanup = allura.command.taskd_cleanup:TaskdCleanupCommand
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/ForgeActivity/forgeactivity/main.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 269dbfc..e82cca7 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -255,7 +255,6 @@ class ForgeActivityProfileSection(ProfileSectionBase):
filtered_timeline = list(islice(ifilter(perm_check(c.user), full_timeline),
0, 5))
context.update({
- 'user': self.user,
'follow_toggle': W.follow_toggle,
'following': g.director.is_connected(c.user, self.user),
'timeline': filtered_timeline,
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bd978f79/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/templates/widgets/profile_section.html b/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
index 4e1bec2..5f2230e 100644
--- a/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
+++ b/ForgeActivity/forgeactivity/templates/widgets/profile_section.html
@@ -16,18 +16,24 @@
specific language governing permissions and limitations
under the License.
-#}
+{% extends "allura.ext.user_profile:templates/profile_section_base.html" %}
{% import 'allura:templates/jinja_master/lib.html' as lib with context %}
{% import 'forgeactivity:templates/macros.html' as am with context %}
-<div class="user-activity grid-8">
- <h3>
- User Activity
+{% block title %}
+ User Activity
+{% endblock %}
- {% if c.user and not c.user.is_anonymous() and c.user != user %}
- {{follow_toggle.display(following=following, action=activity_app.url+'follow')}}
- {% endif %}
- <a href="feed.rss" title="RSS"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}" title="Feed"></b></a>
- </h3>
+{% block actions %}
+ {% if c.user and not c.user.is_anonymous() and c.user != user %}
+ {{follow_toggle.display(following=following, action=activity_app.url+'follow')}}
+ {% endif %}
+ <a href="feed.rss" title="RSS"><b data-icon="{{g.icons['feed'].char}}" class="ico {{g.icons['feed'].css}}" title="Feed"></b></a>
+{% endblock %}
+
+{% block section_class %}user-activity{% endblock %}
+
+{% block content %}
{% if not timeline %}
<p class="empty">No activity to display.</p>
{% else %}
@@ -49,4 +55,4 @@
</ul>
<a class="view-all" href="{{activity_app.url}}">View All</a>
{% endif %}
-</div>
+{% endblock %}
[05/10] git commit: [#7097] List webpages on separate lines with less
truncation on User Profile
Posted by tv...@apache.org.
[#7097] List webpages on separate lines with less truncation 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/64ffd1d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/64ffd1d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/64ffd1d1
Branch: refs/heads/master
Commit: 64ffd1d1ab4b3c592d8a6aa2e2a295c343101bb1
Parents: 927580b
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Feb 14 15:26:48 2014 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Fri Feb 21 21:14:08 2014 +0000
----------------------------------------------------------------------
.../ext/user_profile/templates/sections/personal-data.html | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/64ffd1d1/Allura/allura/ext/user_profile/templates/sections/personal-data.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/sections/personal-data.html b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
index 3d2f2ef..81b9f69 100644
--- a/Allura/allura/ext/user_profile/templates/sections/personal-data.html
+++ b/Allura/allura/ext/user_profile/templates/sections/personal-data.html
@@ -52,7 +52,11 @@
{{user.get_pref('skypeaccount')}}
</dd>
<dt>Web Site{% if user.get_pref('webpages')|length > 1 %}s{% endif %}:</dt><dd>
- {{user.get_pref('webpages')|filter|map('urlize', 20, true)|join(', ')}}
+ <ol>
+ {% for webpage in user.get_pref('webpages') %}
+ <li>{{webpage|urlize(60)}}</li>
+ {% endfor %}
+ </ol>
</dd>
<dt>Availability (UTC):</dt><dd>
<ol>