29
29
# ----------------------------------------------------------------------------------------------------------------------
30
30
31
31
response .menu = [
32
- (T ('Home' ), False , URL ('default' , 'index' ), [])
32
+ # (T('Home'), False, URL('default', 'index'), [])
33
33
]
34
34
35
35
DEVELOPMENT_MENU = True
39
39
# provide shortcuts for development. remove in production
40
40
# ----------------------------------------------------------------------------------------------------------------------
41
41
42
+ from plugin_introspect import lessons_menu , menu , exposed_functions_names , generate_exposed_functions_info , exposed_functions
43
+
42
44
def _ ():
43
45
# ------------------------------------------------------------------------------------------------------------------
44
46
# shortcuts
@@ -48,38 +50,33 @@ def _():
48
50
# ------------------------------------------------------------------------------------------------------------------
49
51
# useful links to internal and external resources
50
52
# ------------------------------------------------------------------------------------------------------------------
53
+ def current_lesson_topics ():
54
+ fun_names = exposed_functions_names ()
55
+ exposed_functions = generate_exposed_functions_info ()
56
+
57
+ # hierarchical
58
+ topics = menu (only_category = False ,
59
+ item_decorator = lambda item : ( T (item ) , False , URL (item ) ),
60
+ # item_decorator=lambda item: ( T(item) + "*" * exposed_functions[item]['is_task'], False, URL(item) ),
61
+ cat_decorator = lambda cat_name , items : (T (cat_name or ">" ), False , items [0 ][2 ], items ),
62
+ plain_menu = True
63
+ )
64
+ from pprint import pprint
65
+ pprint (str (topics ), indent = 4 )
66
+ # flat
67
+ # topics = [
68
+ # ( T(item) + "*" * exposed_functions[item]['is_task'], False, URL(item) )
69
+ # for item in fun_names
70
+ # ]
71
+
72
+ return topics
73
+ # LI(_class="divider"),
74
+
75
+ topics = current_lesson_topics ()
76
+
51
77
response .menu += [
52
- (T ('My Sites' ), False , URL ('admin' , 'default' , 'site' )),
53
- (T ('This App' ), False , '#' , [
54
- (T ('Design' ), False , URL ('admin' , 'default' , 'design/%s' % app )),
55
- LI (_class = "divider" ),
56
- (T ('Controller' ), False ,
57
- URL (
58
- 'admin' , 'default' , 'edit/%s/controllers/%s.py' % (app , ctr ))),
59
- (T ('View' ), False ,
60
- URL (
61
- 'admin' , 'default' , 'edit/%s/views/%s' % (app , response .view ))),
62
- (T ('DB Model' ), False ,
63
- URL (
64
- 'admin' , 'default' , 'edit/%s/models/db.py' % app )),
65
- (T ('Menu Model' ), False ,
66
- URL (
67
- 'admin' , 'default' , 'edit/%s/models/menu.py' % app )),
68
- (T ('Config.ini' ), False ,
69
- URL (
70
- 'admin' , 'default' , 'edit/%s/private/appconfig.ini' % app )),
71
- (T ('Layout' ), False ,
72
- URL (
73
- 'admin' , 'default' , 'edit/%s/views/layout.html' % app )),
74
- (T ('Stylesheet' ), False ,
75
- URL (
76
- 'admin' , 'default' , 'edit/%s/static/css/web2py-bootstrap3.css' % app )),
77
- (T ('Database' ), False , URL (app , 'appadmin' , 'index' )),
78
- (T ('Errors' ), False , URL (
79
- 'admin' , 'default' , 'errors/' + app )),
80
- (T ('About' ), False , URL (
81
- 'admin' , 'default' , 'about/' + app )),
82
- ]),
78
+ (T ('Pamokos Temos' ), False , '#' , topics ),
79
+
83
80
('web2py.com' , False , '#' , [
84
81
(T ('Download' ), False ,
85
82
'http://www.web2py.com/examples/default/download' ),
0 commit comments