annotate libervia/pages/photos/album/page_meta.py @ 1517:b8ed9726525b

browser: "calls" implementation, first draft: Basic page to make a call. Call are automatically accepted for the moment. fix 422
author Goffi <goffi@goffi.org>
date Thu, 01 Jun 2023 21:42:02 +0200
parents 106bae41f5c8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1145
diff changeset
1 #!/usr/bin/env python3
1239
f511f8fbbf8a fixed shebangs
Goffi <goffi@goffi.org>
parents: 1216
diff changeset
2
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
3
1418
d6bcb0cf92d2 pages: add some labels
Goffi <goffi@goffi.org>
parents: 1326
diff changeset
4 from sat.core.i18n import D_
d6bcb0cf92d2 pages: add some labels
Goffi <goffi@goffi.org>
parents: 1326
diff changeset
5 from sat.core.log import getLogger
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
6 from libervia.server.constants import Const as C
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
7
1145
29eb15062416 pages: set __name__ for imported pages
Goffi <goffi@goffi.org>
parents: 1124
diff changeset
8 log = getLogger(__name__)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
9
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1145
diff changeset
10 name = "photos_album"
1418
d6bcb0cf92d2 pages: add some labels
Goffi <goffi@goffi.org>
parents: 1326
diff changeset
11 label = D_("Photos Album")
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
12 access = C.PAGES_ACCESS_PROFILE
1216
b2d067339de3 python 3 port:
Goffi <goffi@goffi.org>
parents: 1145
diff changeset
13 template = "photo/album.html"
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
14
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
15
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
16 def parse_url(self, request):
1509
106bae41f5c8 massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents: 1418
diff changeset
17 self.get_path_args(request, ["service", "*path"], min_args=1, service="jid", path="")
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
18
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
19
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
20 def prepare_render(self, request):
1509
106bae41f5c8 massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents: 1418
diff changeset
21 data = self.get_r_data(request)
1326
089742e065e3 pages (files/list, photos/album): updated thumbnails size limits
Goffi <goffi@goffi.org>
parents: 1239
diff changeset
22 data["thumb_limit"] = 800
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
23 data["retrieve_comments"] = True
1509
106bae41f5c8 massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents: 1418
diff changeset
24 files_page = self.get_page_by_name("files_list")
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
25 return files_page.prepare_render(self, request)
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
26
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
27
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
28 def on_data_post(self, request):
1509
106bae41f5c8 massive refactoring from camelCase -> snake_case. See backend commit log for more details
Goffi <goffi@goffi.org>
parents: 1418
diff changeset
29 blog_page = self.get_page_by_name("blog_view")
1070
46622cb54e6c pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
Goffi <goffi@goffi.org>
parents:
diff changeset
30 return blog_page.on_data_post(self, request)