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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
c8520763
Commit
c8520763
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
941626d0
Changes
4
Show 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 @
c8520763
...
@@ -141,72 +141,20 @@
...
@@ -141,72 +141,20 @@
// XXX implement pseudo getResultValue
// XXX implement pseudo getResultValue
thread_info_dict
=
result_list
.
data
.
rows
[
0
].
value
;
thread_info_dict
=
result_list
.
data
.
rows
[
0
].
value
;
var
group_list
=
[],
var
group_list
=
[],
field_dict
=
{},
field_dict
=
{};
column_list
=
[
[
'
asStrippedHTML
'
,
'
Content
'
],
[
'
modification_date
'
,
'
Modification Date
'
]
];
field_dict
.
nutnut
=
{
field_dict
.
nutnut
=
{
"
column_list
"
:
column_list
,
"
show_anchor
"
:
0
,
"
default_params
"
:
{},
"
editable
"
:
1
,
"
editable
"
:
1
,
"
editable_column_list
"
:
[],
"
key
"
:
THREAD_READER_FIELD_KEY
,
"
key
"
:
THREAD_READER_FIELD_KEY
,
"
lines
"
:
DISPLAYED_POST_COUNT
,
"
title
"
:
"
Discussion Posts
"
,
"
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
"
,
"
type
"
:
"
GadgetField
"
,
"
type
"
:
"
GadgetField
"
,
"
url
"
:
"
gadget_thread_reader.html
"
,
"
url
"
:
"
gadget_thread_reader.html
"
,
"
sandbox
"
:
""
,
"
sandbox
"
:
""
,
"
renderjs_extra
"
:
JSON
.
stringify
({
"
renderjs_extra
"
:
JSON
.
stringify
({
query
:
"
urn:jio:allDocs?query=
"
+
Query
.
objectToSearchText
(
query_dict
:
{
new
ComplexQuery
({
portal_type
:
'
Discussion Post
'
,
operator
:
"
AND
"
,
parent_uid
:
thread_info_dict
.
uid
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
'
],
[
'
uid
'
,
'
ASC
'
]],
sort
:
[[
'
modification_date
'
,
'
ASC
'
],
[
'
uid
'
,
'
ASC
'
]],
lines
:
DISPLAYED_POST_COUNT
lines
:
DISPLAYED_POST_COUNT
}),
}),
...
@@ -215,8 +163,6 @@
...
@@ -215,8 +163,6 @@
group_list
.
push
([
group_list
.
push
([
"
bottom
"
,
"
bottom
"
,
[[
"
nutnut
"
]]
[[
"
nutnut
"
]]
],
[
"
hidden
"
,
[
"
listbox_modification_date
"
]
]);
]);
return
form_gadget
.
render
({
return
form_gadget
.
render
({
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_forum_js.xml
View file @
c8520763
...
@@ -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.28
652.26663.41830
</string>
</value>
<value>
<string>
989.28
731.10123.62685
</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>
16110
47820.37
</float>
<float>
16110
52523.08
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/romain_dev/PathTemplateItem/web_page_module/romain_thread_reader_js.js
View file @
c8520763
/*jslint indent: 2, maxerr: 3, nomen: true */
/*jslint indent: 2, maxerr: 3, nomen: true */
/*global window, document, rJS, URI, RSVP, isEmpty, console, domsugar, Intl*/
/*global window, rJS, RSVP, console, domsugar, Intl, Query, SimpleQuery,
(
function
()
{
ComplexQuery*/
(
function
(
window
,
rJS
,
RSVP
,
console
,
domsugar
,
Intl
,
Query
,
SimpleQuery
,
ComplexQuery
)
{
"
use strict
"
;
"
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
)
{
function
getRelativeTimeString
(
language
,
current_date
,
date
)
{
var
diff
,
var
diff
,
abs
,
abs
,
...
@@ -112,7 +138,16 @@
...
@@ -112,7 +138,16 @@
return
gadget
.
changeState
({
return
gadget
.
changeState
({
key
:
options
.
key
,
key
:
options
.
key
,
language
:
result_dict
.
language
,
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
,
begin_from
:
parseInt
(
result_dict
.
begin_from
||
'
0
'
,
10
)
||
0
,
lines
:
options
.
lines
||
1
,
lines
:
options
.
lines
||
1
,
// Force line calculation in any case
// Force line calculation in any case
...
@@ -132,6 +167,10 @@
...
@@ -132,6 +167,10 @@
pagination_key
;
pagination_key
;
console
.
log
(
gadget
.
state
,
modification_dict
);
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
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
first_render
'
))
{
setPaginationElement
(
gadget
,
0
,
[]);
setPaginationElement
(
gadget
,
0
,
[]);
}
}
...
@@ -275,4 +314,5 @@
...
@@ -275,4 +314,5 @@
return
true
;
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 @
c8520763
...
@@ -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.2
7674.58520.17527
</string>
</value>
<value>
<string>
989.2
8725.48684.35566
</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>
161
0989162.51
</float>
<float>
161
1052202.34
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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