25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
964 B

  1. # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
  2. # MIT License. See license.txt
  3. from __future__ import unicode_literals
  4. no_sitemap = 1
  5. no_cache = 1
  6. base_template_path = "templates/pages/desk.html"
  7. import os, json
  8. import frappe
  9. from frappe import _
  10. import frappe.sessions
  11. from frappe.utils.response import json_handler
  12. def get_context(context):
  13. if (frappe.session.user == "Guest" or
  14. frappe.db.get_value("User", frappe.session.user, "user_type")=="Website User"):
  15. frappe.throw(_("You are not permitted to access this page."), frappe.PermissionError)
  16. hooks = frappe.get_hooks()
  17. boot = frappe.sessions.get()
  18. return {
  19. "build_version": str(os.path.getmtime(os.path.join(frappe.local.sites_path, "assets", "js",
  20. "desk.min.js"))),
  21. "include_js": hooks["app_include_js"],
  22. "include_css": hooks["app_include_css"],
  23. "boot": frappe.as_json(boot),
  24. "background_image": boot.user.background_image or boot.default_background_image
  25. }