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
49665d94
Commit
49665d94
authored
Jan 06, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
romain_dev: up
parent
eaecab55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
34 deletions
+43
-34
bt5/romain_dev/SkinTemplateItem/portal_skins/romain_dev/testromain.py
...ev/SkinTemplateItem/portal_skins/romain_dev/testromain.py
+43
-34
No files found.
bt5/romain_dev/SkinTemplateItem/portal_skins/romain_dev/testromain.py
View file @
49665d94
...
@@ -4,38 +4,47 @@ post_per_thread_amount = 97
...
@@ -4,38 +4,47 @@ post_per_thread_amount = 97
max_new_document
=
100
max_new_document
=
100
tag
=
'POPULATE_FORUM'
tag
=
'POPULATE_FORUM'
after_tag
=
tag
+
'XXX'
if
(
current_project_uid
is
None
)
and
(
created_project_count
<
project_count
):
created_project_count
+=
1
if
(
current_project_uid
is
None
):
created_thread_count
=
0
if
(
created_project_count
<
project_count
):
created_post_count
=
0
created_project_count
+=
1
# no project, create
created_thread_count
=
0
project
=
context
.
project_module
.
newContent
(
created_post_count
=
0
portal_type
=
'Project'
,
# no project, create
title
=
'Forum project %i'
%
created_project_count
,
project
=
context
.
project_module
.
newContent
(
activate_kw
=
{
'tag'
:
tag
}
portal_type
=
'Project'
,
)
title
=
'Forum project %i'
%
created_project_count
,
return
context
.
activate
(
after_tag
=
tag
).
testromain
(
activate_kw
=
{
'tag'
:
tag
}
current_project_uid
=
project
.
getUid
(),
)
created_project_count
=
created_project_count
return
context
.
activate
(
after_tag
=
after_tag
).
testromain
(
)
current_project_uid
=
project
.
getUid
(),
created_project_count
=
created_project_count
if
(
current_thread_path
is
None
)
and
(
created_thread_count
<
thread_per_project_count
):
)
created_thread_count
+=
1
else
:
thread
=
context
.
discussion_thread_module
.
newContent
(
return
'stopping'
portal_type
=
'Discussion Thread'
,
title
=
'Forum project %i discussion %i'
%
(
created_project_count
,
created_thread_count
),
if
(
current_thread_path
is
None
):
follow_up_uid
=
current_project_uid
,
if
(
created_thread_count
<
thread_per_project_count
):
activate_kw
=
{
'tag'
:
tag
}
created_thread_count
+=
1
)
thread
=
context
.
discussion_thread_module
.
newContent
(
thread
.
share
()
portal_type
=
'Discussion Thread'
,
return
context
.
activate
(
after_tag
=
tag
).
testromain
(
title
=
'New Forum project %i discussion %i'
%
(
created_project_count
,
created_thread_count
),
current_project_uid
=
current_project_uid
,
follow_up_uid
=
current_project_uid
,
current_thread_path
=
thread
.
getRelativeUrl
(),
activate_kw
=
{
'tag'
:
tag
}
created_project_count
=
created_project_count
,
)
created_thread_count
=
created_thread_count
thread
.
share
()
)
return
context
.
activate
(
after_tag
=
after_tag
).
testromain
(
current_project_uid
=
current_project_uid
,
current_thread_path
=
thread
.
getRelativeUrl
(),
created_project_count
=
created_project_count
,
created_thread_count
=
created_thread_count
)
else
:
return
context
.
activate
(
after_tag
=
after_tag
).
testromain
(
created_project_count
=
created_project_count
)
if
(
current_thread_path
is
not
None
):
if
(
current_thread_path
is
not
None
):
if
(
created_post_count
<
post_per_thread_amount
):
if
(
created_post_count
<
post_per_thread_amount
):
...
@@ -48,7 +57,7 @@ if (current_thread_path is not None):
...
@@ -48,7 +57,7 @@ if (current_thread_path is not None):
activate_kw
=
{
'tag'
:
tag
}
activate_kw
=
{
'tag'
:
tag
}
)
)
# post.share()
# post.share()
return
context
.
activate
(
after_tag
=
tag
).
testromain
(
return
context
.
activate
(
after_tag
=
after_
tag
).
testromain
(
current_project_uid
=
current_project_uid
,
current_project_uid
=
current_project_uid
,
current_thread_path
=
current_thread_path
,
current_thread_path
=
current_thread_path
,
created_project_count
=
created_project_count
,
created_project_count
=
created_project_count
,
...
@@ -56,7 +65,7 @@ if (current_thread_path is not None):
...
@@ -56,7 +65,7 @@ if (current_thread_path is not None):
created_post_count
=
created_post_count
created_post_count
=
created_post_count
)
)
else
:
else
:
return
context
.
activate
(
after_tag
=
tag
).
testromain
(
return
context
.
activate
(
after_tag
=
after_
tag
).
testromain
(
current_project_uid
=
current_project_uid
,
current_project_uid
=
current_project_uid
,
created_project_count
=
created_project_count
,
created_project_count
=
created_project_count
,
created_thread_count
=
created_thread_count
created_thread_count
=
created_thread_count
...
...
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