Hi,

I'm sending you the patch file in this message.
I don't know if I made it correctly, I'm not an git expert.
Please make a test before using it.
I still have to do some fixes on user_detail.html.

Douglas



2010/9/27 Sylvain Beucler <b...@beuc.net>:
> Hi,
>
> Please prepare the patch using 'git format-patch' and send it to the
> list.
>
> We'll then see about giving you access to the repository directly.
>
> Thanks!
>
> - Sylvain
>
> On Sun, Sep 26, 2010 at 02:15:21AM -0300, Douglas Ferlini wrote:
>> Hi,
>>
>> I guess I almost finish this task.
>> There is some details from "Open Items submitted/assigned" that I need to 
>> fix.
>> How do you want me to send you the code? I've changed a few files on
>> the project, including css.
>>
>> Douglas
>>
>> 2010/9/22 Douglas Ferlini <douglasferl...@gmail.com>:
>> > Hi,
>> >
>> > Thanks, everything is more clear now.
>> > I'll keep working on it.
>> >
>> > Douglas
>> >
>> > 2010/9/22 Sylvain Beucler <b...@beuc.net>:
>> >> Hi,
>> >>
>> >> On Tue, Sep 21, 2010 at 05:13:01PM -0300, Douglas Ferlini wrote:
>> >>> Hi,
>> >>>
>> >>> I'm working improving the presentation.
>> >>> The attachment of this message is a print screen from how it looks
>> >>> like the user detail now.
>> >>
>> >> That looks good.
>> >>
>> >>> I have some questions.
>> >>> I guess I don't got it right the membership/groups part. The
>> >>> screen(http://savannah.gnu.org/users/Beuc) you sent me before shows
>> >>> Project/Group Information, how it's related to membership/groups
>> >>> exactly?
>> >>
>> >> First, there's no difference between "group" and "membership", it was
>> >> just a test to implement the same thing using 2 different ways.
>> >>
>> >> Basically:
>> >>
>> >> - Django provides the "User" and "Group" objects, and the
>> >>  'auth_user_groups' table for the ManyToMany relationship between
>> >>  them.
>> >>
>> >> - We need more information about users (such as their SSH keys), so we
>> >>  put them in SvUserInfo
>> >>
>> >> - We need more information about groups (such as the project
>> >>  description), so we put them in SvGroupInfo
>> >>
>> >> - We need more information about 'auth_user_groups' (such as the time
>> >>  the user joined the group, whether the membership is active or not
>> >>  approved yet, etc.), so we put them in SvMembership.
>> >>
>> >> So if you want to get the active memberships of a user, you can look
>> >> at 'auth_user_groups' (User.groups), or look at SvMemberships with
>> >> status 'active'.
>> >>
>> >> Ok?
>> >>
>> >>> Where I could find the info "Open Items Submitted" and "Open Items 
>> >>> Assigned"?
>> >>
>> >> The trackers are being implemented in the 'tracker' application.  You
>> >> probably need query the Item class.
>> >>
>> >> HTH
>> >>
>> >> - Sylvain
>> >>
>> >>> 2010/9/20 Douglas Ferlini <douglasferl...@gmail.com>:
>> >>> > Hi,
>> >>> >
>> >>> > Ok, I'll work on it.
>> >>> >
>> >>> > Douglas
>> >>> >
>> >>> > 2010/9/20 Sylvain Beucler <b...@beuc.net>:
>> >>> >> Hi,
>> >>> >>
>> >>> >> How about working on this part of the TODO?
>> >>> >>
>> >>> >>    [/] User page
>> >>> >>
>> >>> >>        [ ] Improve presentation
>> >>> >>            (mimic http://savannah.gnu.org/u/Beuc)
>> >>> >>
>> >>> >>        [ ] Display resume and skills
>> >>> >>
>> >>> >> - Sylvain
>> >>> >>
>> >>> >> On Mon, Sep 20, 2010 at 02:44:36AM -0300, Douglas Ferlini wrote:
>> >>> >>> Hi Sylvain,
>> >>> >>>
>> >>> >>> I think I've got the new version now, thanks.
>> >>> >>> I already took a look at the source and the TODO file.
>> >>> >>> What's my next task?
>> >>> >>>
>> >>> >>> Douglas
>> >>> >>>
>> >>> >>> 2010/9/19 Sylvain Beucler <b...@beuc.net>:
>> >>> >>> > Hi,
>> >>> >>> >
>> >>> >>> > Good to hear you completed the tutorial!
>> >>> >>> >
>> >>> >>> > You got the previous version.  Get the new source from the git
>> >>> >>> > repository.
>> >>> >>> >
>> >>> >>> > - Sylvain
>> >>> >>> >
>> >>> >>> > On Sun, Sep 19, 2010 at 07:37:11PM -0300, Douglas Ferlini wrote:
>> >>> >>> >> Hi Sylvain,
>> >>> >>> >>
>> >>> >>> >> I finished the tutorial that you sent me.
>> >>> >>> >> I've already downloaded the Savane source from svn.
>> >>> >>> >> I don't know if I got the right source, cause I don't saw it any 
>> >>> >>> >> python files.
>> >>> >>> >> I did not find the TODO file either.
>> >>> >>> >> I've got the source with "svn co 
>> >>> >>> >> svn://svn.gna.org/svn/savane/trunk savane".
>> >>> >>> >>
>> >>> >>> >> Douglas
>> >>> >>> >>
>> >>> >>> >> 2010/9/18 Douglas Ferlini <douglasferl...@gmail.com>:
>> >>> >>> >> > Hi Sylvain,
>> >>> >>> >> >
>> >>> >>> >> > I'm studying Django.
>> >>> >>> >> > Until now, I think it's very easy to use.
>> >>> >>> >> > I'm enjoying a lot, seriously.
>> >>> >>> >> >
>> >>> >>> >> > Douglas
>> >>> >>> >> >
>> >>> >>> >> >
>> >>> >>> >> > 2010/9/18 Sylvain Beucler <b...@beuc.net>:
>> >>> >>> >> >> Hi Douglas,
>> >>> >>> >> >>
>> >>> >>> >> >> How are you progressing so far?
>> >>> >>> >> >>
>> >>> >>> >> >> - Sylvain
>> >>> >>> >> >>
>> >>> >>> >> >> On Fri, Sep 17, 2010 at 11:01:20PM +0200, Sylvain Beucler 
>> >>> >>> >> >> wrote:
>> >>> >>> >> >>> Hi Douglas,
>> >>> >>> >> >>>
>> >>> >>> >> >>> The first thing you need to do is to follow the Django 
>> >>> >>> >> >>> tutorial:
>> >>> >>> >> >>> http://docs.djangoproject.com/en/dev/intro/tutorial01/
>> >>> >>> >> >>> This is necessary to understand the new Savane code, and it 
>> >>> >>> >> >>> should
>> >>> >>> >> >>> take you a couple days.
>> >>> >>> >> >>>
>> >>> >>> >> >>> Once you've completed it, download the new Savane source 
>> >>> >>> >> >>> code, and
>> >>> >>> >> >>> check the TODO file.  Then tell us here that you're ready, so 
>> >>> >>> >> >>> we can
>> >>> >>> >> >>> chose what you will work on.
>> >>> >>> >> >>>
>> >>> >>> >> >>> Hear from you soon!
>> >>> >>> >> >>>
>> >>> >>> >> >>> - Sylvain
>> >>> >>> >> >>>
>> >>> >>> >> >>> On Fri, Sep 17, 2010 at 05:51:44PM -0300, Douglas Ferlini 
>> >>> >>> >> >>> wrote:
>> >>> >>> >> >>> > My name is Douglas Ferlini,
>> >>> >>> >> >>> > I'm from Brazil.
>> >>> >>> >> >>> >
>> >>> >>> >> >>> > I'll probably graduate in Computer Science in the next 
>> >>> >>> >> >>> > year, here in
>> >>> >>> >> >>> > UnB(www.unb.br), Brazil.
>> >>> >>> >> >>> > I studied a lot of java technologies in the last five 
>> >>> >>> >> >>> > years, working
>> >>> >>> >> >>> > three years with it.
>> >>> >>> >> >>> > I worked with php for three years.
>> >>> >>> >> >>> > I started studying python a few years ago just for fun, but 
>> >>> >>> >> >>> > I didn't
>> >>> >>> >> >>> > developed a lot with it, so, I want to improve my knowledge 
>> >>> >>> >> >>> > in this
>> >>> >>> >> >>> > language.
>> >>> >>> >> >>> >
>> >>> >>> >> >>> > What I want in fact is to support free software ideals and 
>> >>> >>> >> >>> > spread.
>> >>> >>> >> >>> >
>> >>> >>> >> >>> > Douglas
>> >>> >>> >> >>> >
>> >>> >>> >> >>> > 2010/9/17 Sylvain Beucler <b...@gnu.org>:
>> >>> >>> >> >>> > > Hi,
>> >>> >>> >> >>> > >
>> >>> >>> >> >>> > > On Fri, Sep 17, 2010 at 12:25:02AM -0300, Douglas Ferlini 
>> >>> >>> >> >>> > > wrote:
>> >>> >>> >> >>> > >> I want to improve my python skills joining SavaneRewrite 
>> >>> >>> >> >>> > >> .
>> >>> >>> >> >>> > >
>> >>> >>> >> >>> > > And you did right, great idea! :)
>> >>> >>> >> >>> > >
>> >>> >>> >> >>> > > Can you tell us more about you, your background and your 
>> >>> >>> >> >>> > > areas of
>> >>> >>> >> >>> > > interests in Savane?
>> >>> >>> >> >>> > >
>> >>> >>> >> >>> > > We'll then assign you a task that is best suited to you.
>> >>> >>> >> >>> > >
>> >>> >>> >> >>> > > --
>> >>> >>> >> >>> > > Sylvain
>
From 9a34c3e754d98f459e6a66fe92313895f8d7f12f Mon Sep 17 00:00:00 2001
From: douglasferlini <douglasferl...@gmail.com>
Date: Thu, 30 Sep 2010 11:19:51 -0300
Subject: [PATCH 344/344] Task: User page - Improve presentation, Display resume and skills

---
 savane/svmain/urls.py             |    8 ++
 savane/svmain/views.py            |   35 +++++++++
 savane/svpeople/models.py         |    2 +-
 static_media/savane/css/main.css  |    6 ++
 templates/svmain/user_detail.html |  151 +++++++++++++++++++++++++++++--------
 5 files changed, 170 insertions(+), 32 deletions(-)

diff --git a/savane/svmain/urls.py b/savane/svmain/urls.py
index a33adae..e9f5012 100644
--- a/savane/svmain/urls.py
+++ b/savane/svmain/urls.py
@@ -69,6 +69,14 @@ urlpatterns += patterns ('',
         'extra_context' : { 'title' : _("User detail") },
         'template_name' : 'svmain/user_detail.html', },
       name='user_detail'),
+  url(r'^u/skills/(?P<slug>[-\w]+)/$', object_detail,
+      { 'queryset' : auth_models.User.objects.all(),
+        'slug_field' : 'username',
+        'extra_context' : { 'title' : _("Resume and Skills") },
+        'template_name' : 'svmain/user_resume_skills.html', },
+      name='resume_skills'),
+  url(r'^u/gpg/(?P<slug>[-\w]+)/$', views.user_gpgkeyring_download,
+      name='gpgkey'),
   url(r'^us/(?P<slug>[-\w]+)/$', views.user_redir),
   url(r'^users/(?P<slug>[-\w]+)/?$', views.user_redir),
 )
diff --git a/savane/svmain/views.py b/savane/svmain/views.py
index 9eb9b4b..a637dcc 100644
--- a/savane/svmain/views.py
+++ b/savane/svmain/views.py
@@ -115,6 +115,39 @@ def group_join(request, slug):
         messages.success(request, _("Request for inclusion sent to project administrators"))
     return HttpResponseRedirect('../')
 
+def user_gpgkeyring_download(request, slug):
+    """
+    Generate a GPG binary keyring
+    """
+    user = get_object_or_404(auth_models.User, username=slug)
+
+    import os, sys, tempfile, shutil, glob
+    from pyme import core, constants
+    # Don't be fooled by the library-like look of pyme - internaly it
+    # just invokes command-line 'gpg'.  There's no "gpg library".
+    tdir = tempfile.mkdtemp()
+    core.set_engine_info(constants.PROTOCOL_OpenPGP, None, tdir)
+    c = core.Context()
+
+    status = c.op_import(core.Data(str(user.svuserinfo.gpg_key)))
+    result = c.op_import_result()
+
+    data_export = core.Data()
+    c.op_export(None, 0, data_export)
+    data_export.seek(0, os.SEEK_SET)
+    keyring_txt = data_export.read()
+
+    response = HttpResponse()
+    response = HttpResponse(mimetype='application/pgp-keys')
+    response['Content-Disposition'] = 'attachment; filename=%s-keyring.gpg' % user.username
+    response['Content-Description'] = _("GPG Keyring of the user %s") % user.username
+
+    response.write(keyring_txt)
+
+    shutil.rmtree(tdir)
+
+    return response
+
 @render_to('svmain/group_gpgkeyring.html')
 def group_gpgkeyring(request, slug, extra_context={}):
     """
@@ -344,3 +377,5 @@ def group_mailinglist(request, slug, extra_context={}):
                        queryset=queryset,
                        extra_context=context,
                        template_name='svmain/group_mailinglist.html')
+
+
diff --git a/savane/svpeople/models.py b/savane/svpeople/models.py
index d068acf..d349af7 100644
--- a/savane/svpeople/models.py
+++ b/savane/svpeople/models.py
@@ -125,7 +125,7 @@ class SkillInventory(models.Model):
     class Meta:
         verbose_name = _("skill inventory")
         verbose_name_plural = _("skill inventories")
-    user = models.ForeignKey(auth_models.User)
+    user = models.ForeignKey(auth_models.User,  blank=True, null=True, related_name='skills')
     skill = models.ForeignKey(Skill)
     skill_level = models.ForeignKey(SkillLevel)
     skill_year = models.ForeignKey(SkillYear)
diff --git a/static_media/savane/css/main.css b/static_media/savane/css/main.css
index 8ce7015..da9bf56 100644
--- a/static_media/savane/css/main.css
+++ b/static_media/savane/css/main.css
@@ -282,6 +282,12 @@ h3 a {
 	display: block;
 }
 
+h3 {
+	text-indent: 1em;
+	border-bottom: thin solid #e0c080;
+	background-color: #fff0d0; 
+}
+
 h5 a {
 	display: block;
 }
diff --git a/templates/svmain/user_detail.html b/templates/svmain/user_detail.html
index 4e916d5..2c08007 100644
--- a/templates/svmain/user_detail.html
+++ b/templates/svmain/user_detail.html
@@ -1,39 +1,128 @@
 {% extends "base.html" %}
 {% load i18n %}
 
-{% block content %}
+{% block title %}
+{% blocktrans %}People at {{site_name}}{% endblocktrans %}{% trans ": " %}{{object.first_name}} {{object.last_name}}
+{% endblock %}
+
+{% block icon %}people{% endblock %}
 
+{% block content %}
 <p>
-{% trans "Real name:" %} {{object.first_name}} {{object.last_name}}</p>
-{% trans "Login name:" %} {{object.username}}<br />
-
-<p>Is a member of (using Django user.groups):</p>
-
-{% if object.groups.all %}
-<ul>
-  {% for group in object.groups.all %}
-  <li>
-    <a href="{% url savane:svmain:group_detail group.name %}">{{ group.name }}</a>
-  </li>
-  {% endfor %}
-  </ul>
-{% else %}
-  Not part of any group yet
-{% endif %}
-
-<p>Is a member of (using Membership):</p>
-
-{% if object.membership_set.all %}
-<ul>
-  {% for membership in object.membership_set.all %}
-  <li>
-    <a href="{% url savane:svmain:group_detail membership.group.name %}">{{ membership.group.name }}</a> - with flags: {{ membership.admin_flags}}
-  </li>
-  {% endfor %}
-  </ul>
-{% else %}
-  Not part of any group yet
-{% endif %}
+	{% trans "Follows the Profile of:" %}
+	<a href="/u/{{object.username}}">{{object.first_name}} {{object.last_name}}</a>
+</p>
+
+<div class="splitright">
+	<div class="box">
+		<div class="boxtitle">{% trans "Open Items submitted by" %} {{object.first_name}} {{object.last_name}}</div><!-- end boxtitle -->
+		{% if object.items_submitted.all %}
+			{% for items in object.items_submitted.all %}
+				{% ifchanged %}
+					<div class="boxitem"> {{items.group.name}}: </div>
+				{% endifchanged %}
+				<div class="priora"><a class="block" href="/task/?3443">
+					<img alt="help" class="icon" src="{{STATIC_MEDIA_URL}}savane/images/common/contexts1/help.orig.png"> 
+						{{items.summary}}<span class="xsmall">(#{{items.internal_id}} , {{items.status}})</span></a>
+				</div>
+			{% endfor %}
+		{% else %}
+			{% trans "None found" %}
+		{% endif %}
+     </div><!-- end box -->
+<br>
+     <div class="box">
+       <div class="boxtitle">{% trans "Open Items assigned to" %} {{object.first_name}} {{object.last_name}}</div><!-- end boxtitle -->
+		{% trans "None found" %}
+     </div><!-- end box -->
+
+</div>
+<div class="splitleft">
+	<div class="box">
+		<div class="boxtitle">{% trans "General Information" %}</div><!-- end boxtitle -->
+		<div class="boxitem">
+			<br>
+			<table cellspacing="0" cellpadding="0" border="0" width="100%">
+				<tbody>
+					<tr valign="top">
+						<td>{% trans "Real name:" %}</td>
+						<td><strong>{{object.first_name}} {{object.last_name}}</strong></td>
+					</tr>
+					<tr valign="top">
+						<td>{% trans "Login name:" %} </td>
+						<td><strong>{{object.username}}</strong></td>
+					</tr>
+					<tr valign="top">
+						<td>{% trans "Id:" %} </td>
+						<td><strong>#{{object.id}}</strong></td>
+					</tr>
+					   <tr valign="top">
+						<td>{% trans "Email Address:" %}  </td>
+						<td>
+						{% if object.svuserinfo.email_hide == 0 %}
+							<strong><a href="mailto:{{object.email}}">{{object.email}}</a></strong>
+						{% else %}
+							<strong>{% trans "Unavaliable" %} </strong>
+						{% endif %}
+						</td>
+					</tr>
+					<tr valign="top">
+						<td>{% trans "Site Member Since:" %}
+						</td>
+						<td>
+							<strong>{{object.date_joined|date:"D M d H:m:s Y"}}</strong>
+						</td>
+					</tr>
+					<tr valign="top">
+						<td></td>
+						{% if object.svpeopleuserinfo != "" %}			 
+							<td><a href="{% url savane:svmain:resume_skills object.username %}"><strong>{% trans "View Resume and Skills" %}</strong></a></td>
+						{% else %}
+						 <td>This user did not enable his/her Resume &amp; Skills.</td>
+						{% endif %}
+					</tr>
+					<tr valign="top"><td></td><td><a href="{% url savane:svmain:gpgkey object.username %}"><strong>Download GPG Key</strong></a></td></tr>
+				</tbody>
+			</table>
+		</div>
+		<!-- end boxitem -->
+	</div>
+
+
+	<!--div class="box">
+		<div class="boxtitle">{% trans "Group Information" %}</div>
+			{% if object.groups.all %}
+			<ul class="boxli">
+				{% for group in object.groups.all %}
+				<li class="{% cycle 'boxitem' 'boxitemalt' %}"><a href="{% url savane:svmain:group_detail group.name %}">{{ group.name }}</a>
+				</li>
+				{% endfor %}
+			</ul>
+			{% else %}
+			  {% trans "Not part of any group yet" %}
+			{% endif %}
+	</div-->
+
+	<div class="box">
+		<div class="boxtitle">{% trans "Project/Group Information" %}</div>
+			{% if object.membership_set.all %}
+			<ul class="boxli">
+				{% for membership in object.membership_set.all %}
+					<li class="{% cycle 'boxitem' 'boxitemalt' %}">
+						<a href="{% url savane:svmain:group_detail membership.group.name %}">{{ membership.group.name }}</a>
+						<!-- - with flags: {{ membership.admin_flags}} -->
+						<br><span class="smaller">{% trans "Member since" %} {{membership.since}}</span>
+					</li>
+				{% endfor %}
+			</ul>
+			{% else %}
+			  {% trans "Not part of any project yet" %}
+			{% endif %}
+	</div>
+
+</div>
+
+
 
 {% endblock %}
 
-- 
1.7.0.4

_______________________________________________
Savane-dev mailing list
Savane-dev@gna.org
https://mail.gna.org/listinfo/savane-dev

Reply via email to