diff --git a/.gitignore b/.gitignore
index 500f282..2140f05 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,5 @@
*.pyc
*.swp
*.sqlite3
+/media/avatars/
ponyconf/*_settings.py
diff --git a/accounts/templates/accounts/edit_profile.html b/accounts/templates/accounts/edit_profile.html
index 99d4a23..40cd88f 100644
--- a/accounts/templates/accounts/edit_profile.html
+++ b/accounts/templates/accounts/edit_profile.html
@@ -1,11 +1,18 @@
{% extends 'base.html' %}
+{% load i18n %}
+
{% block speakertab %} class="active"{% endblock %}
{% block content %}
-
{{ profile }}
-
-{% include "_form.html" %}
+
+
+
{% blocktrans %}{{ profile }}'s profile{% endblocktrans %}
+
+
+ {% include "_form.html" %}
+
+
{% endblock %}
diff --git a/accounts/templates/accounts/profile.html b/accounts/templates/accounts/profile.html
index 6c070f9..4515fba 100644
--- a/accounts/templates/accounts/profile.html
+++ b/accounts/templates/accounts/profile.html
@@ -1,6 +1,6 @@
{% extends 'base.html' %}
-{% load bootstrap3 i18n %}
+{% load bootstrap3 i18n avatar_tags %}
{% block profiletab %} class="active"{% endblock %}
@@ -12,14 +12,29 @@
{% trans "Profile" %}
- {% include "_form.html" %}
+
{% endblock %}
-Change password
-
{% block css %}
{{ block.super }}
{{ form.media.css }}
diff --git a/accounts/templates/avatar/add.html b/accounts/templates/avatar/add.html
new file mode 100644
index 0000000..ad0bcd3
--- /dev/null
+++ b/accounts/templates/avatar/add.html
@@ -0,0 +1,14 @@
+{% extends "avatar/base.html" %}
+{% load i18n avatar_tags %}
+
+{% block avatarcontent %}
+ {% trans "Your current avatar: " %}
+ {% avatar user %}
+ {% if not avatars %}
+ {% trans "You haven't uploaded an avatar yet. Please upload one now." %}
+ {% endif %}
+
+{% endblock %}
diff --git a/accounts/templates/avatar/avatar_tag.html b/accounts/templates/avatar/avatar_tag.html
new file mode 100644
index 0000000..79f3e61
--- /dev/null
+++ b/accounts/templates/avatar/avatar_tag.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/accounts/templates/avatar/base.html b/accounts/templates/avatar/base.html
new file mode 100644
index 0000000..efe9906
--- /dev/null
+++ b/accounts/templates/avatar/base.html
@@ -0,0 +1,20 @@
+{% extends 'base.html' %}
+
+{% load i18n %}
+
+{% block profiletab %} class="active"{% endblock %}
+
+{% block content %}
+
+
+
+
+ {% block avatarcontent %}{% endblock %}
+
+
+
+{% endblock %}
diff --git a/accounts/templates/avatar/change.html b/accounts/templates/avatar/change.html
new file mode 100644
index 0000000..13755f2
--- /dev/null
+++ b/accounts/templates/avatar/change.html
@@ -0,0 +1,21 @@
+{% extends "avatar/base.html" %}
+{% load i18n avatar_tags %}
+
+{% block avatarcontent %}
+ {% trans "Your current avatar: " %}
+ {% avatar user %}
+ {% if not avatars %}
+ {% trans "You haven't uploaded an avatar yet. Please upload one now." %}
+ {% else %}
+
+ {% endif %}
+
+{% endblock %}
diff --git a/accounts/templates/avatar/confirm_delete.html b/accounts/templates/avatar/confirm_delete.html
new file mode 100644
index 0000000..8f9ad4d
--- /dev/null
+++ b/accounts/templates/avatar/confirm_delete.html
@@ -0,0 +1,17 @@
+{% extends "avatar/base.html" %}
+{% load i18n %}
+
+{% block avatarcontent %}
+ {% trans "Please select the avatars that you would like to delete." %}
+ {% if not avatars %}
+ {% url 'avatar_change' as avatar_change_url %}
+ {% blocktrans %}You have no avatars to delete. Please upload one now.{% endblocktrans %}
+ {% else %}
+
+ {% endif %}
+{% endblock %}
diff --git a/accounts/urls.py b/accounts/urls.py
index bfbbe28..a62c6fb 100644
--- a/accounts/urls.py
+++ b/accounts/urls.py
@@ -10,6 +10,7 @@ urlpatterns = [
url(r'^logout/$', auth_views.logout, {'next_page': settings.LOGOUT_REDIRECT_URL}, name='logout'),
url(r'^admin/participants/$', views.participation_list, name='list-participant'),
url(r'^admin/participant/(?P[\w.@+-]+)$', views.edit, name='edit-participant'),
+ url(r'^avatar/', include('avatar.urls')),
url(r'', include('django.contrib.auth.urls')),
url(r'', include('registration.backends.default.urls')),
]
diff --git a/accounts/views.py b/accounts/views.py
index 13f3537..8e53f87 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -14,6 +14,7 @@ from .utils import can_edit_profile, is_orga
RESET_PASSWORD_BUTTON = ('password_reset', 'warning', _('Reset your password'))
CHANGE_PASSWORD_BUTTON = ('password_change', 'warning', _('Change password'))
+CHANGE_AVATAR_BUTTON = ('avatar_change', 'default', _('Change avatar'))
@login_required
diff --git a/locale/fr/LC_MESSAGES/django.mo b/locale/fr/LC_MESSAGES/django.mo
index 8fcd061..98e4e89 100644
Binary files a/locale/fr/LC_MESSAGES/django.mo and b/locale/fr/LC_MESSAGES/django.mo differ
diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po
index 4410905..c10888d 100644
--- a/locale/fr/LC_MESSAGES/django.po
+++ b/locale/fr/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-07-23 12:13+0000\n"
+"POT-Creation-Date: 2016-07-23 15:18+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: accounts/models.py:17 proposals/templates/proposals/user_details.html:10
+#: accounts/models.py:17 proposals/templates/proposals/user_details.html:12
msgid "Biography"
msgstr "Biographie"
@@ -42,7 +42,7 @@ msgstr "J’accepte d’être enregistré en vidéo"
msgid "Video licence"
msgstr "Licence vidéo"
-#: accounts/models.py:60 proposals/templates/proposals/user_details.html:17
+#: accounts/models.py:60 proposals/templates/proposals/user_details.html:19
msgid "Notes"
msgstr "Notes"
@@ -54,6 +54,11 @@ msgstr "Bienvenue !"
msgid "Goodbye!"
msgstr "Au revoir !"
+#: accounts/templates/accounts/edit_profile.html:11
+#, python-format
+msgid "%(profile)s's profile"
+msgstr "Profile de %(profile)s"
+
#: accounts/templates/accounts/participation_list.html:32
msgid "View conversation"
msgstr "Afficher la discussion"
@@ -72,6 +77,57 @@ msgstr "S’abonner à la discussion"
msgid "Profile"
msgstr "Profile"
+#: accounts/templates/accounts/profile.html:20 accounts/views.py:17
+msgid "Change avatar"
+msgstr "Changer d’avatar"
+
+#: accounts/templates/accounts/profile.html:26 ponyconf/templates/_form.html:12
+msgid "Submit"
+msgstr "Envoyer"
+
+#: accounts/templates/accounts/profile.html:30 ponyconf/templates/_form.html:16
+msgid "Cancel"
+msgstr "Annuler"
+
+#: accounts/templates/avatar/add.html:5 accounts/templates/avatar/change.html:5
+msgid "Your current avatar: "
+msgstr ""
+
+#: accounts/templates/avatar/add.html:8 accounts/templates/avatar/change.html:8
+msgid "You haven't uploaded an avatar yet. Please upload one now."
+msgstr ""
+
+#: accounts/templates/avatar/add.html:12
+#: accounts/templates/avatar/change.html:19
+msgid "Upload New Image"
+msgstr ""
+
+#: accounts/templates/avatar/base.html:11
+msgid "Avatar"
+msgstr ""
+
+#: accounts/templates/avatar/base.html:12
+msgid "Back to profile"
+msgstr "Retourner au profile"
+
+#: accounts/templates/avatar/change.html:14
+msgid "Choose new Default"
+msgstr ""
+
+#: accounts/templates/avatar/confirm_delete.html:5
+msgid "Please select the avatars that you would like to delete."
+msgstr ""
+
+#: accounts/templates/avatar/confirm_delete.html:8
+msgid ""
+"You have no avatars to delete. Please upload one now."
+msgstr ""
+
+#: accounts/templates/avatar/confirm_delete.html:14
+msgid "Delete These"
+msgstr ""
+
#: accounts/templates/registration/login.html:11
#: ponyconf/templates/base.html:76
msgid "Login"
@@ -108,7 +164,7 @@ msgstr "Réinitialiser son mot de passe"
#: accounts/views.py:16
msgid "Change password"
-msgstr "Changer son mot de passe"
+msgstr "Changer de mot de passe"
#: conversations/templates/conversations/_message_form.html:4
msgid "Send a message"
@@ -139,28 +195,20 @@ msgid "You can use this page to communicate with the staff."
msgstr ""
"Vous pouvez utiliser cette page pour communiquer avec l’équipe organisatrice."
-#: ponyconf/settings.py:135
+#: ponyconf/settings.py:136
msgid "English"
msgstr "Anglais"
-#: ponyconf/settings.py:136
+#: ponyconf/settings.py:137
msgid "French"
msgstr "Français"
-#: ponyconf/templates/_form.html:11
-msgid "Submit"
-msgstr "Envoyer"
-
-#: ponyconf/templates/_form.html:15
-msgid "Cancel"
-msgstr "Annuler"
-
#: ponyconf/templates/base.html:45
msgid "Home"
msgstr "Accueil"
#: ponyconf/templates/base.html:47
-#: proposals/templates/proposals/user_details.html:13
+#: proposals/templates/proposals/user_details.html:15
msgid "Talks"
msgstr "Exposés"
@@ -281,7 +329,7 @@ msgstr "Aucun thèmes."
msgid "Add a topic"
msgstr "Ajouter un thème"
-#: proposals/templates/proposals/user_details.html:19
+#: proposals/templates/proposals/user_details.html:21
msgid "Edit"
msgstr "Éditer"
diff --git a/ponyconf/settings.py b/ponyconf/settings.py
index a0aa7d0..1436477 100644
--- a/ponyconf/settings.py
+++ b/ponyconf/settings.py
@@ -44,6 +44,7 @@ INSTALLED_APPS = [
'bootstrap3',
'registration',
'django_select2',
+ 'avatar',
# build-in apps
'django.contrib.admin',
@@ -143,11 +144,13 @@ LOCALE_PATHS = [
]
+MEDIA_URL = '/media/'
+MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
+
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_URL = '/static/'
-
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
diff --git a/ponyconf/templates/_form.html b/ponyconf/templates/_form.html
index a4abb9b..49f09e9 100644
--- a/ponyconf/templates/_form.html
+++ b/ponyconf/templates/_form.html
@@ -1,6 +1,7 @@
{% load bootstrap3 i18n %}