Commit a79cbf73 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Improve Ticket view to render html messages and remove sort.

parent 052bf759
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
// This code can cause problems if it is used more them once per // This code can cause problems if it is used more them once per
// page // page
param_list[0].sort_on = [["modification_date", "ascending"]]; param_list[0].sort_on = [["modification_date", "ascending"]];
param_list[0].select_list = ["uid", "title", "text_content", "source_title", "modification_date"]; param_list[0].select_list = ["uid", "title", "text_content",
"source_title", "modification_date", "content_type"];
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, len = result.data.total_rows; var i, len = result.data.total_rows;
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"default": {doc: {title: result.data.rows[i].value.title, "default": {doc: {title: result.data.rows[i].value.title,
source: result.data.rows[i].value.source_title, source: result.data.rows[i].value.source_title,
modification_date: result.data.rows[i].value.modification_date, modification_date: result.data.rows[i].value.modification_date,
content_type: result.data.rows[i].value.content_type,
text_content: result.data.rows[i].value.text_content}}, text_content: result.data.rows[i].value.text_content}},
key: "status", key: "status",
url: "gadget_slapos_event_discussion_entry.html", url: "gadget_slapos_event_discussion_entry.html",
...@@ -180,8 +182,8 @@ ...@@ -180,8 +182,8 @@
"(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" + "(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" +
gadget.state.doc.reference, gadget.state.doc.reference,
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": [],
"sort_column_list": column_list, "sort_column_list": [],
"sort": [["text_content", "ascending"]], "sort": [["text_content", "ascending"]],
"title": "", "title": "",
"type": "ListBox" "type": "ListBox"
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.42348.2972.56524</string> </value> <value> <string>965.42459.5459.4164</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519225721.69</float> <float>1519232359.93</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
// This code can cause problems if it is used more them once per // This code can cause problems if it is used more them once per
// page // page
param_list[0].sort_on = [["modification_date", "ascending"]]; param_list[0].sort_on = [["modification_date", "ascending"]];
param_list[0].select_list = ["uid", "title", "text_content", "source_title", "modification_date"]; param_list[0].select_list = ["uid", "title", "text_content",
"source_title", "modification_date", "content_type"];
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, len = result.data.total_rows; var i, len = result.data.total_rows;
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"default": {doc: {title: result.data.rows[i].value.title, "default": {doc: {title: result.data.rows[i].value.title,
source: result.data.rows[i].value.source_title, source: result.data.rows[i].value.source_title,
modification_date: result.data.rows[i].value.modification_date, modification_date: result.data.rows[i].value.modification_date,
content_type: result.data.rows[i].value.content_type,
text_content: result.data.rows[i].value.text_content}}, text_content: result.data.rows[i].value.text_content}},
key: "status", key: "status",
url: "gadget_slapos_event_discussion_entry.html", url: "gadget_slapos_event_discussion_entry.html",
...@@ -180,8 +182,8 @@ ...@@ -180,8 +182,8 @@
"(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" + "(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" +
gadget.state.doc.reference, gadget.state.doc.reference,
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": [],
"sort_column_list": column_list, "sort_column_list": [],
"sort": [["text_content", "ascending"]], "sort": [["text_content", "ascending"]],
"title": "", "title": "",
"type": "ListBox" "type": "ListBox"
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.47.21452.47701</string> </value> <value> <string>965.42336.49617.6348</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519225005.36</float> <float>1519232298.79</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
// This code can cause problems if it is used more them once per // This code can cause problems if it is used more them once per
// page // page
param_list[0].sort_on = [["modification_date", "ascending"]]; param_list[0].sort_on = [["modification_date", "ascending"]];
param_list[0].select_list = ["uid", "title", "text_content", "source_title", "modification_date"]; param_list[0].select_list = ["uid", "title", "text_content",
"source_title", "modification_date", "content_type"];
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
var i, len = result.data.total_rows; var i, len = result.data.total_rows;
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
"default": {doc: {title: result.data.rows[i].value.title, "default": {doc: {title: result.data.rows[i].value.title,
source: result.data.rows[i].value.source_title, source: result.data.rows[i].value.source_title,
modification_date: result.data.rows[i].value.modification_date, modification_date: result.data.rows[i].value.modification_date,
content_type: result.data.rows[i].value.content_type,
text_content: result.data.rows[i].value.text_content}}, text_content: result.data.rows[i].value.text_content}},
key: "status", key: "status",
url: "gadget_slapos_event_discussion_entry.html", url: "gadget_slapos_event_discussion_entry.html",
...@@ -180,8 +182,8 @@ ...@@ -180,8 +182,8 @@
"(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" + "(%22Web Message%22, %22Mail Message%22)" + " AND default_follow_up_reference%3A" +
gadget.state.doc.reference, gadget.state.doc.reference,
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": [],
"sort_column_list": column_list, "sort_column_list": [],
"sort": [["text_content", "ascending"]], "sort": [["text_content", "ascending"]],
"title": "", "title": "",
"type": "ListBox" "type": "ListBox"
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.46.37492.55040</string> </value> <value> <string>965.42382.57800.29883</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1519225712.21</float> <float>1519232459.97</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -23,6 +23,15 @@ ...@@ -23,6 +23,15 @@
</div> </div>
</script> </script>
<script id="inline-html-event-template" type="text/x-handlebars-template">
<div class="slapos-event-discussion-message-header">
<p>By <strong>{{author}} </strong> on {{modification_date}}: </p>
</div>
<div class="slapos-event-discussion-message-body"></div>
</script>
</head> </head>
<body> <body>
......
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>ERP5TypeTestCase</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.3592.4882.12629</string> </value> <value> <string>965.42375.23341.30156</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509124641.18</float> <float>1519232226.72</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -7,7 +7,11 @@ ...@@ -7,7 +7,11 @@
inline_event_source = gadget_klass.__template_element inline_event_source = gadget_klass.__template_element
.getElementById("inline-event-template") .getElementById("inline-event-template")
.innerHTML, .innerHTML,
inline_status_template = Handlebars.compile(inline_event_source); inline_status_template = Handlebars.compile(inline_event_source),
inline_html_event_source = gadget_klass.__template_element
.getElementById("inline-html-event-template")
.innerHTML,
inline_html_status_template = Handlebars.compile(inline_event_source);
gadget_klass gadget_klass
...@@ -18,15 +22,18 @@ ...@@ -18,15 +22,18 @@
}) })
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this, var gadget = this,
template = inline_status_template,
source = options.value.doc.source, source = options.value.doc.source,
modification_date = options.value.doc.modification_date, modification_date = options.value.doc.modification_date,
text_content = options.value.doc.text_content, text_content = options.value.doc.text_content,
title = options.value.doc.title, title = options.value.doc.title,
queue = new RSVP.Queue(); content_type = options.value.doc.content_type;
console.log(options); return new RSVP.Queue()
return queue
.push(function () { .push(function () {
gadget.element.innerHTML = inline_status_template({ if (content_type === 'text/html') {
template = inline_html_status_template;
}
gadget.element.innerHTML = template({
title: title, title: title,
author: source, author: source,
modification_date: modification_date, modification_date: modification_date,
......
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>ERP5TypeTestCase</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.3632.57367.46882</string> </value> <value> <string>963.7958.61571.55040</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509126940.0</float> <float>1519227607.46</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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