Adnane Belmadiaf has proposed merging lp:~adnane002/loco-directory/fix.617920
into lp:loco-directory.
Requested reviews:
loco-directory-dev (loco-directory-dev)
Related bugs:
#617920 Include launchpad logos with launchpad users
https://bugs.launchpad.net/bugs/617920
For more details, see:
https://code.launchpad.net/~adnane002/loco-directory/fix.617920/+merge/44805
--
https://code.launchpad.net/~adnane002/loco-directory/fix.617920/+merge/44805
Your team loco-directory-dev is requested to review the proposed merge of
lp:~adnane002/loco-directory/fix.617920 into lp:loco-directory.
=== modified file 'loco_directory/templates/events/team_event_detail_attendees.inc.html'
--- loco_directory/templates/events/team_event_detail_attendees.inc.html 2010-11-12 11:26:24 +0000
+++ loco_directory/templates/events/team_event_detail_attendees.inc.html 2010-12-28 21:43:52 +0000
@@ -23,15 +23,17 @@
{% if team_event_object.attendee_set.all %}
<table id="team-event-attendees" class="data_table">
<tr>
+ <th></th>
<th>{% trans "Attendees" %}</th>
<th>{% trans "Registration Status" %}</th>
<th>{% trans "Additional Guests" %}</th>
</tr>
{% for registration in team_event_object.attendee_set.all %}
<tr class="team_event_list_row {% cycle "odd" "even" %}">
- <td align="center"><a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}">{{registration.attendee_profile.realname}}</a></td>
- <td align="center">{{registration.get_promise_display}}</td>
- <td align="center">{{registration.guests}}</td>
+ <td align="center" style="vertical-align: middle;"><a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}" >{% if registration.attendee_profile.mugshot %}<img src="{{registration.attendee_profile.mugshot}}" title="{{registration.attendee_profile.realname}}" valign="top" width="32" height="32">{% endif %}</a></td>
+ <td align="center" style="padding-top:10px;"><a href="https://launchpad.net/~{{registration.attendee_profile.user.username}}" >{{registration.attendee_profile.realname}}</a></td>
+ <td align="center" style="padding-top:10px;">{{registration.get_promise_display}}</td>
+ <td align="center" style="padding-top:10px;">{{registration.guests}}</td>
</tr>
{% endfor %}
</table>
=== modified file 'loco_directory/userprofiles/management/commands/update-profiles.py'
--- loco_directory/userprofiles/management/commands/update-profiles.py 2010-09-11 15:12:47 +0000
+++ loco_directory/userprofiles/management/commands/update-profiles.py 2010-12-28 21:43:52 +0000
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# -*- coding: utf-8 -*-
from django.core.management.base import NoArgsCommand
@@ -27,8 +28,12 @@
lp_user = lp.people[ld_user.username]
profile.tz = lp_user.time_zone or "UTC"
profile.realname = lp_user.display_name or user.username
+ if lp_user.logo_link.startswith("https://") :
+ profile.mugshot = lp_user.logo_link
+ else:
+ profile.mugshot = "https://launchpad.net/@@/person-logo"
profile.save()
except Exception, e:
- print "Error updaing %s" % ld_user
+ print "Error updating %s" % ld_user
print e
pass
=== added file 'loco_directory/userprofiles/migrations/0002_add_mugshot.py'
--- loco_directory/userprofiles/migrations/0002_add_mugshot.py 1970-01-01 00:00:00 +0000
+++ loco_directory/userprofiles/migrations/0002_add_mugshot.py 2010-12-28 21:43:52 +0000
@@ -0,0 +1,75 @@
+
+from south.db import db
+from django.db import models
+from userprofiles.models import *
+
+class Migration:
+
+ def forwards(self, orm):
+
+ # Adding field 'UserProfile.mugshot'
+ db.add_column('userprofiles_userprofile', 'mugshot', orm['userprofiles.userprofile:mugshot'])
+
+
+
+ def backwards(self, orm):
+
+ # Deleting field 'UserProfile.mugshot'
+ db.delete_column('userprofiles_userprofile', 'mugshot')
+
+
+
+ models = {
+ 'auth.group': {
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'unique_together': "(('content_type', 'codename'),)"},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ 'contenttypes.contenttype': {
+ 'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ },
+ 'userprofiles.userprofile': {
+ 'aim': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'blog': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+ 'facebook': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'flickr': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'identica': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'irc': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'mugshot': ('django.db.models.fields.URLField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),
+ 'picasa': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '150', 'blank': 'True'}),
+ 'twitter': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
+ 'tz': ('django.db.models.fields.CharField', [], {'default': "'UTC'", 'max_length': '32'}),
+ 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}),
+ 'xmpp': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'})
+ }
+ }
+
+ complete_apps = ['userprofiles']
=== modified file 'loco_directory/userprofiles/models.py'
--- loco_directory/userprofiles/models.py 2010-11-27 04:12:57 +0000
+++ loco_directory/userprofiles/models.py 2010-12-28 21:43:52 +0000
@@ -11,6 +11,7 @@
user = models.OneToOneField(auth_models.User)
realname = models.CharField(_("Real Name"), max_length=150, blank=True)
tz = models.CharField(verbose_name=_('Timezone'), max_length=32, default='UTC')
+ mugshot = models.URLField(verbose_name=_("Mugshot"), max_length=150, blank=True, verify_exists=False, null=True)
blog = models.URLField(verbose_name=_('Blog URL'), blank=True, null=True, verify_exists=False)
twitter = models.CharField(verbose_name=_('Twitter ID'), max_length=32, blank=True, null=True)
_______________________________________________
Mailing list: https://launchpad.net/~loco-directory-dev
Post to : [email protected]
Unsubscribe : https://launchpad.net/~loco-directory-dev
More help : https://help.launchpad.net/ListHelp