Commit cb3ed1c0 authored by hptk95's avatar hptk95 Committed by Papa Tamsir Kane

erp5_officejs: Bookmark Manager: Use Url module

* bookmark module -> url module
* url_string -> coordinate_text
* do not use text_content
* fix required fields
parent a528c15c
......@@ -202,7 +202,7 @@ gadget_html5_textarea.js\n
gadget_erp5_field_checkbox.html\n
gadget_erp5_field_checkbox.js\n
gadget_officejs_bookmark_manager_router.html\n
gadget_officejs_jio_bookmark_view.html\n
gadget_officejs_jio_url_view.html\n
gadget_officejs_jio_bookmark_view.js\n
gadget_erp5_page_ojs_add_bookmark.html\n
gadget_erp5_page_ojs_add_bookmark.js\n
......@@ -358,7 +358,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.40807.30284.14097</string> </value>
<value> <string>961.50649.27654.34781</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -376,7 +376,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1503579323.73</float>
<float>1504181844.13</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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="erp5_attachment_synchro" type="text/x-renderjs-configuration"></script>
......
......@@ -275,7 +275,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.16277.24517.44253</string> </value>
<value> <string>961.49448.1356.36437</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -293,7 +293,7 @@
</tuple>
<state>
<tuple>
<float>1503648762.54</float>
<float>1504096072.75</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -72,14 +72,14 @@
"hidden": 0,
"type": "StringField"
},
"my_url_string": {
"my_coordinate_text": {
"description": "",
"title": "Url",
"default": options.url_string || "",
"default": options.coordinate_text || "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "url_string",
"key": "coordinate_text",
"hidden": 0,
"type": "StringField"
},
......@@ -127,7 +127,7 @@
form_definition: {
group_list: [[
"left",
[["my_reference"], ["my_title"], ["my_url_string"], ["my_description"],
[["my_reference"], ["my_title"], ["my_coordinate_text"], ["my_description"],
["my_portal_type"], ["my_parent_relative_url"]]
]]
}
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.40804.27282.46165</string> </value>
<value> <string>961.49495.38480.31197</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1503577300.12</float>
<float>1504099935.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -25,22 +25,22 @@
command: 'display',
options: {
page: "ojs_add_bookmark",
url_string: parameter
coordinate_text: parameter
}
});
}
query = {
query: '(reference:"' + command + '")' +
' AND portal_type:"' + gadget.state.portal_type + '"',
select_list: ['url_string']
select_list: ['coordinate_text']
};
} else {
query = {
query: '(title:"%' + search +
'%" OR url_string:"%' + search +
'%" OR coordinate_text:"%' + search +
'%" OR description:"%' + search +
'%") AND portal_type:"' + gadget.state.portal_type + '"',
select_list: ['title', 'url_string', 'description']
select_list: ['title', 'coordinate_text', 'description']
};
}
return gadget.jio_allDocs(query)
......@@ -65,7 +65,7 @@
return gadget.redirect({
command: 'raw',
options: {
url: query_result.data.rows[0].value.url_string +
url: query_result.data.rows[0].value.coordinate_text +
parameter
}
});
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.10293.23355.24473</string> </value>
<value> <string>961.49415.17092.22306</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1501746582.52</float>
<float>1504099409.68</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -38,7 +38,7 @@
var column_list = [
['reference', 'Reference'],
['title', 'Title'],
['url_string', 'Url'],
['coordinate_text', 'Url'],
['description', 'Description']
];
return result[0].render({
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.9215.4122.51694</string> </value>
<value> <string>961.49415.17092.22306</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1501746703.37</float>
<float>1504099713.54</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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>
</script>
<script src="gadget_officejs_jio_bookmark_view.js"></script>
......
......@@ -63,6 +63,14 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
......@@ -75,7 +83,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>
......@@ -97,6 +105,12 @@
<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>title</string> </key>
<value> <string>OfficeJS Jio Bookmark View</string> </value>
......@@ -236,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.8981.40656.43178</string> </value>
<value> <string>961.49484.34054.54169</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1501746717.77</float>
<float>1504098066.74</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -45,10 +45,8 @@
doc = content;
content.portal_type = gadget.state.doc.portal_type;
content.parent_relative_url = gadget.state.doc.parent_relative_url;
content.text_content = gadget.state.doc.text_content;
} else {
doc = gadget.state.doc;
doc.text_content = content.text_content;
}
doc.modification_date = (new Date()).toUTCString();
return gadget.jio_put(gadget.state.jio_key, doc);
......@@ -68,7 +66,7 @@
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.translateHtml(template({url_string: gadget.state.doc.url_string}));
return gadget.translateHtml(template({coordinate_text: gadget.state.doc.coordinate_text}));
})
.push(function (html) {
gadget.element.querySelector('.template-view').innerHTML = html;
......@@ -94,20 +92,20 @@
"title": "Title",
"default": gadget.state.doc.title,
"css_class": "",
"required": 1,
"required": 0,
"editable": 1,
"key": "title",
"hidden": 0,
"type": "StringField"
},
"my_url_string": {
"my_coordinate_text": {
"description": "",
"title": "Url",
"default": gadget.state.doc.url_string,
"default": gadget.state.doc.coordinate_text,
"css_class": "",
"required": 0,
"required": 1,
"editable": 1,
"key": "url_string",
"key": "coordinate_text",
"hidden": 0,
"type": "StringField"
},
......@@ -133,7 +131,7 @@
form_definition: {
group_list: [[
"left",
[["my_reference"], ["my_title"], ["my_url_string"], ["my_description"]]
[["my_reference"], ["my_title"], ["my_coordinate_text"], ["my_description"]]
]]
}
});
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.40803.35937.59409</string> </value>
<value> <string>961.50752.48497.40618</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1503577301.58</float>
<float>1504174258.05</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -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];
......
......@@ -267,7 +267,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.44888.46554.50039</string> </value>
<value> <string>961.49452.62475.34167</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -285,7 +285,7 @@
</tuple>
<state>
<tuple>
<float>1498035961.94</float>
<float>1504096141.96</float>
<string>UTC</string>
</tuple>
</state>
......
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