comparison foodtruck/views/menu.py @ 772:3885421c29a3

admin: Make the whole FoodTruck site into a blueprint. This makes it possible to use an app factory, which makes it easier to write unit tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 03 Jul 2016 07:54:54 -0700
parents efc1dc916e7c
children
comparison
equal deleted inserted replaced
771:673979a5d548 772:3885421c29a3
18 if s.name == 'pages': 18 if s.name == 'pages':
19 source_icon = 'document-text' 19 source_icon = 'document-text'
20 elif 'blog' in s.name: 20 elif 'blog' in s.name:
21 source_icon = 'filing' 21 source_icon = 'filing'
22 22
23 url_write = url_for('write_page', source_name=s.name) 23 url_write = url_for('.write_page', source_name=s.name)
24 url_listall = url_for('list_source', source_name=s.name) 24 url_listall = url_for('.list_source', source_name=s.name)
25 25
26 ctx = { 26 ctx = {
27 'url': url_listall, 27 'url': url_listall,
28 'title': s.name, 28 'title': s.name,
29 'icon': source_icon, 29 'icon': source_icon,
33 ] 33 ]
34 } 34 }
35 entries.append(ctx) 35 entries.append(ctx)
36 36
37 entries.append({ 37 entries.append({
38 'url': url_for('publish'), 38 'url': url_for('.publish'),
39 'title': "Publish", 39 'title': "Publish",
40 'icon': 'upload'}) 40 'icon': 'upload'})
41 41
42 # entries.append({ 42 # entries.append({
43 # 'url': url_for('settings'), 43 # 'url': url_for('.settings'),
44 # 'title': "Settings", 44 # 'title': "Settings",
45 # 'icon': 'gear-b'}) 45 # 'icon': 'gear-b'})
46 46
47 for e in entries: 47 for e in entries:
48 needs_more_break = False 48 needs_more_break = False
60 e['active'] = True 60 e['active'] = True
61 break 61 break
62 62
63 data = {'entries': entries, 63 data = {'entries': entries,
64 'user': current_user, 64 'user': current_user,
65 'url_logout': url_for('logout')} 65 'url_logout': url_for('.logout')}
66 return data 66 return data
67 67
68 68