Commit 29590cd7 authored by Papa Tamsir Kane's avatar Papa Tamsir Kane

erp5_officejs: Use url_module in Bookmark Manager

* bookmark_module -> url_module
* portal Bookmark -> portal Url
* url_string -> coordinate_text
parent d0e9a3a8
......@@ -14,8 +14,8 @@
</head>
<body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Bookmark</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">bookmark_module</script>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Url</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">url_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Bookmark</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script>
<script data-renderjs-configuration="global_setting_gadget_url" type="text/x-renderjs-configuration">../officejs_setting_gadget/development/</script>
......
......@@ -7,8 +7,8 @@
var i,
doc = gadget.options.doc,
now = new Date();
doc.parent_relative_url = "bookmark_module";
doc.portal_type = "Bookmark";
doc.parent_relative_url = "url_module";
doc.portal_type = "Url";
doc.modification_date = now.toISOString();
for (i = 0; i < submit_event.target.length; i += 1) {
// XXX Should check input type instead
......
......@@ -11,7 +11,7 @@
<script src="handlebars.js"></script>
<script class="view-web-page-template" type="text/x-handlebars-template">
<a href="{{url_string}}" style="display: block; text-align: center; font-size: 1.7em;">{{url_string}}</a>
<a href="{{coordinate_text}}" style="display: block; text-align: center; font-size: 1.7em;">{{coordinate_text}}</a>
<form class="view-web-page-form">
<div class="center">
<div class="ui-field-contain">
......@@ -24,7 +24,7 @@
</div>
<div class="ui-field-contain">
<label data-i18n="Url:">Url:</label>
<input type="text" name="url_string" value="{{url_string}}">
<input type="text" name="coordinate_text" value="{{coordinate_text}}">
</div>
<div class="ui-field-contain">
......
......@@ -75,7 +75,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_jio_bookmark_view.html</string> </value>
<value> <string>gadget_officejs_jio_url_view.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -85,7 +85,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_bookmark_view_html</string> </value>
<value> <string>gadget_officejs_jio_url_view_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......
......@@ -53,7 +53,7 @@
.push(function () {
var doc = {
// XXX Hardcoded
url_string: gadget.props.options.url_string,
coordinate_text: gadget.props.options.coordinate_text,
parent_relative_url: gadget.props.parent_relative_url,
portal_type: gadget.props.portal_type
};
......
......@@ -83,7 +83,7 @@
if (command === "add") {
return gadget.getUrlFor({
page: "add_bookmark",
url_string: parameter
coordinate_text: parameter
}).push(function (url) {
window.location.href = url;
});
......@@ -91,12 +91,12 @@
query = {
query: '(reference:"' + command + '")'
+ ' AND portal_type:"' + portal_type + '"',
select_list: ['url_string']
select_list: ['coordinate_text']
};
} else {
query = {
query: '(title:"%' + search + '%" OR url_string:"%' + search + '%" OR description:"%' + search + '%") AND portal_type:"' + portal_type + '"',
select_list: ['title', 'url_string', 'description'],
query: '(title:"%' + search + '%" OR coordinate_text:"%' + search + '%" OR description:"%' + search + '%") AND portal_type:"' + portal_type + '"',
select_list: ['title', 'coordinate_text', 'description'],
};
}
return gadget.jio_allDocs(query)
......@@ -109,7 +109,7 @@
} else if (result_list_length === 1
&& (option.auto_redirect === true || command !== "")) {
// if 1 result, and redirect or command ,we go there
window.location.href = query_result.data.rows[0].value.url_string
window.location.href = query_result.data.rows[0].value.coordinate_text
+ parameter;
}
else {
......
......@@ -91,7 +91,7 @@
select: 'title',
title: 'Title'
}, {
select: 'url_string',
select: 'coordinate_text',
title: 'URL'
}, {
select: 'description',
......@@ -99,7 +99,7 @@
}],
query: {
query: 'portal_type:("' + gadget.props.portal_type + '")',
select_list: ['reference', 'title', 'url_string', 'description'],
select_list: ['reference', 'title', 'coordinate_text', 'description'],
limit: [0, 30],
sort_on: [["modification_date", "descending"]]
}
......
......@@ -70,7 +70,7 @@
.push(function (answer_list) {
gadget.props.portal_type = answer_list[0];
// Hardcoded For Bookmark View
if (gadget.props.portal_type === "Bookmark") {
if (gadget.props.portal_type === "Url") {
return gadget.redirect({"page": "bookmark_list" });
}
gadget.props.document_title_plural = answer_list[1];
......
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