From 5d9d89a9cb4a9b158f9dffa8125a39c3a7b864e8 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Tue, 12 Oct 2021 23:26:16 +0200
Subject: [PATCH 01/19] Use autocomplete on photos in gallery
---
photologue_custom/admin.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/photologue_custom/admin.py b/photologue_custom/admin.py
index 2c0aca0..936f7e9 100644
--- a/photologue_custom/admin.py
+++ b/photologue_custom/admin.py
@@ -17,6 +17,7 @@ class GalleryAdmin(GalleryAdminDefault):
model.
"""
inlines = [GalleryExtendedInline, ]
+ autocomplete_fields = ['photos', ]
class PhotoExtendedInline(admin.StackedInline):
From 227d4fa2466f2bdd2f85f1445a45e58babfc8a58 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Tue, 12 Oct 2021 23:26:54 +0200
Subject: [PATCH 02/19] Show event date rather than publication date
---
photologue_custom/templates/photologue/gallery_detail.html | 2 +-
.../templates/photologue/includes/gallery_sample.html | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index 03415cb..61b3727 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -22,7 +22,7 @@
{% block content %}
{{ gallery.title }}
-{% trans "Published" %} {{ gallery.date_added|date }}
+{% if gallery.extended.date_start %}{{ gallery.extended.date_start }}{% if gallery.extended.date_end and gallery.extended.date_end != gallery.extended.date_start %} {% trans "to" %} {{ gallery.extended.date_end }}{% endif %}
{% endif %}
{% if gallery.extended.tags.all %}
Tags : {% for tag in gallery.extended.tags.all %}
diff --git a/photologue_custom/templates/photologue/includes/gallery_sample.html b/photologue_custom/templates/photologue/includes/gallery_sample.html
index 34d53a8..2b485d6 100644
--- a/photologue_custom/templates/photologue/includes/gallery_sample.html
+++ b/photologue_custom/templates/photologue/includes/gallery_sample.html
@@ -6,8 +6,8 @@
{% endfor %}
{{ gallery.title }}
-
{% trans "Published" %} {{ gallery.date_added|date }}
+ {% if gallery.extended.date_start %}
{{ gallery.extended.date_start }}{% if gallery.extended.date_end and gallery.extended.date_end != gallery.extended.date_start %} - {{ gallery.extended.date_end }}{% endif %}
{% endif %}
{% if gallery.description %}
{{ gallery.description|safe }}
{% endif %}
-
\ No newline at end of file
+
From c71427a2dffb9028748eb086ed30c50e0bcd7c94 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Tue, 12 Oct 2021 23:27:08 +0200
Subject: [PATCH 03/19] Show owner name in legend of photo
---
photologue_custom/templates/photologue/gallery_detail.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index 61b3727..182b8e0 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -34,7 +34,7 @@
{% for photo in gallery.public %}
-
+
{% endfor %}
From 07eaafe5ebd130fe9439646e787169209c3598ec Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Tue, 12 Oct 2021 23:36:02 +0200
Subject: [PATCH 04/19] Update translations
---
photo21/locale/fr/LC_MESSAGES/django.po | 42 +++++++++++++++++++------
1 file changed, 32 insertions(+), 10 deletions(-)
diff --git a/photo21/locale/fr/LC_MESSAGES/django.po b/photo21/locale/fr/LC_MESSAGES/django.po
index cc9f517..52bfecf 100644
--- a/photo21/locale/fr/LC_MESSAGES/django.po
+++ b/photo21/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: 2021-10-11 18:38+0000\n"
+"POT-Creation-Date: 2021-10-12 21:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -30,19 +30,31 @@ msgstr ""
msgid "Must end with `@crans.org` or `@ens-paris-saclay.fr`."
msgstr "Doit finir par `@crans.org` ou `@ens-paris-saclay.fr`."
-#: photo21/settings.py:143
+#: photo21/hashers.py:42
+msgid "algorithm"
+msgstr ""
+
+#: photo21/hashers.py:43
+msgid "salt"
+msgstr ""
+
+#: photo21/hashers.py:44
+msgid "hash"
+msgstr ""
+
+#: photo21/settings.py:153
msgid "German"
msgstr ""
-#: photo21/settings.py:144
+#: photo21/settings.py:154
msgid "English"
msgstr ""
-#: photo21/settings.py:145
+#: photo21/settings.py:155
msgid "Spanish"
msgstr ""
-#: photo21/settings.py:146
+#: photo21/settings.py:156
msgid "French"
msgstr ""
@@ -174,7 +186,15 @@ msgstr "Inscription"
msgid "Connected as"
msgstr "Connecté en tant que"
-#: photologue_custom/models.py:39
+#: photologue_custom/models.py:23
+msgid "start date"
+msgstr "date de début"
+
+#: photologue_custom/models.py:28
+msgid "end date"
+msgstr "date de fin"
+
+#: photologue_custom/models.py:51
msgid "owner"
msgstr "propriétaire"
@@ -206,15 +226,17 @@ msgid "No galleries were found."
msgstr ""
#: photologue_custom/templates/photologue/gallery_detail.html:25
-#: photologue_custom/templates/photologue/includes/gallery_sample.html:9
-#: photologue_custom/templates/photologue/photo_detail.html:10
-msgid "Published"
-msgstr ""
+msgid "to"
+msgstr "au"
#: photologue_custom/templates/photologue/gallery_detail.html:41
msgid "Download all gallery"
msgstr "Télécharger toute la galerie"
+#: photologue_custom/templates/photologue/photo_detail.html:10
+msgid "Published"
+msgstr ""
+
#: photologue_custom/templates/photologue/photo_detail.html:22
msgid "This photo is found in the following galleries"
msgstr ""
From f4c2ac5df25160d68dad1656ce190829f9257155 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 07:02:24 +0200
Subject: [PATCH 05/19] Update index content
---
photo21/templates/index.html | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/photo21/templates/index.html b/photo21/templates/index.html
index 4045b1d..63be33d 100644
--- a/photo21/templates/index.html
+++ b/photo21/templates/index.html
@@ -18,8 +18,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
photo est nécessaire avant toute republication sur un autre site.
- Si vous souhaitez qu'une photo soit supprimée, signalez le nous :
- Signaler un abus
+
+ Si vous souhaitez qu'une photo soit supprimée, signalez le nous :
+ Signaler un abus
+
+
+ Si vous souhaitez obtenir les droits photographes pour téléverser vos photos, signalez le nous :
+ Devenir photographe
+
Dernières galeries
@@ -30,18 +36,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% endfor %}
- Nouveau venu ?
-
- Si tu accèdes à ce service depuis le réseau du
- Crans , tu peux naviguer sur le
- serveur comme tu le souhaites.
- Par contre dès que tu essairas d'accéder au serveur photos depuis une
- connexion Internet externe tu devras te créer un compte utilisateur.
-
-
Participez et faites vivre le serveur photos :
- Devenez photographe en vous créant un compte ou en upgradant votre compte utilisateur
+ Devenez photographe et téléversez vos photos
Reportez-nous toute anomalie dans la nouvelle interface ou toute difficulté rencontrée : fautes d'orthographes, bugs, mauvaise ergonomie…
Envoyez-nous vos suggestions à photos@crans.org .
Si l'amélioration ou la gestion du serveur vous intéresse et pour en savoir plus, contactez-nous .
@@ -66,4 +63,4 @@ SPDX-License-Identifier: GPL-3.0-or-later
-{% endblock %}
\ No newline at end of file
+{% endblock %}
From a65327f309d57068c7d37ecb6de7070e78984669 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 10:11:09 +0200
Subject: [PATCH 06/19] Add backup script
---
docs/backup-photos | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 docs/backup-photos
diff --git a/docs/backup-photos b/docs/backup-photos
new file mode 100644
index 0000000..9f00d93
--- /dev/null
+++ b/docs/backup-photos
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Backup script to put in /etc/cron.montly/
+rsync -avP /var/www/photos/photo21 /backup/
+sudo -u postgres pg_dump photo21 > /backup/pg_dump_photo21.sql
From 313091319111a15a583c596aa91921a82b484768 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 10:49:04 +0200
Subject: [PATCH 07/19] Customize account views
---
photo21/templates/account/email.html | 79 +++++++++++++++++++
.../templates/socialaccount/connections.html | 66 ++++++++++++++++
2 files changed, 145 insertions(+)
create mode 100644 photo21/templates/account/email.html
create mode 100644 photo21/templates/socialaccount/connections.html
diff --git a/photo21/templates/account/email.html b/photo21/templates/account/email.html
new file mode 100644
index 0000000..d7c472f
--- /dev/null
+++ b/photo21/templates/account/email.html
@@ -0,0 +1,79 @@
+{% extends "account/base.html" %}
+{% comment %}
+SPDX-License-Identifier: GPL-2.0-or-later
+{% endcomment %}
+{% load i18n crispy_forms_tags %}
+{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %}
+
+{% block content %}
+{% trans "Account" %}
+
+
+
+ {% if user.emailaddress_set.all %}
+
{% trans 'The following e-mail addresses are associated with your account:' %}
+
+
+ {% else %}
+
{% trans 'Warning:'%} {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
+ {% endif %}
+
+ {% if can_add_email %}
+
{% trans "Add E-mail Address" %}
+
+
+ {% endif %}
+
+
+
+
+{% endblock %}
diff --git a/photo21/templates/socialaccount/connections.html b/photo21/templates/socialaccount/connections.html
new file mode 100644
index 0000000..ff3a221
--- /dev/null
+++ b/photo21/templates/socialaccount/connections.html
@@ -0,0 +1,66 @@
+{% extends "socialaccount/base.html" %}
+{% comment %}
+SPDX-License-Identifier: GPL-2.0-or-later
+{% endcomment %}
+{% load i18n %}
+{% block head_title %}{% trans "Account Connections" %}{% endblock %}
+
+{% block content %}
+{% trans "Account" %}
+
+
+
+ {% if form.accounts %}
+
{% blocktrans %}You can sign in to your account using any of the following third party accounts:{% endblocktrans %}
+
+
+
+ {% else %}
+
{% trans 'You currently have no social network accounts connected to this account.' %}
+ {% endif %}
+
+
{% trans 'Add a 3rd Party Account' %}
+
+
+ {% include "socialaccount/snippets/provider_list.html" with process="connect" %}
+
+
+ {% include "socialaccount/snippets/login_extra.html" %}
+
+
+
+
+
+{% endblock %}
From dd5409d93ece898952741d08cb2c105c2c115da7 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 11:23:58 +0200
Subject: [PATCH 08/19] Filter on event date in galleries list
---
photologue_custom/urls.py | 7 +++++--
photologue_custom/views.py | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/photologue_custom/urls.py b/photologue_custom/urls.py
index 1401caf..52fc483 100644
--- a/photologue_custom/urls.py
+++ b/photologue_custom/urls.py
@@ -1,8 +1,11 @@
-from django.urls import path
+from django.urls import path, re_path
-from .views import TagDetail, GalleryDownload
+from .views import (CustomGalleryArchiveIndexView,
+ CustomGalleryYearArchiveView, GalleryDownload, TagDetail)
urlpatterns = [
path('tag//', TagDetail.as_view(), name='tag-detail'),
+ path('gallery/', CustomGalleryArchiveIndexView.as_view(), name='pl-gallery-archive'),
+ re_path(r'^gallery/(?P\d{4})/$', CustomGalleryYearArchiveView.as_view(), name='pl-gallery-archive-year'),
path('gallery//download/', GalleryDownload.as_view(), name='gallery-download'),
]
diff --git a/photologue_custom/views.py b/photologue_custom/views.py
index cea94e7..285ae5e 100644
--- a/photologue_custom/views.py
+++ b/photologue_custom/views.py
@@ -9,6 +9,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse
from django.views.generic import DetailView
from photologue.models import Gallery
+from photologue.views import GalleryArchiveIndexView, GalleryYearArchiveView
from taggit.models import Tag
@@ -26,6 +27,22 @@ class TagDetail(LoginRequiredMixin, DetailView):
return context
+class CustomGalleryArchiveIndexView(GalleryArchiveIndexView):
+ """
+ Override to use event date
+ """
+ date_field = 'extended__date_start'
+ uses_datetime_field = False # Fix related object access
+
+
+class CustomGalleryYearArchiveView(GalleryYearArchiveView):
+ """
+ Override to use event date
+ """
+ date_field = 'extended__date_start'
+ uses_datetime_field = False # Fix related object access
+
+
class GalleryDownload(LoginRequiredMixin, DetailView):
model = Gallery
From c02d639bbb457c38d1c4746e6efe5c381e5373c1 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 14:08:50 +0200
Subject: [PATCH 09/19] Search on galleries title
---
photologue_custom/admin.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/photologue_custom/admin.py b/photologue_custom/admin.py
index 936f7e9..909117d 100644
--- a/photologue_custom/admin.py
+++ b/photologue_custom/admin.py
@@ -18,6 +18,7 @@ class GalleryAdmin(GalleryAdminDefault):
"""
inlines = [GalleryExtendedInline, ]
autocomplete_fields = ['photos', ]
+ search_fields = ['title', ]
class PhotoExtendedInline(admin.StackedInline):
From 292f8e629826b4b9b94624a2a2041b46dbc0b407 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 14:14:09 +0200
Subject: [PATCH 10/19] Allow more fields in URL
---
photo21/settings.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/photo21/settings.py b/photo21/settings.py
index f5aaaa0..08250a8 100644
--- a/photo21/settings.py
+++ b/photo21/settings.py
@@ -156,6 +156,9 @@ LANGUAGES = [
('fr', _('French')),
]
+# Allow more fields in URL to edit large galleries
+DATA_UPLOAD_MAX_NUMBER_FIELDS = 10240
+
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
From 5985b39ed8ddc3ebd94d91736144d0aa5761b984 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 14:19:04 +0200
Subject: [PATCH 11/19] Fix tag display page
---
photologue_custom/templates/photologue/gallery_detail.html | 2 +-
photologue_custom/views.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index 182b8e0..8c8692d 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -26,7 +26,7 @@
{% if gallery.extended.tags.all %}
Tags : {% for tag in gallery.extended.tags.all %}
- {{ tag }}
+ {{ tag }}
{% endfor %}
{% endif %}
diff --git a/photologue_custom/views.py b/photologue_custom/views.py
index 285ae5e..0a29748 100644
--- a/photologue_custom/views.py
+++ b/photologue_custom/views.py
@@ -23,7 +23,7 @@ class TagDetail(LoginRequiredMixin, DetailView):
current_tag = self.get_object().slug
context = super().get_context_data(**kwargs)
context['galleries'] = Gallery.objects.on_site().is_public() \
- .filter(extended__tags__name=current_tag)
+ .filter(extended__tags__slug=current_tag)
return context
From d6a8a2b68e14f39d06148db359dc4b9cfcf14761 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 14:25:11 +0200
Subject: [PATCH 12/19] Use a smaller grid on smaller screen
---
photologue_custom/templates/photologue/gallery_archive.html | 2 +-
.../templates/photologue/gallery_archive_year.html | 2 +-
photologue_custom/templates/taggit/tag_detail.html | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/photologue_custom/templates/photologue/gallery_archive.html b/photologue_custom/templates/photologue/gallery_archive.html
index babfaeb..c3571cb 100644
--- a/photologue_custom/templates/photologue/gallery_archive.html
+++ b/photologue_custom/templates/photologue/gallery_archive.html
@@ -23,7 +23,7 @@
{% if latest %}
{% for gallery in latest|slice:":32" %}
-
+
{% include "photologue/includes/gallery_sample.html" %}
{% endfor %}
diff --git a/photologue_custom/templates/photologue/gallery_archive_year.html b/photologue_custom/templates/photologue/gallery_archive_year.html
index 84f535c..44b1e3c 100644
--- a/photologue_custom/templates/photologue/gallery_archive_year.html
+++ b/photologue_custom/templates/photologue/gallery_archive_year.html
@@ -17,7 +17,7 @@
{% if object_list %}
{% for gallery in object_list %}
-
+
{% include "photologue/includes/gallery_sample.html" %}
{% endfor %}
diff --git a/photologue_custom/templates/taggit/tag_detail.html b/photologue_custom/templates/taggit/tag_detail.html
index 5580877..1484f2e 100644
--- a/photologue_custom/templates/taggit/tag_detail.html
+++ b/photologue_custom/templates/taggit/tag_detail.html
@@ -8,7 +8,7 @@
{% for gallery in galleries %}
-
+
{% include "photologue/includes/gallery_sample.html" %}
{% endfor %}
From ac75442c849021e125a06d973c9670cdd0e7eed9 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 15:51:47 +0200
Subject: [PATCH 13/19] Set account link active when visiting
---
photo21/templates/base.html | 3 ++-
photo21/templates/socialaccount/connections.html | 3 ---
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/photo21/templates/base.html b/photo21/templates/base.html
index 97ecbb8..7d09a26 100644
--- a/photo21/templates/base.html
+++ b/photo21/templates/base.html
@@ -43,7 +43,8 @@ SPDX-License-Identifier: GPL-3.0-or-later
-
-
-
{% endblock %}
From b3c85f15e520eda676500f7d4886b477b2bd633e Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 15:52:03 +0200
Subject: [PATCH 14/19] Add gallery management link
---
.../templates/photologue/gallery_detail.html | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index 8c8692d..d15fa41 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -21,7 +21,17 @@
{% endblock %}
{% block content %}
-{{ gallery.title }}
+
+ {{ gallery.title }}
+ {% if request.user.is_staff and perms.photologue.change_gallery %}
+
+
+
+
+
+
+ {% endif %}
+
{% if gallery.extended.date_start %}{{ gallery.extended.date_start }}{% if gallery.extended.date_end and gallery.extended.date_end != gallery.extended.date_start %} {% trans "to" %} {{ gallery.extended.date_end }}{% endif %}
{% endif %}
{% if gallery.extended.tags.all %}
From 2753f70234d89928afb42292ae070000a72ace84 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 15:52:18 +0200
Subject: [PATCH 15/19] Show gallery in a card
---
.../templates/photologue/gallery_detail.html | 28 ++++++++++++++-----
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index d15fa41..9a747c3 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -41,12 +41,26 @@
{% endif %}
{% if gallery.description %}{{ gallery.description|safe }}
{% endif %}
-
- {% for photo in gallery.public %}
-
-
-
- {% endfor %}
+
+
+
+
+
+ {% for photo in gallery.public %}
+
+
+
+ {% endfor %}
+
+
+
-
{% trans 'Download all gallery' %}
{% endblock %}
From 740cbc9df0f302d7696e200c9280a95694036f43 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 15:53:49 +0200
Subject: [PATCH 16/19] Update translation
---
photo21/locale/fr/LC_MESSAGES/django.po | 108 +++++++++++++++++++++---
1 file changed, 97 insertions(+), 11 deletions(-)
diff --git a/photo21/locale/fr/LC_MESSAGES/django.po b/photo21/locale/fr/LC_MESSAGES/django.po
index 52bfecf..6ea60a9 100644
--- a/photo21/locale/fr/LC_MESSAGES/django.po
+++ b/photo21/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: 2021-10-12 21:35+0000\n"
+"POT-Creation-Date: 2021-10-13 13:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -102,6 +102,73 @@ msgid ""
"soon. You can now drink a beer."
msgstr ""
+#: photo21/templates/account/email.html:6
+#: photo21/templates/account/email.html:14
+#: photo21/templates/socialaccount/connections.html:14
+msgid "E-mail Addresses"
+msgstr ""
+
+#: photo21/templates/account/email.html:9 photo21/templates/base.html:51
+#: photo21/templates/socialaccount/connections.html:9
+msgid "Account"
+msgstr "Compte"
+
+#: photo21/templates/account/email.html:17
+#: photo21/templates/socialaccount/connections.html:17
+msgid "Social connections"
+msgstr "Connexions sociales"
+
+#: photo21/templates/account/email.html:23
+msgid "The following e-mail addresses are associated with your account:"
+msgstr ""
+
+#: photo21/templates/account/email.html:34
+msgid "Verified"
+msgstr ""
+
+#: photo21/templates/account/email.html:36
+msgid "Unverified"
+msgstr ""
+
+#: photo21/templates/account/email.html:38
+msgid "Primary"
+msgstr ""
+
+#: photo21/templates/account/email.html:44
+msgid "Make Primary"
+msgstr ""
+
+#: photo21/templates/account/email.html:45
+msgid "Re-send Verification"
+msgstr ""
+
+#: photo21/templates/account/email.html:46
+#: photo21/templates/socialaccount/connections.html:45
+msgid "Remove"
+msgstr ""
+
+#: photo21/templates/account/email.html:51
+msgid "Warning:"
+msgstr ""
+
+#: photo21/templates/account/email.html:51
+msgid ""
+"You currently do not have any e-mail address set up. You should really add "
+"an e-mail address so you can receive notifications, reset your password, etc."
+msgstr ""
+
+#: photo21/templates/account/email.html:55
+msgid "Add E-mail Address"
+msgstr ""
+
+#: photo21/templates/account/email.html:60
+msgid "Add E-mail"
+msgstr ""
+
+#: photo21/templates/account/email.html:68
+msgid "Do you really want to remove the selected e-mail address?"
+msgstr ""
+
#: photo21/templates/account/login.html:6
#: photo21/templates/account/login.html:11
#: photo21/templates/account/login.html:39
@@ -166,26 +233,41 @@ msgstr "Galeries"
msgid "Manage"
msgstr "Gestion"
-#: photo21/templates/base.html:50
-msgid "Account"
-msgstr "Compte"
-
-#: photo21/templates/base.html:59
+#: photo21/templates/base.html:60
msgid "Log out"
msgstr ""
-#: photo21/templates/base.html:69
+#: photo21/templates/base.html:70
msgid "Log in"
msgstr ""
-#: photo21/templates/base.html:78
+#: photo21/templates/base.html:79
msgid "Sign up"
msgstr "Inscription"
-#: photo21/templates/index.html:53
+#: photo21/templates/index.html:50
msgid "Connected as"
msgstr "Connecté en tant que"
+#: photo21/templates/socialaccount/connections.html:6
+msgid "Account Connections"
+msgstr ""
+
+#: photo21/templates/socialaccount/connections.html:23
+msgid ""
+"You can sign in to your account using any of the following third party "
+"accounts:"
+msgstr ""
+
+#: photo21/templates/socialaccount/connections.html:51
+msgid ""
+"You currently have no social network accounts connected to this account."
+msgstr ""
+
+#: photo21/templates/socialaccount/connections.html:54
+msgid "Add a 3rd Party Account"
+msgstr ""
+
#: photologue_custom/models.py:23
msgid "start date"
msgstr "date de début"
@@ -225,11 +307,15 @@ msgstr ""
msgid "No galleries were found."
msgstr ""
-#: photologue_custom/templates/photologue/gallery_detail.html:25
+#: photologue_custom/templates/photologue/gallery_detail.html:35
msgid "to"
msgstr "au"
-#: photologue_custom/templates/photologue/gallery_detail.html:41
+#: photologue_custom/templates/photologue/gallery_detail.html:49
+msgid "All pictures"
+msgstr "Toutes les photos"
+
+#: photologue_custom/templates/photologue/gallery_detail.html:63
msgid "Download all gallery"
msgstr "Télécharger toute la galerie"
From cc3ba4a4928a9e36b61d14014c8ab7144dcecf94 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 17:05:29 +0200
Subject: [PATCH 17/19] Filter gallery by photo owner
---
.../templates/photologue/gallery_detail.html | 15 ++++++++++--
photologue_custom/urls.py | 5 +++-
photologue_custom/views.py | 23 +++++++++++++++++++
3 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index 9a747c3..f8f3ef4 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -46,13 +46,24 @@
- {% for photo in gallery.public %}
+ {% for photo in photos %}
diff --git a/photologue_custom/urls.py b/photologue_custom/urls.py
index 52fc483..6ada0f6 100644
--- a/photologue_custom/urls.py
+++ b/photologue_custom/urls.py
@@ -1,11 +1,14 @@
from django.urls import path, re_path
from .views import (CustomGalleryArchiveIndexView,
- CustomGalleryYearArchiveView, GalleryDownload, TagDetail)
+ CustomGalleryYearArchiveView, CustomGalleryDetailView,
+ GalleryDownload, TagDetail)
urlpatterns = [
path('tag/
/', TagDetail.as_view(), name='tag-detail'),
path('gallery/', CustomGalleryArchiveIndexView.as_view(), name='pl-gallery-archive'),
re_path(r'^gallery/(?P\d{4})/$', CustomGalleryYearArchiveView.as_view(), name='pl-gallery-archive-year'),
+ path('gallery//', CustomGalleryDetailView.as_view(), name='pl-gallery'),
+ path('gallery///', CustomGalleryDetailView.as_view(), name='pl-gallery-owner'),
path('gallery//download/', GalleryDownload.as_view(), name='gallery-download'),
]
diff --git a/photologue_custom/views.py b/photologue_custom/views.py
index 0a29748..cb79800 100644
--- a/photologue_custom/views.py
+++ b/photologue_custom/views.py
@@ -43,6 +43,29 @@ class CustomGalleryYearArchiveView(GalleryYearArchiveView):
uses_datetime_field = False # Fix related object access
+class CustomGalleryDetailView(DetailView):
+ """
+ Custom gallery detail view to filter on photo owner
+ """
+ queryset = Gallery.objects.on_site().is_public()
+
+ def get_context_data(self, **kwargs):
+ context = super().get_context_data(**kwargs)
+ context['photos'] = self.object.public()
+
+ # List owners
+ context['owners'] = []
+ for photo in context['photos']:
+ if photo.extented.owner not in context['owners']:
+ context['owners'].append(photo.extented.owner)
+
+ # Filter on owner
+ if 'owner' in self.kwargs:
+ context['photos'] = context['photos'].filter(extented__owner__id=self.kwargs['owner'])
+
+ return context
+
+
class GalleryDownload(LoginRequiredMixin, DetailView):
model = Gallery
From c317310dcfdedae31463646b3039f7d10935acee Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 17:06:45 +0200
Subject: [PATCH 18/19] Fix typo in extended related name
---
photologue_custom/models.py | 2 +-
photologue_custom/templates/photologue/gallery_detail.html | 2 +-
photologue_custom/views.py | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/photologue_custom/models.py b/photologue_custom/models.py
index 76be399..09e2765 100644
--- a/photologue_custom/models.py
+++ b/photologue_custom/models.py
@@ -40,7 +40,7 @@ class PhotoExtended(models.Model):
# Extend Photologue Photo model.
photo = models.OneToOneField(
Photo,
- related_name='extented',
+ related_name='extended',
on_delete=models.CASCADE,
)
diff --git a/photologue_custom/templates/photologue/gallery_detail.html b/photologue_custom/templates/photologue/gallery_detail.html
index f8f3ef4..f9f0819 100644
--- a/photologue_custom/templates/photologue/gallery_detail.html
+++ b/photologue_custom/templates/photologue/gallery_detail.html
@@ -65,7 +65,7 @@
{% for photo in photos %}
-
+
{% endfor %}
diff --git a/photologue_custom/views.py b/photologue_custom/views.py
index cb79800..509f6b8 100644
--- a/photologue_custom/views.py
+++ b/photologue_custom/views.py
@@ -56,12 +56,12 @@ class CustomGalleryDetailView(DetailView):
# List owners
context['owners'] = []
for photo in context['photos']:
- if photo.extented.owner not in context['owners']:
- context['owners'].append(photo.extented.owner)
+ if photo.extended.owner not in context['owners']:
+ context['owners'].append(photo.extended.owner)
# Filter on owner
if 'owner' in self.kwargs:
- context['photos'] = context['photos'].filter(extented__owner__id=self.kwargs['owner'])
+ context['photos'] = context['photos'].filter(extended__owner__id=self.kwargs['owner'])
return context
From f9b086a8b1576813e7dd4f24877d21c1ff8f438e Mon Sep 17 00:00:00 2001
From: Alexandre Iooss
Date: Wed, 13 Oct 2021 17:08:19 +0200
Subject: [PATCH 19/19] Add database migration
---
.../migrations/0003_auto_20211013_1507.py | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 photologue_custom/migrations/0003_auto_20211013_1507.py
diff --git a/photologue_custom/migrations/0003_auto_20211013_1507.py b/photologue_custom/migrations/0003_auto_20211013_1507.py
new file mode 100644
index 0000000..a99c067
--- /dev/null
+++ b/photologue_custom/migrations/0003_auto_20211013_1507.py
@@ -0,0 +1,24 @@
+# Generated by Django 2.2.24 on 2021-10-13 15:07
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('photologue_custom', '0002_auto_20211011_1956'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='galleryextended',
+ name='gallery',
+ field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='extended', to='photologue.Gallery'),
+ ),
+ migrations.AlterField(
+ model_name='photoextended',
+ name='photo',
+ field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='extended', to='photologue.Photo'),
+ ),
+ ]
\ No newline at end of file