Commit 3c80a325 authored by Romain Courteaud's avatar Romain Courteaud Committed by Sebastien Robin

Add breadcrumb gadget to ease navigation

parent a1c67b06
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_breadcrumb.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_breadcrumb_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
<title>ERP5 Breadcrumb</title>\n
\n
<!-- renderjs -->\n
<script src="RSVP.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
\n
\n
<!-- custom script -->\n
<script src="gadget_erp5_breadcrumb.js" type="text/javascript"></script>\n
\n
</head>\n
<body>\n
<nav class="ui-title">\n
<div class="breadcrumb_container"></div>\n
<h1>ERP5</h1>\n
</nav>\n
\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Breadcrumb</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407249185.95</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.46085.31000.7680</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407318368.87</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407246316.11</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_breadcrumb.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_breadcrumb_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>/*global rJS, RSVP, jQuery, Handlebars,\n
promiseEventListener, console */\n
/*jslint nomen: true */\n
/*global window, rJS, RSVP, StatelessJS, alert, FormData, document, console */\n
/*jslint maxlen:200, nomen: true */\n
(function (window, rJS, RSVP) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window);\n
\n
gadget_klass\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
// Init local properties\n
.ready(function (g) {\n
g.props = {};\n
})\n
\n
// Assign the element to a variable\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
});\n
})\n
\n
.declareAcquiredMethod("whoWantToDisplayThis", "whoWantToDisplayThis")\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n
\n
var h1_element = this.props.element.querySelector("h1"),\n
parent_element = this.props.element.querySelector(".breadcrumb_container"),\n
title = options.title || "ERP5",\n
parent_link = options.parent_link,\n
gadget = this,\n
uri,\n
link_element;\n
\n
h1_element.textContent = title;\n
// Clear the previous rendering\n
while (parent_element.firstChild) {\n
parent_element.removeChild(parent_element.firstChild);\n
}\n
if (parent_link !== undefined) {\n
uri = new URI(parent_link.href);\n
return gadget.whoWantToDisplayThis(uri.segment(2))\n
.push(function (parent_href) {\n
link_element = document.createElement("a");\n
link_element.href = parent_href;\n
link_element.setAttribute("class", "responsive ui-btn ui-icon-carat-u ui-btn-icon-left");\n
link_element.setAttribute("data-role", "button");\n
link_element.setAttribute("role", "button");\n
link_element.textContent = parent_link.name;\n
parent_element.appendChild(link_element);\n
});\n
}\n
});\n
\n
}(window, rJS, RSVP));</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 Breadcrumb JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407255095.32</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.46052.59584.21316</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407318113.56</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1407246316.1</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -1271,29 +1271,13 @@ html .ui-card {\n
margin-top: 40%;\n
}\n
}\n
/* --------------------- CUSTOM GRAPH ----------------------- */\n
/* \n
.custom-graph {\n
width: 100%;\n
min-width: 1px;\n
height: 10vw;\n
max-height: 100%;\n
min-height: 100%;\n
}\n
*/\n
.custom-graph-wrap { \n
position: relative; \n
width: 100%;\n
} \n
.custom-graph-wrap:before { \n
content: ""; \n
display: block; \n
padding-top: 100%; / initial ratio of 1:1*/ \n
} \n
.custom-graph { \n
position: absolute; top: 0; left: 0; bottom: 0; right: 0; \n
}\n
/* -------------------- BREADCRUMB ----------------------------- */\n
html.ui-mobile body nav.ui-title {\n
padding: 0;\n
}\n
.breadcrumb_container {\n
float: left;\n
}
]]></string> </value>
</item>
......@@ -1430,7 +1414,7 @@ html .ui-card {\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.45990.31586.6963</string> </value>
<value> <string>936.46087.64931.62208</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -1448,7 +1432,7 @@ html .ui-card {\n
</tuple>
<state>
<tuple>
<float>1407312414.38</float>
<float>1407318319.6</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -137,7 +137,11 @@
\n
<header data-role="header">\n
<a href="#leftpanel" class="responsive ui-btn ui-icon-bars ui-btn-icon-left">Menu</a>\n
<h1>ERP5</h1>\n
<div data-gadget-url="gadget_erp5_breadcrumb.html"\n
data-gadget-scope="breadcrumb"\n
data-gadget-sandbox="public"></div>\n
</div>\n
\n
<a href="#" class="responsive ui-btn ui-icon-home ui-btn-icon-left">Home</a>\n
</header>\n
\n
......@@ -272,7 +276,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>sven</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -286,7 +290,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.39090.50399.1467</string> </value>
<value> <string>936.46013.38940.47974</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -304,7 +308,7 @@
</tuple>
<state>
<tuple>
<float>1406898950.5</float>
<float>1407314211.01</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -127,10 +127,12 @@
});\n
}\n
function renderFrontpage(gadget, options) {\n
document.querySelector("h1").textContent = "ERP5";\n
\n
return gadget.declareGadget(gadget.props.frontpage_gadget, {\n
scope: "frontpage_gadget"\n
return gadget.props.breadcrumb_gadget.render({title: "ERP5"})\n
.push(function () {\n
return gadget.declareGadget(gadget.props.frontpage_gadget, {\n
scope: "frontpage_gadget"\n
})\n
})\n
.push(function (sub_gadget) {\n
return RSVP.all([\n
......@@ -141,10 +143,12 @@
}\n
\n
function renderLoginForm(gadget, options) {\n
document.querySelector("h1").textContent = "Login";\n
\n
return gadget.declareGadget("gadget_erp5_pt_loginform.html", {\n
scope: "login_gadget"\n
\n
return gadget.props.breadcrumb_gadget.render({title: "Login"})\n
.push(function () {\n
return gadget.declareGadget("gadget_erp5_pt_loginform.html", {\n
scope: "login_gadget"\n
})\n
})\n
.push(function (sub_gadget) {\n
return RSVP.all([\n
......@@ -155,7 +159,8 @@
}\n
\n
function renderJioDocument(gadget, options) {\n
var sub_options;\n
var sub_options,\n
breadcrumb_options = {};\n
return gadget.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
var jio_key = options.jio_key,\n
......@@ -168,7 +173,8 @@
return jio_gadget.get({"_id": jio_key}, {"_view": view});\n
})\n
.push(function (result) {\n
document.querySelector("h1").textContent = result.data.title || result.data.reference || options.jio_key;\n
breadcrumb_options.title = result.data.title || result.data.reference || options.jio_key;\n
breadcrumb_options.parent_link = result.data._links.parent;\n
var uri = new URI(\n
result.data._embedded._view._links.form_definition.href\n
);\n
......@@ -201,7 +207,8 @@
.push(function (form_gadget) {\n
return RSVP.all([\n
form_gadget.render(sub_options),\n
form_gadget.getElement()\n
form_gadget.getElement(),\n
gadget.props.breadcrumb_gadget.render(breadcrumb_options)\n
]);\n
})\n
}\n
......@@ -223,6 +230,10 @@
action_view: "action_object_view",\n
default_view_reference: "view",\n
};\n
return g.getDeclaredGadget("breadcrumb")\n
.push(function (sub_gadget) {\n
g.props.breadcrumb_gadget = sub_gadget;\n
});\n
})\n
\n
// Configure jIO to use localstorage\n
......@@ -504,7 +515,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.39106.20352.50858</string> </value>
<value> <string>936.45060.38036.50312</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -522,7 +533,7 @@
</tuple>
<state>
<tuple>
<float>1406899461.59</float>
<float>1407311956.87</float>
<string>GMT</string>
</tuple>
</state>
......
36
\ No newline at end of file
37
\ No newline at end of file
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