photo-objects 0.10.0__tar.gz → 0.10.2__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.0 → photo_objects-0.10.2}/PKG-INFO +1 -1
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/forms.py +52 -1
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects.egg-info/PKG-INFO +1 -1
- {photo_objects-0.10.0 → photo_objects-0.10.2}/pyproject.toml +1 -1
- {photo_objects-0.10.0 → photo_objects-0.10.2}/LICENSE +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/README.md +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/config.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/admin.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/album.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/auth.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/backup.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/photo.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/photo_change_request.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/api/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/apps.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/conf.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/context_processors.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/commands/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/commands/clean-scaled-photos.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/commands/create-initial-admin-account.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/commands/restore-backup.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0001_initial.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0002_created_at_updated_at.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0003_admin_visibility.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0004_camera_setup_and_settings.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0005_sitesettings.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0006_photo_alt_text.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0007_backup.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/models.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/objsto.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/signals.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/templatetags/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/templatetags/photo_objects_extras.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_album.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_auth.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_commands.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_img.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_og_meta.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_photo.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_photo_change_requests.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/test_utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/tests/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/urls.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/api/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/api/album.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/api/auth.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/api/photo.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/api/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/__init__.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/album.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/configuration.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/photo.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/photo_change_request.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/users.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/error.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/img.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/utils.py +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects.egg-info/SOURCES.txt +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects.egg-info/dependency_links.txt +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects.egg-info/requires.txt +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects.egg-info/top_level.txt +0 -0
- {photo_objects-0.10.0 → photo_objects-0.10.2}/setup.cfg +0 -0
|
@@ -20,6 +20,10 @@ from .models import Album, Photo, PhotoChangeRequest
|
|
|
20
20
|
KEY_POSTFIX_CHARS = 'bcdfghjklmnpqrstvwxz2456789'
|
|
21
21
|
KEY_POSTFIX_LEN = 5
|
|
22
22
|
|
|
23
|
+
ALBUM_TITLE_HELP = _(
|
|
24
|
+
'When creating a new album, album key is generated based on the title. '
|
|
25
|
+
'Modifying the title later does not change the album key.'
|
|
26
|
+
)
|
|
23
27
|
ALT_TEXT_HELP = _('Alternative text content for the photo.')
|
|
24
28
|
|
|
25
29
|
|
|
@@ -37,6 +41,44 @@ def description_help(resource):
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
|
|
44
|
+
def visibility_help(visibility: str):
|
|
45
|
+
visibility = Album.Visibility(visibility)
|
|
46
|
+
if visibility == Album.Visibility.PUBLIC:
|
|
47
|
+
return _(
|
|
48
|
+
'The album is visible to anyone without authentication.')
|
|
49
|
+
if visibility == Album.Visibility.HIDDEN:
|
|
50
|
+
return _(
|
|
51
|
+
'The album is visible to anyone with the link. Only '
|
|
52
|
+
'authenticated users can see the album in albums list.')
|
|
53
|
+
if visibility == Album.Visibility.PRIVATE:
|
|
54
|
+
return _(
|
|
55
|
+
'The album is only visible to authenticated users.')
|
|
56
|
+
if visibility == Album.Visibility.ADMIN:
|
|
57
|
+
return _(
|
|
58
|
+
'The album is only visible to admin users.')
|
|
59
|
+
return None
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class VisibilityRadioSelect(RadioSelect):
|
|
63
|
+
def create_option(
|
|
64
|
+
self, name, value, label, selected, index, subindex=None, attrs=None
|
|
65
|
+
):
|
|
66
|
+
option = super().create_option(
|
|
67
|
+
name,
|
|
68
|
+
value,
|
|
69
|
+
label,
|
|
70
|
+
selected,
|
|
71
|
+
index,
|
|
72
|
+
subindex=subindex,
|
|
73
|
+
attrs=attrs)
|
|
74
|
+
option['label'] = mark_safe(f'''
|
|
75
|
+
<div>
|
|
76
|
+
<span class="label">{label}</span>
|
|
77
|
+
<p class="helptext">{visibility_help(option.get('value'))}</p>
|
|
78
|
+
</div>''')
|
|
79
|
+
return option
|
|
80
|
+
|
|
81
|
+
|
|
40
82
|
def _check_admin_visibility(form):
|
|
41
83
|
if form.user and form.user.is_staff:
|
|
42
84
|
return
|
|
@@ -60,7 +102,10 @@ class CreateAlbumForm(ModelForm):
|
|
|
60
102
|
fields = ['key', 'title', 'description', 'visibility']
|
|
61
103
|
help_texts = {
|
|
62
104
|
**description_help('album'),
|
|
105
|
+
'title': ALBUM_TITLE_HELP,
|
|
63
106
|
}
|
|
107
|
+
widgets = {'visibility': VisibilityRadioSelect(
|
|
108
|
+
attrs={'class': 'visibility-select'}), }
|
|
64
109
|
|
|
65
110
|
def __init__(self, *args, user=None, **kwargs):
|
|
66
111
|
super().__init__(*args, **kwargs)
|
|
@@ -136,9 +181,15 @@ class ModifyAlbumForm(ModelForm):
|
|
|
136
181
|
'cover_photo': _(
|
|
137
182
|
'Select a cover photo for the album. The cover photo is '
|
|
138
183
|
'visible on the albums list page and in album preview image.'),
|
|
184
|
+
'title': ALBUM_TITLE_HELP,
|
|
139
185
|
}
|
|
140
186
|
widgets = {
|
|
141
|
-
'cover_photo': RadioSelect(
|
|
187
|
+
'cover_photo': RadioSelect(
|
|
188
|
+
attrs={
|
|
189
|
+
'class': 'photo-select'}),
|
|
190
|
+
'visibility': VisibilityRadioSelect(
|
|
191
|
+
attrs={
|
|
192
|
+
'class': 'visibility-select'}),
|
|
142
193
|
}
|
|
143
194
|
|
|
144
195
|
def __init__(self, *args, user=None, **kwargs):
|
|
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.0 → photo_objects-0.10.2}/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
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/management/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0005_sitesettings.py
RENAMED
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/migrations/0006_photo_alt_text.py
RENAMED
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/photo_objects/django/views/ui/configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
{photo_objects-0.10.0 → photo_objects-0.10.2}/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
|
|
File without changes
|