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

Add breadcrumb gadget to ease navigation

parent a1c67b06
......@@ -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,11 +127,13 @@
});\n
}\n
function renderFrontpage(gadget, options) {\n
document.querySelector("h1").textContent = "ERP5";\n
\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
sub_gadget.render(),\n
......@@ -141,11 +143,13 @@
}\n
\n
function renderLoginForm(gadget, options) {\n
document.querySelector("h1").textContent = "Login";\n
\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
sub_gadget.render(),\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