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 ...@@ -1271,29 +1271,13 @@ html .ui-card {\n
margin-top: 40%;\n margin-top: 40%;\n
}\n }\n
}\n }\n
/* --------------------- CUSTOM GRAPH ----------------------- */\n /* -------------------- BREADCRUMB ----------------------------- */\n
/* \n html.ui-mobile body nav.ui-title {\n
.custom-graph {\n padding: 0;\n
width: 100%;\n }\n
min-width: 1px;\n .breadcrumb_container {\n
height: 10vw;\n float: left;\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
]]></string> </value> ]]></string> </value>
</item> </item>
...@@ -1430,7 +1414,7 @@ html .ui-card {\n ...@@ -1430,7 +1414,7 @@ html .ui-card {\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.45990.31586.6963</string> </value> <value> <string>936.46087.64931.62208</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -1448,7 +1432,7 @@ html .ui-card {\n ...@@ -1448,7 +1432,7 @@ html .ui-card {\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1407312414.38</float> <float>1407318319.6</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -137,7 +137,11 @@ ...@@ -137,7 +137,11 @@
\n \n
<header data-role="header">\n <header data-role="header">\n
<a href="#leftpanel" class="responsive ui-btn ui-icon-bars ui-btn-icon-left">Menu</a>\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 <a href="#" class="responsive ui-btn ui-icon-home ui-btn-icon-left">Home</a>\n
</header>\n </header>\n
\n \n
...@@ -272,7 +276,7 @@ ...@@ -272,7 +276,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>sven</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -286,7 +290,7 @@ ...@@ -286,7 +290,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.39090.50399.1467</string> </value> <value> <string>936.46013.38940.47974</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -304,7 +308,7 @@ ...@@ -304,7 +308,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1406898950.5</float> <float>1407314211.01</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
...@@ -127,10 +127,12 @@ ...@@ -127,10 +127,12 @@
});\n });\n
}\n }\n
function renderFrontpage(gadget, options) {\n function renderFrontpage(gadget, options) {\n
document.querySelector("h1").textContent = "ERP5";\n
\n \n
return gadget.declareGadget(gadget.props.frontpage_gadget, {\n return gadget.props.breadcrumb_gadget.render({title: "ERP5"})\n
scope: "frontpage_gadget"\n .push(function () {\n
return gadget.declareGadget(gadget.props.frontpage_gadget, {\n
scope: "frontpage_gadget"\n
})\n
})\n })\n
.push(function (sub_gadget) {\n .push(function (sub_gadget) {\n
return RSVP.all([\n return RSVP.all([\n
...@@ -141,10 +143,12 @@ ...@@ -141,10 +143,12 @@
}\n }\n
\n \n
function renderLoginForm(gadget, options) {\n function renderLoginForm(gadget, options) {\n
document.querySelector("h1").textContent = "Login";\n \n
\n return gadget.props.breadcrumb_gadget.render({title: "Login"})\n
return gadget.declareGadget("gadget_erp5_pt_loginform.html", {\n .push(function () {\n
scope: "login_gadget"\n return gadget.declareGadget("gadget_erp5_pt_loginform.html", {\n
scope: "login_gadget"\n
})\n
})\n })\n
.push(function (sub_gadget) {\n .push(function (sub_gadget) {\n
return RSVP.all([\n return RSVP.all([\n
...@@ -155,7 +159,8 @@ ...@@ -155,7 +159,8 @@
}\n }\n
\n \n
function renderJioDocument(gadget, options) {\n function renderJioDocument(gadget, options) {\n
var sub_options;\n var sub_options,\n
breadcrumb_options = {};\n
return gadget.getDeclaredGadget("jio_gadget")\n return gadget.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n .push(function (jio_gadget) {\n
var jio_key = options.jio_key,\n var jio_key = options.jio_key,\n
...@@ -168,7 +173,8 @@ ...@@ -168,7 +173,8 @@
return jio_gadget.get({"_id": jio_key}, {"_view": view});\n return jio_gadget.get({"_id": jio_key}, {"_view": view});\n
})\n })\n
.push(function (result) {\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 var uri = new URI(\n
result.data._embedded._view._links.form_definition.href\n result.data._embedded._view._links.form_definition.href\n
);\n );\n
...@@ -201,7 +207,8 @@ ...@@ -201,7 +207,8 @@
.push(function (form_gadget) {\n .push(function (form_gadget) {\n
return RSVP.all([\n return RSVP.all([\n
form_gadget.render(sub_options),\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 })\n
}\n }\n
...@@ -223,6 +230,10 @@ ...@@ -223,6 +230,10 @@
action_view: "action_object_view",\n action_view: "action_object_view",\n
default_view_reference: "view",\n default_view_reference: "view",\n
};\n };\n
return g.getDeclaredGadget("breadcrumb")\n
.push(function (sub_gadget) {\n
g.props.breadcrumb_gadget = sub_gadget;\n
});\n
})\n })\n
\n \n
// Configure jIO to use localstorage\n // Configure jIO to use localstorage\n
...@@ -504,7 +515,7 @@ ...@@ -504,7 +515,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>936.39106.20352.50858</string> </value> <value> <string>936.45060.38036.50312</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -522,7 +533,7 @@ ...@@ -522,7 +533,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1406899461.59</float> <float>1407311956.87</float>
<string>GMT</string> <string>GMT</string>
</tuple> </tuple>
</state> </state>
......
36 37
\ No newline at end of file \ 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