annotate libervia/pages/photos/album/page_meta.py @ 1124:28e3eb3bb217

files reorganisation and installation rework: - files have been reorganised to follow other SàT projects and usual Python organisation (no more "/src" directory) - VERSION file is now used, as for other SàT projects - replace the overcomplicated setup.py be a more sane one. Pyjamas part is not compiled anymore by setup.py, it must be done separatly - removed check for data_dir if it's empty - installation tested working in virtual env - libervia launching script is now in bin/libervia
author Goffi <goffi@goffi.org>
date Sat, 25 Aug 2018 17:59:48 +0200
parents src/pages/photos/album/page_meta.py@cdd389ef97bc
children 29eb15062416
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
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
7 log = getLogger("pages/photo/album")
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
8
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
9 name = u"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
10 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
11 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
12
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
13
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 def parse_url(self, request):
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
15 self.getPathArgs(request, ["service", "*path"], min_args=1, service="jid", path="")
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
16
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
17
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 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
19 data = self.getRData(request)
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
20 data["thumb_limit"] = 1200
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
21 data["retrieve_comments"] = True
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
22 files_page = self.getPageByName(u"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
23 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
24
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
25
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
26 def on_data_post(self, request):
1113
cdd389ef97bc server: code style reformatting using black
Goffi <goffi@goffi.org>
parents: 1085
diff changeset
27 blog_page = self.getPageByName(u"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
28 return blog_page.on_data_post(self, request)