Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
75d302cd
Commit
75d302cd
authored
Jan 19, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
romain_dev: thread simplify conf from erp5form
parent
16701d39
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
68 deletions
+54
-68
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.js
...n_dev/PathTemplateItem/web_page_module/romain_forum_js.js
+6
-60
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.xml
..._dev/PathTemplateItem/web_page_module/romain_forum_js.xml
+2
-2
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
...thTemplateItem/web_page_module/romain_thread_reader_js.js
+44
-4
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.xml
...hTemplateItem/web_page_module/romain_thread_reader_js.xml
+2
-2
No files found.
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.js
View file @
75d302cd
...
...
@@ -141,72 +141,20 @@
// XXX implement pseudo getResultValue
thread_info_dict
=
result_list
.
data
.
rows
[
0
].
value
;
var
group_list
=
[],
field_dict
=
{},
column_list
=
[
[
'
asStrippedHTML
'
,
'
Content
'
],
[
'
modification_date
'
,
'
Modification Date
'
]
];
field_dict
=
{};
field_dict
.
nutnut
=
{
"
column_list
"
:
column_list
,
"
show_anchor
"
:
0
,
"
default_params
"
:
{},
"
editable
"
:
1
,
"
editable_column_list
"
:
[],
"
key
"
:
THREAD_READER_FIELD_KEY
,
"
lines
"
:
DISPLAYED_POST_COUNT
,
"
list_method
"
:
"
portal_catalog
"
,
"
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
"
})
),
"
portal_type
"
:
[
"
Discussion Post
"
],
"
search_column_list
"
:
[],
"
sort_column_list
"
:
[],
"
sort
"
:
[[
'
modification_date
'
,
'
ASC
'
]],
"
title
"
:
"
Discussion Posts XXXXXXX
"
,
"
title
"
:
"
Discussion Posts
"
,
"
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
"
})
),
query_dict
:
{
portal_type
:
'
Discussion Post
'
,
parent_uid
:
thread_info_dict
.
uid
},
sort
:
[[
'
modification_date
'
,
'
ASC
'
],
[
'
uid
'
,
'
ASC
'
]],
lines
:
DISPLAYED_POST_COUNT
}),
...
...
@@ -215,8 +163,6 @@
group_list
.
push
([
"
bottom
"
,
[[
"
nutnut
"
]]
],
[
"
hidden
"
,
[
"
listbox_modification_date
"
]
]);
return
form_gadget
.
render
({
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.xml
View file @
75d302cd
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.28
652.26663.41830
</string>
</value>
<value>
<string>
989.28
731.10123.62685
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
16110
47820.37
</float>
<float>
16110
52523.08
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
View file @
75d302cd
/*jslint indent: 2, maxerr: 3, nomen: true */
/*global window, document, rJS, URI, RSVP, isEmpty, console, domsugar, Intl*/
(
function
()
{
/*global window, rJS, RSVP, console, domsugar, Intl, Query, SimpleQuery,
ComplexQuery*/
(
function
(
window
,
rJS
,
RSVP
,
console
,
domsugar
,
Intl
,
Query
,
SimpleQuery
,
ComplexQuery
)
{
"
use strict
"
;
function
createMultipleSimpleOrQuery
(
key
,
value_list
)
{
var
i
,
query_list
=
[];
if
(
!
Array
.
isArray
(
value_list
))
{
value_list
=
[
value_list
];
}
for
(
i
=
0
;
i
<
value_list
.
length
;
i
+=
1
)
{
query_list
.
push
(
new
SimpleQuery
({
key
:
key
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
value_list
[
i
]
}));
}
if
(
value_list
.
len
===
1
)
{
return
query_list
[
0
];
}
return
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
}
function
getRelativeTimeString
(
language
,
current_date
,
date
)
{
var
diff
,
abs
,
...
...
@@ -112,7 +138,16 @@
return
gadget
.
changeState
({
key
:
options
.
key
,
language
:
result_dict
.
language
,
query_string
:
new
URI
(
options
.
query
).
query
(
true
).
query
||
''
,
query_string
:
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
"
AND
"
,
type
:
"
complex
"
,
query_list
:
Object
.
entries
(
options
.
query_dict
)
.
map
(
function
(
tuple
)
{
return
createMultipleSimpleOrQuery
(
tuple
[
0
],
tuple
[
1
]);
})
})
),
begin_from
:
parseInt
(
result_dict
.
begin_from
||
'
0
'
,
10
)
||
0
,
lines
:
options
.
lines
||
1
,
// Force line calculation in any case
...
...
@@ -132,6 +167,10 @@
pagination_key
;
console
.
log
(
gadget
.
state
,
modification_dict
);
if
(
!
gadget
.
state
.
query_string
)
{
throw
new
Error
(
'
No "query_dict" defined for
'
+
gadget
.
state
.
key
);
}
if
(
modification_dict
.
hasOwnProperty
(
'
first_render
'
))
{
setPaginationElement
(
gadget
,
0
,
[]);
}
...
...
@@ -275,4 +314,5 @@
return
true
;
});
}());
}(
window
,
rJS
,
RSVP
,
console
,
domsugar
,
Intl
,
Query
,
SimpleQuery
,
ComplexQuery
));
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.xml
View file @
75d302cd
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
989.2
7674.58520.17527
</string>
</value>
<value>
<string>
989.2
8725.48684.35566
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
161
0989162.51
</float>
<float>
161
1052202.34
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment