comparison piecrust/admin/views/menu.py @ 1069:dff873f11541

admin: Upgrade Bootstrap, switch icons to Open-Iconic, remove Bower.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 13 Feb 2018 23:22:27 -0800
parents 98430e7143d2
children 0d699f04968c
comparison
equal deleted inserted replaced
1068:137c9b41edd2 1069:dff873f11541
6 def get_menu_context(): 6 def get_menu_context():
7 entries = [] 7 entries = []
8 entries.append({ 8 entries.append({
9 'url': url_for('FoodTruck.index'), 9 'url': url_for('FoodTruck.index'),
10 'title': "Dashboard", 10 'title': "Dashboard",
11 'icon': 'speedometer'}) 11 'icon': 'dashboard'})
12 12
13 site = g.site.piecrust_app 13 site = g.site.piecrust_app
14 for source in site.sources: 14 for source in site.sources:
15 if source.is_theme_source: 15 if source.is_theme_source:
16 continue 16 continue
20 # Figure out the icon to use... we do some hard-coded stuff to 20 # Figure out the icon to use... we do some hard-coded stuff to
21 # have something vaguely pretty out of the box. 21 # have something vaguely pretty out of the box.
22 source_icon = source.config.get('admin_icon') 22 source_icon = source.config.get('admin_icon')
23 if source_icon is None: 23 if source_icon is None:
24 if source.name == 'pages': 24 if source.name == 'pages':
25 source_icon = 'document-text' 25 source_icon = 'document'
26 elif 'blog' in source.name or 'posts' in source.name: 26 elif 'blog' in source.name or 'posts' in source.name:
27 source_icon = 'filing' 27 source_icon = 'box'
28 else: 28 else:
29 source_icon = 'document' 29 source_icon = 'file'
30 30
31 url_write = url_for('.write_page', source_name=source.name) 31 url_write = url_for('.write_page', source_name=source.name)
32 url_listall = url_for('.list_source', source_name=source.name) 32 url_listall = url_for('.list_source', source_name=source.name)
33 33
34 ctx = { 34 ctx = {
35 'url': url_listall, 35 'url': url_listall,
36 'title': source.name, 36 'title': source.name,
37 'icon': source_icon, 37 'icon': source_icon,
38 'quicklink': { 38 'quicklink': {
39 'icon': 'plus-round', 39 'icon': 'plus',
40 'url': url_write, 40 'url': url_write,
41 'title': "Write New" 41 'title': "Write New"
42 }, 42 },
43 'entries': [ 43 'entries': [
44 {'url': url_listall, 'title': "List All"}, 44 {'url': url_listall, 'title': "List All"},
48 entries.append(ctx) 48 entries.append(ctx)
49 49
50 entries.append({ 50 entries.append({
51 'url': url_for('.publish'), 51 'url': url_for('.publish'),
52 'title': "Publish", 52 'title': "Publish",
53 'icon': 'upload'}) 53 'icon': 'cloud-upload'})
54 54
55 # TODO: re-enable settings UI at some point. 55 # TODO: re-enable settings UI at some point.
56 # entries.append({ 56 # entries.append({
57 # 'url': url_for('.settings'), 57 # 'url': url_for('.settings'),
58 # 'title': "Settings", 58 # 'title': "Settings",