Commit 84972882 authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum

parent 4a208a14
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
} }
function renderDiscussionThread(gadget, must_declare, jio_key) { function renderDiscussionThread(gadget, must_declare, jio_key) {
return loadChildGadget(gadget, "gadget_erp5_pt_form_view.html", return loadChildGadget(gadget, "gadget_erp5_pt_form_dialog.html",
must_declare, function (form_gadget) { must_declare, function (form_gadget) {
var thread_info_dict; var thread_info_dict;
...@@ -143,13 +143,13 @@ ...@@ -143,13 +143,13 @@
['modification_date', 'Modification Date'] ['modification_date', 'Modification Date']
]; ];
field_dict.listbox = { field_dict.nutnut = {
"column_list": column_list, "column_list": column_list,
"show_anchor": 0, "show_anchor": 0,
"default_params": {}, "default_params": {},
"editable": 1, "editable": 1,
"editable_column_list": [], "editable_column_list": [],
"key": "field_listbox", "key": "field_nutnut",
"lines": 15, "lines": 15,
"list_method": "portal_catalog", "list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=" + Query.objectToSearchText( "query": "urn:jio:allDocs?query=" + Query.objectToSearchText(
...@@ -177,12 +177,40 @@ ...@@ -177,12 +177,40 @@
"search_column_list": [], "search_column_list": [],
"sort_column_list": [], "sort_column_list": [],
"sort": [['modification_date', 'ASC']], "sort": [['modification_date', 'ASC']],
"title": "Discussion Posts", "title": "Discussion Posts XXXXXXX",
"type": "ListBox" "type": "GadgetField",
"url": "gadget_thread_reader.html",
"sandbox": "",
"renderjs_extra": JSON.stringify({
query: "urn:jio:allDocs?query=" + Query.objectToSearchText(
new ComplexQuery({
operator: "AND",
query_list: [
new SimpleQuery({
key: "portal_type",
operator: "=",
type: "simple",
value: "Discussion Post"
}),
new SimpleQuery({
key: "parent_uid",
operator: "=",
type: "simple",
// XXX Check usual states
value: thread_info_dict.uid
})
],
type: "complex"
})
),
sort: [['modification_date', 'ASC']],
lines: 15,
}),
"hidden": 0
}; };
group_list.push([ group_list.push([
"bottom", "center",
[["listbox"]] [["nutnut"]]
], [ ], [
"hidden", ["listbox_modification_date"] "hidden", ["listbox_modification_date"]
]); ]);
...@@ -465,11 +493,12 @@ ...@@ -465,11 +493,12 @@
return; return;
}) })
.allowPublicAcquisition("jio_allDocs", function (param_list) { .allowPublicAcquisition("jio_allDocs", function (param_list, scope) {
// XXX Convert iso date to a DateTime field // XXX Convert iso date to a DateTime field
// XXX Paginate message to last message on modification date column // XXX Paginate message to last message on modification date column
var gadget = this, var gadget = this,
options = param_list[0]; options = param_list[0];
console.log(scope, param_list);
return gadget.jio_allDocs(options) return gadget.jio_allDocs(options)
.push(function (result) { .push(function (result) {
var i, date, len = result.data.total_rows; var i, date, len = result.data.total_rows;
...@@ -502,6 +531,7 @@ ...@@ -502,6 +531,7 @@
} }
}; };
} }
/*
if (result.data.rows[i].value.hasOwnProperty("asStrippedHTML")) { if (result.data.rows[i].value.hasOwnProperty("asStrippedHTML")) {
result.data.rows[i].value.asStrippedHTML = { result.data.rows[i].value.asStrippedHTML = {
url_value: { url_value: {
...@@ -523,6 +553,7 @@ ...@@ -523,6 +553,7 @@
} }
}; };
} }
*/
} }
return result; return result;
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>989.8969.7970.21555</string> </value> <value> <string>989.18879.37912.30737</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1609866799.64</float> <float>1610461438.43</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
<!DOCTYPE html>
<html>
<head>
<!--
data-i18n=No records
data-i18n=Records
data-i18n=Reset
data-i18n=Previous
data-i18n=Next
-->
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Thread Reader</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<!--script src="jiodev.js" type="text/javascript"></script-->
<script src="gadget_global.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_thread_reader.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ 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