Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
comment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
comment
Commits
380ac8079ae3
Commit
380ac8079ae3
authored
16 years ago
by
sylvain thenault
Browse files
Options
Downloads
Patches
Plain Diff
minor refactoring, use optional relation to get creator
parent
4c96b71b1c1b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views.py
+15
-13
15 additions, 13 deletions
views.py
with
15 additions
and
13 deletions
views.py
+
15
−
13
View file @
380ac807
...
...
@@ -237,15 +237,6 @@
req
=
self
.
req
req
.
add_js
(
(
'
cubicweb.ajax.js
'
,
'
cubes.comment.js
'
)
)
eid
=
self
.
rset
[
0
][
0
]
if
orderby
==
'
author
'
:
rql
=
u
'
Any C,CD,CC,CCF,U,UL,US,UF ORDERBY UL WHERE C is Comment,
'
\
'
C comments X, C creation_date CD, C content CC, C content_format CCF,
'
\
'
C created_by U, U login UL, U firstname UF, U surname US, X eid %(x)s
'
else
:
# orderby == 'diem'
rql
=
u
'
Any C,CD,CC,CCF,U,UL,US,UF ORDERBY CD WHERE C is Comment,
'
\
'
C comments X, C creation_date CD, C content CC, C content_format CCF,
'
\
'
C created_by U, U login UL, U firstname UF, U surname US, X eid %(x)s
'
rset
=
req
.
execute
(
rql
,
{
'
x
'
:
eid
},
'
x
'
)
self
.
w
(
u
'
<div id=
"
%s
"
class=
"
%s
"
cubicweb:rooteid=
"
%s
"
>
'
%
(
self
.
div_id
(),
self
.
div_class
(),
eid
))
action
=
self
.
vreg
.
select_action
(
'
reply_comment
'
,
req
,
self
.
rset
,
row
=
0
)
...
...
@@ -257,7 +248,19 @@
req
.
add_js
(
'
fckeditor.js
'
)
req
.
fckeditor_config
()
else
:
reply
=
u
''
reply
=
u
''
if
orderby
==
'
author
'
:
rql
=
u
'
Any C,CD,CC,CCF,U,UL,US,UF ORDERBY UL WHERE C is Comment,
'
\
'
C comments X, C creation_date CD, C content CC, C content_format CCF,
'
\
'
C created_by U?, U login UL, U firstname UF, U surname US, X eid %(x)s
'
else
:
# orderby == 'diem'
rql
=
u
'
Any C,CD,CC,CCF,U,UL,US,UF ORDERBY CD WHERE C is Comment,
'
\
'
C comments X, C creation_date CD, C content CC, C content_format CCF,
'
\
'
C created_by U?, U login UL, U firstname UF, U surname US, X eid %(x)s
'
from
cubicweb.server
import
set_debug
set_debug
(
True
)
rset
=
req
.
execute
(
rql
,
{
'
x
'
:
eid
},
'
x
'
)
set_debug
(
False
)
if
rset
.
rowcount
:
self
.
w
(
u
'
<h4>%s</h4>%s
'
%
(
req
.
_
(
'
Comment_plural
'
),
reply
))
self
.
w
(
u
'
<div id=
"
comment%sHolder
"
></div>
'
%
eid
)
...
...
@@ -265,5 +268,5 @@
for
i
in
xrange
(
rset
.
rowcount
):
self
.
wview
(
'
tree
'
,
rset
,
row
=
i
,
full
=
True
)
self
.
w
(
u
'
</ul>
'
)
el
se
:
el
if
reply
:
self
.
w
(
reply
)
...
...
@@ -269,6 +272,5 @@
self
.
w
(
reply
)
if
reply
:
self
.
w
(
u
'
<div id=
"
comment%sHolder
"
></div>
'
%
eid
)
self
.
w
(
u
'
<div id=
"
comment%sHolder
"
></div>
'
%
eid
)
self
.
w
(
u
'
</div>
'
)
baseviews
.
PRIMARY_SKIP_RELS
.
add
(
'
comments
'
)
# displayed by the above component
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment