incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [4/7] git commit: [#7204] Added Social Networks user profile section
Date Tue, 04 Mar 2014 16:17:19 GMT
[#7204] Added Social Networks user profile section

Signed-off-by: Cory Johns <cjohns@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 <cjohns@slashdotmedia.com>
Authored: Fri Feb 28 23:14:48 2014 +0000
Committer: Cory Johns <cjohns@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


Mime
View raw message