blob: e164c68d582dc17ce4cd1f3f47e471b8f06e2342 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# python import
import os
# gettext import
from gettext import gettext as _
# server import
from server.flask import app, logger, render, request, jsonify
# server tools import
from server.tools import storage
JNL_PATH = os.path.join('static', 'images', 'journal')
@app.route('/gallery')
def gallery():
# list images
_images_names = storage.list_dir(path=JNL_PATH)
_images_urls = ['/static/images/journal/%s' % _f for _f in _images_names]
# prepare result
_content = {
'title' : _('atdw - Gallery'),
'images': enumerate(_images_urls)
}
# render result
return render('atoideweb/gallery.html', **_content)
|