menu.py 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. # -*- coding: utf-8 -*-
  2. # this file is released under public domain and you can use without limitations
  3. #########################################################################
  4. ## Customize your APP title, subtitle and menus here
  5. #########################################################################
  6. response.logo = A(B('web',SPAN(2),'py'),XML('™ '),
  7. _class="navbar-brand",_href="http://www.web2py.com/",
  8. _id="web2py-logo")
  9. response.title = request.application.replace('_',' ').title()
  10. response.subtitle = ''
  11. ## read more at http://dev.w3.org/html5/markup/meta.name.html
  12. response.meta.author = 'Your Name <you@example.com>'
  13. response.meta.description = 'a cool new app'
  14. response.meta.keywords = 'web2py, python, framework'
  15. response.meta.generator = 'Web2py Web Framework'
  16. ## your http://google.com/analytics id
  17. response.google_analytics_id = None
  18. #########################################################################
  19. ## this is the main application menu add/remove items as required
  20. #########################################################################
  21. response.menu = [
  22. (T('Home'), False, URL('default', 'index'), [])
  23. ]
  24. DEVELOPMENT_MENU = True
  25. #########################################################################
  26. ## provide shortcuts for development. remove in production
  27. #########################################################################
  28. def _():
  29. # shortcuts
  30. app = request.application
  31. ctr = request.controller
  32. # useful links to internal and external resources
  33. response.menu += [
  34. (T('My Sites'), False, URL('admin', 'default', 'site')),
  35. (T('This App'), False, '#', [
  36. (T('Design'), False, URL('admin', 'default', 'design/%s' % app)),
  37. LI(_class="divider"),
  38. (T('Controller'), False,
  39. URL(
  40. 'admin', 'default', 'edit/%s/controllers/%s.py' % (app, ctr))),
  41. (T('View'), False,
  42. URL(
  43. 'admin', 'default', 'edit/%s/views/%s' % (app, response.view))),
  44. (T('DB Model'), False,
  45. URL(
  46. 'admin', 'default', 'edit/%s/models/db.py' % app)),
  47. (T('Menu Model'), False,
  48. URL(
  49. 'admin', 'default', 'edit/%s/models/menu.py' % app)),
  50. (T('Config.ini'), False,
  51. URL(
  52. 'admin', 'default', 'edit/%s/private/appconfig.ini' % app)),
  53. (T('Layout'), False,
  54. URL(
  55. 'admin', 'default', 'edit/%s/views/layout.html' % app)),
  56. (T('Stylesheet'), False,
  57. URL(
  58. 'admin', 'default', 'edit/%s/static/css/web2py-bootstrap3.css' % app)),
  59. (T('Database'), False, URL(app, 'appadmin', 'index')),
  60. (T('Errors'), False, URL(
  61. 'admin', 'default', 'errors/' + app)),
  62. (T('About'), False, URL(
  63. 'admin', 'default', 'about/' + app)),
  64. ]),
  65. ('web2py.com', False, '#', [
  66. (T('Download'), False,
  67. 'http://www.web2py.com/examples/default/download'),
  68. (T('Support'), False,
  69. 'http://www.web2py.com/examples/default/support'),
  70. (T('Demo'), False, 'http://web2py.com/demo_admin'),
  71. (T('Quick Examples'), False,
  72. 'http://web2py.com/examples/default/examples'),
  73. (T('FAQ'), False, 'http://web2py.com/AlterEgo'),
  74. (T('Videos'), False,
  75. 'http://www.web2py.com/examples/default/videos/'),
  76. (T('Free Applications'),
  77. False, 'http://web2py.com/appliances'),
  78. (T('Plugins'), False, 'http://web2py.com/plugins'),
  79. (T('Recipes'), False, 'http://web2pyslices.com/'),
  80. ]),
  81. (T('Documentation'), False, '#', [
  82. (T('Online book'), False, 'http://www.web2py.com/book'),
  83. LI(_class="divider"),
  84. (T('Preface'), False,
  85. 'http://www.web2py.com/book/default/chapter/00'),
  86. (T('Introduction'), False,
  87. 'http://www.web2py.com/book/default/chapter/01'),
  88. (T('Python'), False,
  89. 'http://www.web2py.com/book/default/chapter/02'),
  90. (T('Overview'), False,
  91. 'http://www.web2py.com/book/default/chapter/03'),
  92. (T('The Core'), False,
  93. 'http://www.web2py.com/book/default/chapter/04'),
  94. (T('The Views'), False,
  95. 'http://www.web2py.com/book/default/chapter/05'),
  96. (T('Database'), False,
  97. 'http://www.web2py.com/book/default/chapter/06'),
  98. (T('Forms and Validators'), False,
  99. 'http://www.web2py.com/book/default/chapter/07'),
  100. (T('Email and SMS'), False,
  101. 'http://www.web2py.com/book/default/chapter/08'),
  102. (T('Access Control'), False,
  103. 'http://www.web2py.com/book/default/chapter/09'),
  104. (T('Services'), False,
  105. 'http://www.web2py.com/book/default/chapter/10'),
  106. (T('Ajax Recipes'), False,
  107. 'http://www.web2py.com/book/default/chapter/11'),
  108. (T('Components and Plugins'), False,
  109. 'http://www.web2py.com/book/default/chapter/12'),
  110. (T('Deployment Recipes'), False,
  111. 'http://www.web2py.com/book/default/chapter/13'),
  112. (T('Other Recipes'), False,
  113. 'http://www.web2py.com/book/default/chapter/14'),
  114. (T('Helping web2py'), False,
  115. 'http://www.web2py.com/book/default/chapter/15'),
  116. (T("Buy web2py's book"), False,
  117. 'http://stores.lulu.com/web2py'),
  118. ]),
  119. (T('Community'), False, None, [
  120. (T('Groups'), False,
  121. 'http://www.web2py.com/examples/default/usergroups'),
  122. (T('Twitter'), False, 'http://twitter.com/web2py'),
  123. (T('Live Chat'), False,
  124. 'http://webchat.freenode.net/?channels=web2py'),
  125. ]),
  126. ]
  127. if DEVELOPMENT_MENU: _()
  128. if "auth" in locals(): auth.wikimenu()