Commit 2651d738 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_xhtml_style: Move most of <head> block into macros.

To encourage creation of alternative templates for web mode,
as this template must not be used outside of ERP5-style UI
(aka "ERP5 XHTML Style").
parent 45ea4500
...@@ -76,6 +76,50 @@ ...@@ -76,6 +76,50 @@
global selected_language portal/Localizer/get_selected_language;\n global selected_language portal/Localizer/get_selected_language;\n
" />\n " />\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="header_boilerplate">\n
<base tal:attributes="href string:${url}/" />\n
<meta name="description" tal:attributes="content description | title | string:ERP5 Free Open Source ERP and CRM" />\n
<meta name="keywords" tal:attributes="content python:\', \'.join(subject_list)" />\n
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n
<meta http-equiv="Content-Script-Type" content="text/javascript" />\n
<meta http-equiv="Content-Style-Type" content="text/css" />\n
<title\n
tal:define="\n
title title | string:ERP5;\n
header_title header_title | nothing;\n
"\n
tal:content="python: header_title or \'%s | %s\' % (title, here.getPortalObject().title_or_id())"\n
></title>\n
</tal:block>\n
<tal:block metal:define-macro="render_css_js">\n
<link\n
tal:repeat="css python: css_list"\n
tal:attributes="href python: css"\n
type="text/css"\n
rel="stylesheet"\n
/>\n
<tal:block\n
tal:condition="python: form is not None"\n
tal:repeat="field python: [field for group in form.get_groups(include_empty=0) if group != \'hidden\' for field in form.get_fields_in_group(group)]"\n
>\n
<style\n
tal:define="css python: field.render_css(REQUEST=request)"\n
tal:condition="python: css"\n
tal:content="python: css"\n
type="text/css"></style>\n
<tal:block tal:define="dummy python: js_list.extend(field.get_javascript_list(REQUEST=request))" />\n
</tal:block>\n
<tal:block\n
tal:define="known python: set()"\n
tal:repeat="js python: js_list"\n
><tal:block\n
tal:condition="python: js not in known"\n
><script\n
tal:define="dummy python: known.add(js)"\n
tal:attributes="src js"\n
type="text/javascript"\n
></script></tal:block></tal:block>\n
</tal:block>\n
<tal:block metal:define-macro="http_definitions">\n <tal:block metal:define-macro="http_definitions">\n
<tal:block tal:replace="structure python: modules[\'ZTUtils\'].make_hidden_input(**http_parameter_list)" />\n <tal:block tal:replace="structure python: modules[\'ZTUtils\'].make_hidden_input(**http_parameter_list)" />\n
</tal:block>\n </tal:block>\n
......
...@@ -43,56 +43,26 @@ ...@@ -43,56 +43,26 @@
<!--\n <!--\n
IDEAS:\n IDEAS:\n
- Add callbacks to ERP5Form object (selection ?) to gather needed fields -> put them in http_parameter_list.\n - Add callbacks to ERP5Form object (selection ?) to gather needed fields -> put them in http_parameter_list.\n
\n
DEPRECATION:\n
- "head" and "layout" slots are deprecated\n
-->\n -->\n
</tal:block>\n </tal:block>\n
<tal:block metal:define-macro="master">\n <tal:block metal:define-macro="master">\n
<tal:block tal:define="global_definitions_macros here/global_definitions/macros;\n <tal:block tal:define="\n
subject_list subject_list | python:here.getProperty(\'subject_list\', []) or []">\n dummy python: here.Base_checkUserCanViewERP5XHTMLStyleOrRaise();\n
global_definitions_macros here/global_definitions/macros;\n
subject_list subject_list | python:here.getProperty(\'subject_list\', []) or [];\n
">\n
<tal:block metal:use-macro="global_definitions_macros/header_definitions" />\n <tal:block metal:use-macro="global_definitions_macros/header_definitions" />\n
<!DOCTYPE html>\n <!DOCTYPE html>\n
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n
<head>\n <head>\n
<base tal:attributes="href python: \'%s/\' % (url, )" />\n <tal:block metal:use-macro="global_definitions_macros/header_boilerplate" />\n
<meta name="generator" content="ERP5 - Copyright (C) 2001 - 2008. All rights reserved." />\n <meta name="generator" content="ERP5 - Copyright (C) 2001 - 2015. All rights reserved." />\n
<meta name="description" content=""\n
tal:attributes="content description | title | string:ERP5 Free Open Source ERP and CRM" />\n
<meta name="keywords" content=""\n
tal:attributes="content python:\', \'.join(subject_list)" />\n
<meta name="robots" content="index, follow" />\n <meta name="robots" content="index, follow" />\n
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n <tal:block metal:use-macro="global_definitions_macros/render_css_js" />\n
<meta http-equiv="X-UA-Compatible" content="IE=edge">\n <tal:block metal:define-slot="head"></tal:block>\n
<meta http-equiv="Content-Script-Type" content="text/javascript" />\n
<meta http-equiv="Content-Style-Type" content="text/css" />\n
<title tal:define="title title | string:ERP5;\n
header_title header_title | nothing"\n
tal:content="python:header_title or \'%s | %s\' % (title, here.getPortalObject().title_or_id())"></title>\n
<tal:block tal:repeat="css css_list">\n
<link tal:attributes="href css" type="text/css" rel="stylesheet" />\n
</tal:block>\n
<tal:block tal:replace="nothing">\n
<!-- Render each field\'s css and javascript. -->\n
</tal:block>\n
<tal:block tal:condition="python: form is not None">\n
<tal:block tal:repeat="group python: [x for x in form.get_groups(include_empty=0) if x != \'hidden\']">\n
<tal:block tal:repeat="field python: form.get_fields_in_group(group)">\n
<tal:block tal:define="css python: field.render_css(REQUEST=request)">\n
<style tal:condition="python: css is not None"\n
tal:content="css"\n
tal:attributes="type python:\'text/css\'">\n
</style>\n
</tal:block>\n
<tal:block tal:define="dummy python: js_list.extend(x for x in field.get_javascript_list(REQUEST=request) if not (x in js_list))" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
<tal:block tal:repeat="js js_list">\n
<script tal:attributes="src js" type="text/javascript"></script>\n
</tal:block>\n
<link rel="icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" />\n
<link rel="shortcut icon" tal:attributes="href string:${portal_path}/favicon.ico" type="image/x-icon" />\n
<tal:block metal:define-slot="head">\n
<!-- this is a placeholder for different extensions to head which could be required by web themes -->\n
</tal:block>\n
</head>\n </head>\n
<body tal:attributes="class body_css_class|nothing">\n <body tal:attributes="class body_css_class|nothing">\n
<form id="main_form"\n <form id="main_form"\n
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment