(self, site, path, inner_path, title, extra_headers, show_loadingscreen=None, script_nonce=None)
| 417 | return query_string |
| 418 | |
| 419 | def renderWrapper(self, site, path, inner_path, title, extra_headers, show_loadingscreen=None, script_nonce=None): |
| 420 | file_inner_path = inner_path |
| 421 | if not file_inner_path: |
| 422 | file_inner_path = "index.html" # If inner path defaults to index.html |
| 423 | |
| 424 | if file_inner_path.endswith("/"): |
| 425 | file_inner_path = file_inner_path + "index.html" |
| 426 | |
| 427 | address = re.sub("/.*", "", path.lstrip("/")) |
| 428 | if self.isProxyRequest() and (not path or "/" in path[1:]): |
| 429 | if self.env["HTTP_HOST"] == "zero": |
| 430 | root_url = "/" + address + "/" |
| 431 | file_url = "/" + address + "/" + inner_path |
| 432 | else: |
| 433 | file_url = "/" + inner_path |
| 434 | root_url = "/" |
| 435 | |
| 436 | else: |
| 437 | file_url = "/" + address + "/" + inner_path |
| 438 | root_url = "/" + address + "/" |
| 439 | |
| 440 | if self.isProxyRequest(): |
| 441 | self.server.allowed_ws_origins.add(self.env["HTTP_HOST"]) |
| 442 | |
| 443 | # Wrapper variable inits |
| 444 | body_style = "" |
| 445 | meta_tags = "" |
| 446 | postmessage_nonce_security = "false" |
| 447 | |
| 448 | wrapper_nonce = self.getWrapperNonce() |
| 449 | inner_query_string = self.processQueryString(site, self.env.get("QUERY_STRING", "")) |
| 450 | |
| 451 | if inner_query_string: |
| 452 | inner_query_string = "?%s&wrapper_nonce=%s" % (inner_query_string, wrapper_nonce) |
| 453 | elif "?" in inner_path: |
| 454 | inner_query_string = "&wrapper_nonce=%s" % wrapper_nonce |
| 455 | else: |
| 456 | inner_query_string = "?wrapper_nonce=%s" % wrapper_nonce |
| 457 | |
| 458 | if self.isProxyRequest(): # Its a remote proxy request |
| 459 | homepage = "http://zero/" + config.homepage |
| 460 | else: # Use relative path |
| 461 | homepage = "/" + config.homepage |
| 462 | |
| 463 | server_url = self.getWsServerUrl() # Real server url for WS connections |
| 464 | |
| 465 | user = self.getCurrentUser() |
| 466 | if user: |
| 467 | theme = user.settings.get("theme", "light") |
| 468 | else: |
| 469 | theme = "light" |
| 470 | |
| 471 | themeclass = "theme-%-6s" % re.sub("[^a-z]", "", theme) |
| 472 | |
| 473 | if site.content_manager.contents.get("content.json"): # Got content.json |
| 474 | content = site.content_manager.contents["content.json"] |
| 475 | if content.get("background-color"): |
| 476 | background_color = content.get("background-color-%s" % theme, content["background-color"]) |
no test coverage detected