annotate src/pages/photos/album/page_meta.py @ 1070:46622cb54e6c

pages (photos): new photos/album page to use photo album view when displaying files, and display comments is available.
author Goffi <goffi@goffi.org>
date Sun, 18 Mar 2018 11:38:34 +0100
parents
children 1c09f41e2f52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
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
1 #!/usr/bin/env python2.7
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
2 # -*- coding: utf-8 -*-
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
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
4 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
5 from sat.core.log import getLogger
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 log = getLogger('pages/photo/album')
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
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
8 name = u'photos_album'
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
9 access = C.PAGES_ACCESS_PROFILE
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
10 template = u"photo/album.html"
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
11
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 def parse_url(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
13 self.getPathArgs(request, ['service', '*path'], min_args=1, service='jid', path='')
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
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
15 def 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
16 data = self.getRData(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
17 data['thumb_limit'] = 1200
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
18 data['retrieve_comments'] = True
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 files_page = self.getPageByName(u'files_list')
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 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
21
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
22 def on_data_post(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
23 blog_page = self.getPageByName(u'blog')
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
24 return blog_page.on_data_post(self, request)