Commit 5836dae4 authored by Łukasz Nowak's avatar Łukasz Nowak

slapos_jio: De hard-code page for attention point

The page name shall come from Web Site configuration.
parent 8b4bc795
...@@ -21,31 +21,35 @@ ...@@ -21,31 +21,35 @@
}); });
function createAttentionPointTemplate(gadget, attention_point) { function createAttentionPointTemplate(gadget, attention_point) {
if (attention_point.link) { return gadget.getSetting("jio_document_page_gadget")
return gadget.getUrlFor({command: 'change', .push(function (result) {
options: {jio_key: attention_point.link, if (attention_point.link) {
"page": "slap_controller"}}) return gadget.getUrlFor({command: 'change',
.push(function (link) { options: {jio_key: attention_point.link,
return gadget.translateHtml(attention_point_item_template({ "page": result}})
.push(function (link) {
return gadget.translateHtml(attention_point_item_template({
option: [{
text: attention_point.text,
link: link
}]
}));
});
} else {
return gadget.translateHtml(attention_point_item_template({
option: [{ option: [{
text: attention_point.text, text: attention_point.text,
link: link link: attention_point.link
}] }]
})); }));
}); }
} else { });
return gadget.translateHtml(attention_point_item_template({
option: [{
text: attention_point.text,
link: attention_point.link
}]
}));
}
} }
gadget_klass gadget_klass
////////////////////////////////////////////// //////////////////////////////////////////////
// acquired method // acquired method
////////////////////////////////////////////// //////////////////////////////////////////////
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("trigger", "trigger") .declareAcquiredMethod("trigger", "trigger")
......
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