You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

80 lines
2.1 KiB

  1. # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. # MIT License. See license.txt
  3. import webnotes
  4. def get_hooks():
  5. return {
  6. "app_include_js": ["assets/js/webnotes.min.js"],
  7. "app_include_css": ["assets/webnotes/css/splash.css", "assets/css/webnotes.css"],
  8. "desktop_icons": get_desktop_icons()
  9. }
  10. def after_install():
  11. # reset installed apps for re-install
  12. webnotes.conn.set_global("installed_apps", "[]")
  13. # core users / roles
  14. install_docs = [
  15. {'doctype':'Profile', 'name':'Administrator', 'first_name':'Administrator',
  16. 'email':'admin@localhost', 'enabled':1},
  17. {'doctype':'Profile', 'name':'Guest', 'first_name':'Guest',
  18. 'email':'guest@localhost', 'enabled':1},
  19. {'doctype':'UserRole', 'parent': 'Administrator', 'role': 'Administrator',
  20. 'parenttype':'Profile', 'parentfield':'user_roles'},
  21. {'doctype':'UserRole', 'parent': 'Guest', 'role': 'Guest',
  22. 'parenttype':'Profile', 'parentfield':'user_roles'},
  23. {'doctype': "Role", "role_name": "Report Manager"}
  24. ]
  25. for d in install_docs:
  26. webnotes.bean(d).insert()
  27. # all roles to admin
  28. webnotes.bean("Profile", "Administrator").get_controller().add_roles(*webnotes.conn.sql_list("""
  29. select name from tabRole"""))
  30. # update admin password
  31. from webnotes.auth import _update_password
  32. _update_password("Administrator", webnotes.conf.get("admin_password"))
  33. webnotes.conn.commit()
  34. def get_desktop_icons():
  35. return {
  36. "Calendar": {
  37. "color": "#2980b9",
  38. "icon": "icon-calendar",
  39. "label": "Calendar",
  40. "link": "Calendar/Event",
  41. "type": "view"
  42. },
  43. "Finder": {
  44. "color": "#14C7DE",
  45. "icon": "icon-folder-open",
  46. "label": "Finder",
  47. "link": "finder",
  48. "type": "page"
  49. },
  50. "Messages": {
  51. "color": "#9b59b6",
  52. "icon": "icon-comments",
  53. "label": "Messages",
  54. "link": "messages",
  55. "type": "page"
  56. },
  57. "To Do": {
  58. "color": "#f1c40f",
  59. "icon": "icon-check",
  60. "label": "To Do",
  61. "link": "todo",
  62. "type": "page"
  63. },
  64. "Website": {
  65. "color": "#16a085",
  66. "icon": "icon-globe",
  67. "link": "website-home",
  68. "type": "module"
  69. }
  70. }