mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
avatars can be displayed as gallery now
This commit is contained in:
parent
cc5427ef80
commit
d3e98504c8
7 changed files with 296 additions and 91 deletions
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-03-16 15:19+0100\n"
|
||||
"POT-Creation-Date: 2011-03-28 10:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -17,7 +17,7 @@ msgstr ""
|
|||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
|
||||
|
||||
#: forms.py:33
|
||||
#: forms.py:34
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%(ext)s is an invalid file extension. Authorized extensions are : %"
|
||||
|
|
@ -26,7 +26,7 @@ msgstr ""
|
|||
"%(ext)s ist ein ungültiges Dateiformat. Erlaubte Formate sind: %"
|
||||
"(valid_exts_list)s"
|
||||
|
||||
#: forms.py:37
|
||||
#: forms.py:38
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Your file is too big (%(size)s), the maximum allowed size is %"
|
||||
|
|
@ -34,7 +34,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Die Datei ist zu groß (%(size)s), die Maximalgröße ist %(max_valid_size)s"
|
||||
|
||||
#: forms.py:43
|
||||
#: forms.py:44
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You already have %(nb_avatars)d avatars, and the maximum allowed is %"
|
||||
|
|
@ -43,16 +43,20 @@ msgstr ""
|
|||
"Sie haben bereits %(nb_avatars)d Avatarbilder hochgeladen. Das maximale "
|
||||
"Anzahl ist %(nb_max_avatars)d."
|
||||
|
||||
#: models.py:71
|
||||
#: forms.py:56 forms.py:67
|
||||
msgid "Choices"
|
||||
msgstr ""
|
||||
|
||||
#: models.py:75
|
||||
#, python-format
|
||||
msgid "Avatar for %s"
|
||||
msgstr "Avatar für %s"
|
||||
|
||||
#: views.py:90
|
||||
#: views.py:73 views.py:95
|
||||
msgid "Successfully uploaded a new avatar."
|
||||
msgstr "Erfolgreich einen neuen Avatar hochgeladen."
|
||||
|
||||
#: views.py:128
|
||||
#: views.py:132
|
||||
msgid "Successfully updated your avatar."
|
||||
msgstr "Erfolgreich Ihren Avatar aktualisiert."
|
||||
|
||||
|
|
@ -60,22 +64,6 @@ msgstr "Erfolgreich Ihren Avatar aktualisiert."
|
|||
msgid "Successfully deleted the requested avatars."
|
||||
msgstr "Erfolgreich den Avatar gelöscht."
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "Avatar Updated"
|
||||
msgstr "Avatar aktualisiert"
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "your avatar has been updated"
|
||||
msgstr "Ihr Avatar wurde aktualisiert"
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "Friend Updated Avatar"
|
||||
msgstr "Freund aktualisierte Avatar"
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "a friend has updated their avatar"
|
||||
msgstr "Avatar eines Freundes wurde aktualisiert"
|
||||
|
||||
#: templates/avatar/add.html:5 templates/avatar/change.html:5
|
||||
msgid "Your current avatar: "
|
||||
msgstr "Ihr aktueller Avatar: "
|
||||
|
|
@ -110,6 +98,16 @@ msgstr ""
|
|||
msgid "Delete These"
|
||||
msgstr "Auswahl löschen"
|
||||
|
||||
#: templates/notification/avatar_friend_updated/full.txt:1
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"%(avatar_creator)s has updated their avatar %(avatar)s.\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> hat den Avatar aktualisiert "
|
||||
"<a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notification/avatar_friend_updated/notice.html:2
|
||||
#, python-format
|
||||
msgid ""
|
||||
|
|
@ -119,6 +117,14 @@ msgstr ""
|
|||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> hat den Avatar aktualisiert "
|
||||
"<a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notification/avatar_updated/full.txt:1
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Your avatar has been updated. %(avatar)s\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
|
||||
#: templates/notification/avatar_updated/notice.html:2
|
||||
#, python-format
|
||||
msgid "You have updated your avatar <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
|
@ -126,6 +132,18 @@ msgstr ""
|
|||
"Sie haben Ihren Avatar aktualisiert <a href=\"%(avatar_url)s\">%(avatar)s</"
|
||||
"a>."
|
||||
|
||||
#: templatetags/avatar_tags.py:40
|
||||
#: templatetags/avatar_tags.py:45
|
||||
msgid "Default Avatar"
|
||||
msgstr "Standard-Avatar"
|
||||
|
||||
#~ msgid "Avatar Updated"
|
||||
#~ msgstr "Avatar aktualisiert"
|
||||
|
||||
#~ msgid "your avatar has been updated"
|
||||
#~ msgstr "Ihr Avatar wurde aktualisiert"
|
||||
|
||||
#~ msgid "Friend Updated Avatar"
|
||||
#~ msgstr "Freund aktualisierte Avatar"
|
||||
|
||||
#~ msgid "a friend has updated their avatar"
|
||||
#~ msgstr "Avatar eines Freundes wurde aktualisiert"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-03-26 18:29+0100\n"
|
||||
"POT-Creation-Date: 2011-03-28 10:59+0200\n"
|
||||
"PO-Revision-Date: 2010-03-26 18:35+0100\n"
|
||||
"Last-Translator: Mathieu Pillard <m.pillard@liberation.fr>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -15,31 +15,47 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: forms.py:33
|
||||
#: forms.py:34
|
||||
#, python-format
|
||||
msgid "%(ext)s is an invalid file extension. Authorized extensions are : %(valid_exts_list)s"
|
||||
msgstr "%(ext)s n'est pas une extension de fichier valide. Les extensions autorisées sont: %(valid_exts_list)s"
|
||||
msgid ""
|
||||
"%(ext)s is an invalid file extension. Authorized extensions are : %"
|
||||
"(valid_exts_list)s"
|
||||
msgstr ""
|
||||
"%(ext)s n'est pas une extension de fichier valide. Les extensions autorisées "
|
||||
"sont: %(valid_exts_list)s"
|
||||
|
||||
#: forms.py:37
|
||||
#: forms.py:38
|
||||
#, python-format
|
||||
msgid "Your file is too big (%(size)s), the maximum allowed size is %(max_valid_size)s"
|
||||
msgstr "Le fichier est trop gros (%(size)s), la taille maximum autorisée est %(max_valid_size)s"
|
||||
msgid ""
|
||||
"Your file is too big (%(size)s), the maximum allowed size is %"
|
||||
"(max_valid_size)s"
|
||||
msgstr ""
|
||||
"Le fichier est trop gros (%(size)s), la taille maximum autorisée est %"
|
||||
"(max_valid_size)s"
|
||||
|
||||
#: forms.py:43
|
||||
#: forms.py:44
|
||||
#, python-format
|
||||
msgid "You already have %(nb_avatars)d avatars, and the maximum allowed is %(nb_max_avatars)d."
|
||||
msgstr "Vous avez déjà %(nb_avatars)d avatars, et le maximum autorisé est %(nb_max_avatars)d."
|
||||
msgid ""
|
||||
"You already have %(nb_avatars)d avatars, and the maximum allowed is %"
|
||||
"(nb_max_avatars)d."
|
||||
msgstr ""
|
||||
"Vous avez déjà %(nb_avatars)d avatars, et le maximum autorisé est %"
|
||||
"(nb_max_avatars)d."
|
||||
|
||||
#: models.py:72
|
||||
#: forms.py:56 forms.py:67
|
||||
msgid "Choices"
|
||||
msgstr ""
|
||||
|
||||
#: models.py:75
|
||||
#, python-format
|
||||
msgid "Avatar for %s"
|
||||
msgstr "Avatar pour %s"
|
||||
|
||||
#: views.py:90
|
||||
#: views.py:73 views.py:95
|
||||
msgid "Successfully uploaded a new avatar."
|
||||
msgstr "Votre nouveau avatar a été uploadé avec succès."
|
||||
|
||||
#: views.py:128
|
||||
#: views.py:132
|
||||
msgid "Successfully updated your avatar."
|
||||
msgstr "Votre avatar a été mis à jour avec succès."
|
||||
|
||||
|
|
@ -47,34 +63,15 @@ msgstr "Votre avatar a été mis à jour avec succès."
|
|||
msgid "Successfully deleted the requested avatars."
|
||||
msgstr "Les avatars sélectionnés ont été effacés avec succès."
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "Avatar Updated"
|
||||
msgstr "Avatar mis à jour"
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "your avatar has been updated"
|
||||
msgstr "votre avatar a été mis à jour"
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "Friend Updated Avatar"
|
||||
msgstr "Avatar mis à jour par un ami"
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "a friend has updated their avatar"
|
||||
msgstr "un ami a mis à jour son avatar"
|
||||
|
||||
#: templates/avatar/add.html:5
|
||||
#: templates/avatar/change.html:5
|
||||
#: templates/avatar/add.html:5 templates/avatar/change.html:5
|
||||
msgid "Your current avatar: "
|
||||
msgstr "Votre avatar actuel:"
|
||||
|
||||
#: templates/avatar/add.html:8
|
||||
#: templates/avatar/change.html:8
|
||||
#: templates/avatar/add.html:8 templates/avatar/change.html:8
|
||||
msgid "You haven't uploaded an avatar yet. Please upload one now."
|
||||
msgstr "Vous n'avez pas encore ajouté d'avatar. Veuillez le faire maintenant."
|
||||
|
||||
#: templates/avatar/add.html:12
|
||||
#: templates/avatar/change.html:19
|
||||
#: templates/avatar/add.html:12 templates/avatar/change.html:19
|
||||
msgid "Upload New Image"
|
||||
msgstr "Ajouter une nouvelle image"
|
||||
|
||||
|
|
@ -88,24 +85,61 @@ msgstr "Veuillez sélectionner les avatars que vous souhaitez effacer"
|
|||
|
||||
#: templates/avatar/confirm_delete.html:8
|
||||
#, python-format
|
||||
msgid "You have no avatars to delete. Please <a href=\"%(avatar_change_url)s\">upload one</a> now."
|
||||
msgstr "Vous n'avez aucun avatar à effacer. Veuillez en <a href=\"%(avatar_change_url)s\">ajouter</a> un maintenant."
|
||||
msgid ""
|
||||
"You have no avatars to delete. Please <a href=\"%(avatar_change_url)s"
|
||||
"\">upload one</a> now."
|
||||
msgstr ""
|
||||
"Vous n'avez aucun avatar à effacer. Veuillez en <a href=\"%"
|
||||
"(avatar_change_url)s\">ajouter</a> un maintenant."
|
||||
|
||||
#: templates/avatar/confirm_delete.html:14
|
||||
msgid "Delete These"
|
||||
msgstr "Effacer"
|
||||
|
||||
#: templates/notification/avatar_friend_updated/full.txt:1
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"%(avatar_creator)s has updated their avatar %(avatar)s.\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> a mis à jour son avatar <a "
|
||||
"href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notification/avatar_friend_updated/notice.html:2
|
||||
#, python-format
|
||||
msgid "<a href=\"%(user_url)s\">%(avatar_creator)s</a> has updated their avatar <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgstr "<a href=\"%(user_url)s\">%(avatar_creator)s</a> a mis à jour son avatar <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgid ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> has updated their avatar <a "
|
||||
"href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> a mis à jour son avatar <a "
|
||||
"href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notification/avatar_updated/full.txt:1
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Your avatar has been updated. %(avatar)s\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
|
||||
#: templates/notification/avatar_updated/notice.html:2
|
||||
#, python-format
|
||||
msgid "You have updated your avatar <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgstr "Vous avez mis à jour votre <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templatetags/avatar_tags.py:40
|
||||
#: templatetags/avatar_tags.py:45
|
||||
msgid "Default Avatar"
|
||||
msgstr "Avatar par défaut"
|
||||
|
||||
#~ msgid "Avatar Updated"
|
||||
#~ msgstr "Avatar mis à jour"
|
||||
|
||||
#~ msgid "your avatar has been updated"
|
||||
#~ msgstr "votre avatar a été mis à jour"
|
||||
|
||||
#~ msgid "Friend Updated Avatar"
|
||||
#~ msgstr "Avatar mis à jour par un ami"
|
||||
|
||||
#~ msgid "a friend has updated their avatar"
|
||||
#~ msgstr "un ami a mis à jour son avatar"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-08-09 04:13-0300\n"
|
||||
"POT-Creation-Date: 2011-03-28 10:59+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -16,53 +16,131 @@ msgstr ""
|
|||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: models.py:32
|
||||
#: forms.py:34
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%(ext)s is an invalid file extension. Authorized extensions are : %"
|
||||
"(valid_exts_list)s"
|
||||
msgstr ""
|
||||
|
||||
#: forms.py:38
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Your file is too big (%(size)s), the maximum allowed size is %"
|
||||
"(max_valid_size)s"
|
||||
msgstr ""
|
||||
|
||||
#: forms.py:44
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You already have %(nb_avatars)d avatars, and the maximum allowed is %"
|
||||
"(nb_max_avatars)d."
|
||||
msgstr ""
|
||||
|
||||
#: forms.py:56 forms.py:67
|
||||
msgid "Choices"
|
||||
msgstr ""
|
||||
|
||||
#: models.py:75
|
||||
#, python-format
|
||||
msgid "Avatar for %s"
|
||||
msgstr "Avatar para %s"
|
||||
|
||||
#: views.py:68
|
||||
#: views.py:73 views.py:95
|
||||
msgid "Successfully uploaded a new avatar."
|
||||
msgstr "Nova foto de perfil enviada com sucesso."
|
||||
|
||||
#: views.py:76
|
||||
#: views.py:132
|
||||
msgid "Successfully updated your avatar."
|
||||
msgstr "Sua foto de perfil foi atualizada com sucesso."
|
||||
|
||||
#: views.py:114
|
||||
#: views.py:166
|
||||
msgid "Successfully deleted the requested avatars."
|
||||
msgstr "As fotos de perfil selecionadas foram excluídas com sucesso."
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "Avatar Updated"
|
||||
msgstr "Foto de Perfil Atualizada"
|
||||
#: templates/avatar/add.html:5 templates/avatar/change.html:5
|
||||
msgid "Your current avatar: "
|
||||
msgstr ""
|
||||
|
||||
#: management/__init__.py:9
|
||||
msgid "avatar have been updated"
|
||||
msgstr "foto de perfil foi atualizada"
|
||||
#: templates/avatar/add.html:8 templates/avatar/change.html:8
|
||||
msgid "You haven't uploaded an avatar yet. Please upload one now."
|
||||
msgstr ""
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "Friend Updated Avatar"
|
||||
msgstr "Amigo Atualizou Foto de Perfil"
|
||||
#: templates/avatar/add.html:12 templates/avatar/change.html:19
|
||||
msgid "Upload New Image"
|
||||
msgstr ""
|
||||
|
||||
#: management/__init__.py:10
|
||||
msgid "a friend has updated his avatar"
|
||||
msgstr "um amigo atualizou a foto de perfil"
|
||||
#: templates/avatar/change.html:14
|
||||
msgid "Choose new Default"
|
||||
msgstr ""
|
||||
|
||||
#: templates/notifications/avatar_friend_updated/notice.html:2
|
||||
#: templates/avatar/confirm_delete.html:5
|
||||
msgid "Please select the avatars that you would like to delete."
|
||||
msgstr ""
|
||||
|
||||
#: templates/avatar/confirm_delete.html:8
|
||||
#, python-format
|
||||
msgid ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> has updated his avatar <a "
|
||||
"You have no avatars to delete. Please <a href=\"%(avatar_change_url)s"
|
||||
"\">upload one</a> now."
|
||||
msgstr ""
|
||||
|
||||
#: templates/avatar/confirm_delete.html:14
|
||||
msgid "Delete These"
|
||||
msgstr ""
|
||||
|
||||
#: templates/notification/avatar_friend_updated/full.txt:1
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"%(avatar_creator)s has updated their avatar %(avatar)s.\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> atualizou a foto de perfil "
|
||||
"<a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notification/avatar_friend_updated/notice.html:2
|
||||
#, fuzzy, python-format
|
||||
msgid ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> has updated their avatar <a "
|
||||
"href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> atualizou a foto de perfil <a "
|
||||
"href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> atualizou a foto de perfil "
|
||||
"<a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templates/notifications/avatar_updated/notice.html:2
|
||||
#: templates/notification/avatar_updated/full.txt:1
|
||||
#, python-format
|
||||
msgid "A new tribe <a href=\"%(avatar_url)s\">%(avatar)s</a> has been created."
|
||||
msgstr "Uma nova foto de perfil <a href=\"%(avatar_url)s\">%(avatar)s</a> foi criada."
|
||||
msgid ""
|
||||
"Your avatar has been updated. %(avatar)s\n"
|
||||
"\n"
|
||||
"http://%(current_site)s%(avatar_url)s\n"
|
||||
msgstr ""
|
||||
|
||||
#: templatetags/avatar_tags.py:47
|
||||
#: templates/notification/avatar_updated/notice.html:2
|
||||
#, fuzzy, python-format
|
||||
msgid "You have updated your avatar <a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
msgstr ""
|
||||
"<a href=\"%(user_url)s\">%(avatar_creator)s</a> atualizou a foto de perfil "
|
||||
"<a href=\"%(avatar_url)s\">%(avatar)s</a>."
|
||||
|
||||
#: templatetags/avatar_tags.py:45
|
||||
msgid "Default Avatar"
|
||||
msgstr "Foto de Perfil Padrão"
|
||||
|
||||
#~ msgid "Avatar Updated"
|
||||
#~ msgstr "Foto de Perfil Atualizada"
|
||||
|
||||
#~ msgid "avatar have been updated"
|
||||
#~ msgstr "foto de perfil foi atualizada"
|
||||
|
||||
#~ msgid "Friend Updated Avatar"
|
||||
#~ msgstr "Amigo Atualizou Foto de Perfil"
|
||||
|
||||
#~ msgid "a friend has updated his avatar"
|
||||
#~ msgstr "um amigo atualizou a foto de perfil"
|
||||
|
||||
#~ msgid ""
|
||||
#~ "A new tribe <a href=\"%(avatar_url)s\">%(avatar)s</a> has been created."
|
||||
#~ msgstr ""
|
||||
#~ "Uma nova foto de perfil <a href=\"%(avatar_url)s\">%(avatar)s</a> foi "
|
||||
#~ "criada."
|
||||
|
|
|
|||
10
avatar/templates/avatar/avatar.html
Normal file
10
avatar/templates/avatar/avatar.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><!-- Insert your title here --></title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Insert your content here -->
|
||||
</body>
|
||||
</html>
|
||||
10
avatar/templates/avatar/gallery.html
Normal file
10
avatar/templates/avatar/gallery.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><!-- Insert your title here --></title>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Insert your content here -->
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -5,5 +5,8 @@ urlpatterns = patterns('avatar.views',
|
|||
url('^webcam-upload/(?P<id>\d+)', 'webcam_upload', name='avatar-webcam-upload'),
|
||||
url('^change/$', 'change', name='avatar_change'),
|
||||
url('^delete/$', 'delete', name='avatar_delete'),
|
||||
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_primary', name='avatar_render_primary'),
|
||||
url('^render_primary/(?P<user>[\+\w]+)/(?P<size>[\d]+)/$', 'render_primary', name='avatar_render_primary'),
|
||||
|
||||
url('^list/(?P<username>[\+\w]+)/$', 'avatar_gallery', name='avatar_gallery'),
|
||||
url('^list/(?P<username>[\+\w]+)/(?P<id>[\d]+)/$', 'avatar', name='avatar'),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from django.http import HttpResponseRedirect, HttpResponse
|
||||
from django.http import HttpResponseRedirect, HttpResponse, Http404
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
from django.utils.translation import ugettext as _
|
||||
|
|
@ -177,6 +177,58 @@ def delete(request, extra_context=None, next_override=None, *args, **kwargs):
|
|||
)
|
||||
)
|
||||
|
||||
|
||||
def avatar_gallery(request, username, template_name="avatar/gallery.html"):
|
||||
user = get_object_or_404(User, username=username)
|
||||
return render_to_response(template_name, {
|
||||
"other_user": user,
|
||||
"avatars": user.avatar_set.all(),
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def avatar(request, username, id, template_name="avatar/avatar.html"):
|
||||
user = get_object_or_404(User, username=username)
|
||||
avatars = user.avatar_set.order_by("-date_uploaded")
|
||||
index = None
|
||||
avatar = None
|
||||
if avatars:
|
||||
avatar = avatars.get(pk=id)
|
||||
if not avatar:
|
||||
return Http404
|
||||
|
||||
index = avatars.filter(date_uploaded__gt=avatar.date_uploaded).count()
|
||||
count = avatars.count()
|
||||
|
||||
if index==0:
|
||||
prev = avatars.reverse()[0]
|
||||
if count <= 1:
|
||||
next = avatars[0]
|
||||
else:
|
||||
next = avatars[1]
|
||||
else:
|
||||
prev = avatars[index-1]
|
||||
|
||||
if (index+1)>=count:
|
||||
next = avatars[0]
|
||||
prev_index = index-1
|
||||
if prev_index < 0:
|
||||
prev_index = 0
|
||||
prev = avatars[prev_index]
|
||||
else:
|
||||
next = avatars[index+1]
|
||||
|
||||
|
||||
return render_to_response(template_name, {
|
||||
"other_user": user,
|
||||
"avatar": avatar,
|
||||
"index": index+1,
|
||||
"avatars": avatars,
|
||||
"next": next,
|
||||
"prev": prev,
|
||||
"count": count,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
|
||||
def render_primary(request, extra_context={}, user=None, size=AVATAR_DEFAULT_SIZE, *args, **kwargs):
|
||||
size = int(size)
|
||||
avatar = get_primary_avatar(user, size=size)
|
||||
|
|
|
|||
Loading…
Reference in a new issue