Commit f421dcf8 authored by Romain Courteaud's avatar Romain Courteaud

romain_dev: forum set expected link on the listbox cells

parent bef9a834
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
column_list = [ column_list = [
['title', 'Title'], ['title', 'Title'],
['DiscussionThread_getDiscussionPostCount', 'Responses'], ['DiscussionThread_getDiscussionPostCount', 'Responses'],
['modification_date', 'Modification Date'] ['modification_date', 'Date']
]; ];
field_dict.listbox = { field_dict.listbox = {
...@@ -507,19 +507,31 @@ ...@@ -507,19 +507,31 @@
console.log(scope, param_list); 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,
key,
url_value;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("modification_date")) { url_value = {
date = new Date(result.data.rows[i].value.modification_date);
result.data.rows[i].value.modification_date = {
url_value: {
command: 'index', command: 'index',
options: { options: {
jio_key: result.data.rows[i].id, jio_key: result.data.rows[i].id,
page: gadget.state.page page: gadget.state.page
} }
}, };
field_gadget_param: {
for (key in result.data.rows[i].value) {
if (result.data.rows[i].value.hasOwnProperty(key)) {
result.data.rows[i].value[key] = {
url_value: url_value,
default: result.data.rows[i].value[key]
}
}
}
if (result.data.rows[i].value.hasOwnProperty("modification_date")) {
date = new Date(result.data.rows[i].value.modification_date.default);
result.data.rows[i].value.modification_date.field_gadget_param = {
allow_empty_time: 0, allow_empty_time: 0,
ampm_time_style: 0, ampm_time_style: 0,
css_class: "date_field", css_class: "date_field",
...@@ -534,7 +546,19 @@ ...@@ -534,7 +546,19 @@
timezone_style: 0, timezone_style: 0,
title: "Modification Date", title: "Modification Date",
type: "DateTimeField" type: "DateTimeField"
};
} }
if (result.data.rows[i].value.hasOwnProperty("DiscussionThread_getDiscussionPostCount")) {
result.data.rows[i].value.DiscussionThread_getDiscussionPostCount.field_gadget_param = {
description: "Count",
editable: 0,
hidden: 0,
"default": result.data.rows[i].value.DiscussionThread_getDiscussionPostCount.default,
key: "count",
required: 0,
title: "Responses",
type: "IntegerField"
}; };
} }
/* /*
......
...@@ -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.21570.59351.45277</string> </value> <value> <string>989.21920.50173.26606</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>1610622907.09</float> <float>1610644020.77</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