photo-objects 0.10.2__tar.gz → 0.10.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {photo_objects-0.10.2 → photo_objects-0.10.3}/PKG-INFO +1 -1
- photo_objects-0.10.3/photo_objects/django/migrations/0008_sitesettings_copyright_notice.py +29 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/models.py +19 -3
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/templatetags/photo_objects_extras.py +18 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/album.py +13 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects.egg-info/PKG-INFO +1 -1
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects.egg-info/SOURCES.txt +1 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/pyproject.toml +1 -1
- {photo_objects-0.10.2 → photo_objects-0.10.3}/LICENSE +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/README.md +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/config.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/admin.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/album.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/auth.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/backup.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/photo.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/photo_change_request.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/apps.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/conf.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/context_processors.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/forms.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/commands/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/commands/clean-scaled-photos.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/commands/create-initial-admin-account.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/commands/restore-backup.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0001_initial.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0002_created_at_updated_at.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0003_admin_visibility.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0004_camera_setup_and_settings.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0005_sitesettings.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0006_photo_alt_text.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0007_backup.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/objsto.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/signals.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/templatetags/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_album.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_auth.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_commands.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_img.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_og_meta.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_photo.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_photo_change_requests.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/test_utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/tests/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/urls.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/api/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/api/album.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/api/auth.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/api/photo.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/api/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/__init__.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/configuration.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/photo.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/photo_change_request.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/users.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/error.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/img.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/utils.py +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects.egg-info/dependency_links.txt +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects.egg-info/requires.txt +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects.egg-info/top_level.txt +0 -0
- {photo_objects-0.10.2 → photo_objects-0.10.3}/setup.cfg +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated by Django 5.2.6 on 2025-12-20 18:09
|
|
2
|
+
|
|
3
|
+
import django.db.models.deletion
|
|
4
|
+
from django.db import migrations, models
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
('photo_objects', '0007_backup'),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AddField(
|
|
15
|
+
model_name='sitesettings',
|
|
16
|
+
name='copyright_notice',
|
|
17
|
+
field=models.CharField(blank=True, help_text='Copyright notice to display in the site footer. Content will be HTML-escaped before rendering.'),
|
|
18
|
+
),
|
|
19
|
+
migrations.AlterField(
|
|
20
|
+
model_name='sitesettings',
|
|
21
|
+
name='description',
|
|
22
|
+
field=models.TextField(blank=True, help_text='Description of the site, used in site level meta description tags and social media previews.'),
|
|
23
|
+
),
|
|
24
|
+
migrations.AlterField(
|
|
25
|
+
model_name='sitesettings',
|
|
26
|
+
name='preview_image',
|
|
27
|
+
field=models.ForeignKey(blank=True, help_text='Photo to use as the site level social media preview image.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='photo_objects.photo'),
|
|
28
|
+
),
|
|
29
|
+
]
|
|
@@ -211,10 +211,26 @@ class SiteSettings(models.Model):
|
|
|
211
211
|
site = models.OneToOneField(
|
|
212
212
|
Site, on_delete=models.CASCADE, related_name="settings")
|
|
213
213
|
|
|
214
|
-
description = models.TextField(
|
|
214
|
+
description = models.TextField(
|
|
215
|
+
blank=True,
|
|
216
|
+
help_text=_(
|
|
217
|
+
"Description of the site, used in site level meta description "
|
|
218
|
+
"tags and social media previews."),
|
|
219
|
+
)
|
|
215
220
|
preview_image = models.ForeignKey(
|
|
216
|
-
Photo,
|
|
217
|
-
|
|
221
|
+
Photo,
|
|
222
|
+
blank=True,
|
|
223
|
+
null=True,
|
|
224
|
+
on_delete=models.SET_NULL,
|
|
225
|
+
help_text=_(
|
|
226
|
+
"Photo to use as the site level social media preview image."),
|
|
227
|
+
)
|
|
228
|
+
copyright_notice = models.CharField(
|
|
229
|
+
blank=True,
|
|
230
|
+
help_text=_(
|
|
231
|
+
"Copyright notice to display in the site footer. Content will be "
|
|
232
|
+
"HTML-escaped before rendering."),
|
|
233
|
+
)
|
|
218
234
|
objects = SiteSettingsManager()
|
|
219
235
|
|
|
220
236
|
def __str__(self):
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from django import template
|
|
3
|
+
from django.utils.safestring import mark_safe
|
|
4
|
+
from django.utils.html import escape
|
|
3
5
|
|
|
4
6
|
from photo_objects.django.models import SiteSettings
|
|
5
7
|
from photo_objects.django.views.utils import meta_description
|
|
@@ -59,3 +61,19 @@ def meta_og(context):
|
|
|
59
61
|
}
|
|
60
62
|
except Exception:
|
|
61
63
|
return context
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
@register.simple_tag(takes_context=True)
|
|
67
|
+
def copyright_notice(context):
|
|
68
|
+
try:
|
|
69
|
+
request = context.get("request")
|
|
70
|
+
site = request.site
|
|
71
|
+
|
|
72
|
+
settings = SiteSettings.objects.get(site)
|
|
73
|
+
|
|
74
|
+
if settings.copyright_notice:
|
|
75
|
+
notice = escape(settings.copyright_notice)
|
|
76
|
+
return mark_safe(f"<div>{notice}</div>")
|
|
77
|
+
return ""
|
|
78
|
+
except Exception:
|
|
79
|
+
return ""
|
|
@@ -56,6 +56,18 @@ def get_info(request: HttpRequest, album_key: str):
|
|
|
56
56
|
return None
|
|
57
57
|
|
|
58
58
|
|
|
59
|
+
def _timeline(album: Album):
|
|
60
|
+
if not album.first_timestamp or not album.last_timestamp:
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
start = album.first_timestamp.strftime("%Y %B")
|
|
64
|
+
end = album.last_timestamp.strftime("%Y %B")
|
|
65
|
+
|
|
66
|
+
if start == end:
|
|
67
|
+
return start
|
|
68
|
+
return f"{start} – {end}"
|
|
69
|
+
|
|
70
|
+
|
|
59
71
|
@json_problem_as_html
|
|
60
72
|
def show_album(request: HttpRequest, album_key: str):
|
|
61
73
|
album = api.check_album_access(request, album_key)
|
|
@@ -64,6 +76,7 @@ def show_album(request: HttpRequest, album_key: str):
|
|
|
64
76
|
back = BackLink("Albums", reverse('photo_objects:list_albums'))
|
|
65
77
|
details = {
|
|
66
78
|
"Description": render_markdown(album.description),
|
|
79
|
+
"Timeline": _timeline(album),
|
|
67
80
|
"Visibility": Album.Visibility(album.visibility).label,
|
|
68
81
|
}
|
|
69
82
|
|
|
@@ -40,6 +40,7 @@ photo_objects/django/migrations/0004_camera_setup_and_settings.py
|
|
|
40
40
|
photo_objects/django/migrations/0005_sitesettings.py
|
|
41
41
|
photo_objects/django/migrations/0006_photo_alt_text.py
|
|
42
42
|
photo_objects/django/migrations/0007_backup.py
|
|
43
|
+
photo_objects/django/migrations/0008_sitesettings_copyright_notice.py
|
|
43
44
|
photo_objects/django/migrations/__init__.py
|
|
44
45
|
photo_objects/django/templatetags/__init__.py
|
|
45
46
|
photo_objects/django/templatetags/photo_objects_extras.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/api/photo_change_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/management/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0005_sitesettings.py
RENAMED
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0006_photo_alt_text.py
RENAMED
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/migrations/0007_backup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.2 → photo_objects-0.10.3}/photo_objects/django/views/ui/photo_change_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|