SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SciPost
SciPost
Commits
cc703cff
Commit
cc703cff
authored
8 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Comments: add vetted_by field and correction category
parent
725fa5cf
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
comments/forms.py
+2
-2
2 additions, 2 deletions
comments/forms.py
comments/models.py
+4
-0
4 additions, 0 deletions
comments/models.py
comments/views.py
+2
-0
2 additions, 0 deletions
comments/views.py
with
8 additions
and
2 deletions
comments/forms.py
+
2
−
2
View file @
cc703cff
...
@@ -24,7 +24,7 @@ comment_refusal_dict = dict(COMMENT_REFUSAL_CHOICES)
...
@@ -24,7 +24,7 @@ comment_refusal_dict = dict(COMMENT_REFUSAL_CHOICES)
class
CommentForm
(
forms
.
ModelForm
):
class
CommentForm
(
forms
.
ModelForm
):
class
Meta
:
class
Meta
:
model
=
Comment
model
=
Comment
fields
=
[
'
is_rem
'
,
'
is_que
'
,
'
is_ans
'
,
'
is_obj
'
,
'
is_rep
'
,
'
is_val
'
,
'
is_lit
'
,
'
is_sug
'
,
'
comment_text
'
,
'
remarks_for_editors
'
]
fields
=
[
'
is_rem
'
,
'
is_que
'
,
'
is_ans
'
,
'
is_obj
'
,
'
is_rep
'
,
'
is_cor
'
,
'
is_val
'
,
'
is_lit
'
,
'
is_sug
'
,
'
comment_text
'
,
'
remarks_for_editors
'
]
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
CommentForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
super
(
CommentForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
...
@@ -42,7 +42,7 @@ class CommentForm(forms.ModelForm):
...
@@ -42,7 +42,7 @@ class CommentForm(forms.ModelForm):
Div
(
Div
(
Fieldset
(
Fieldset
(
'
Specify categorization(s):
'
,
'
Specify categorization(s):
'
,
'
is_rem
'
,
'
is_que
'
,
'
is_ans
'
,
'
is_obj
'
,
'
is_rep
'
,
'
is_val
'
,
'
is_lit
'
,
'
is_sug
'
,
'
is_rem
'
,
'
is_que
'
,
'
is_ans
'
,
'
is_obj
'
,
'
is_rep
'
,
'
is_cor
'
,
'
is_val
'
,
'
is_lit
'
,
'
is_sug
'
,
style
=
"
border: 0px; font-size: 90%
"
),
style
=
"
border: 0px; font-size: 90%
"
),
HTML
(
'
<br>
'
),
HTML
(
'
<br>
'
),
Div
(
Div
(
...
...
This diff is collapsed.
Click to expand it.
comments/models.py
+
4
−
0
View file @
cc703cff
...
@@ -39,6 +39,7 @@ class Comment(models.Model):
...
@@ -39,6 +39,7 @@ class Comment(models.Model):
# -2: rejected (incorrect)
# -2: rejected (incorrect)
# -3: rejected (not useful)
# -3: rejected (not useful)
status
=
models
.
SmallIntegerField
(
default
=
0
)
status
=
models
.
SmallIntegerField
(
default
=
0
)
vetted_by
=
models
.
ForeignKey
(
Contributor
,
blank
=
True
,
null
=
True
,
related_name
=
'
comment_vetted_by
'
)
commentary
=
models
.
ForeignKey
(
Commentary
,
blank
=
True
,
null
=
True
)
# a Comment is either for a Commentary or Submission
commentary
=
models
.
ForeignKey
(
Commentary
,
blank
=
True
,
null
=
True
)
# a Comment is either for a Commentary or Submission
submission
=
models
.
ForeignKey
(
Submission
,
blank
=
True
,
null
=
True
)
submission
=
models
.
ForeignKey
(
Submission
,
blank
=
True
,
null
=
True
)
thesislink
=
models
.
ForeignKey
(
ThesisLink
,
blank
=
True
,
null
=
True
)
thesislink
=
models
.
ForeignKey
(
ThesisLink
,
blank
=
True
,
null
=
True
)
...
@@ -53,6 +54,7 @@ class Comment(models.Model):
...
@@ -53,6 +54,7 @@ class Comment(models.Model):
is_ans
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
answer to question
'
)
is_ans
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
answer to question
'
)
is_obj
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
objection
'
)
is_obj
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
objection
'
)
is_rep
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
reply to objection
'
)
is_rep
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
reply to objection
'
)
is_cor
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
correction
'
)
is_val
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
validation or rederivation
'
)
is_val
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
validation or rederivation
'
)
is_lit
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
pointer to related literature
'
)
is_lit
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
pointer to related literature
'
)
is_sug
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
suggestion for further work
'
)
is_sug
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
suggestion for further work
'
)
...
@@ -212,6 +214,8 @@ class Comment(models.Model):
...
@@ -212,6 +214,8 @@ class Comment(models.Model):
output
+=
'
<li>objection</li>
'
output
+=
'
<li>objection</li>
'
if
self
.
is_rep
:
if
self
.
is_rep
:
output
+=
'
<li>reply to objection</li>
'
output
+=
'
<li>reply to objection</li>
'
if
self
.
is_cor
:
output
+=
'
<li>correction</li>
'
if
self
.
is_val
:
if
self
.
is_val
:
output
+=
'
<li>validation or rederivation</li>
'
output
+=
'
<li>validation or rederivation</li>
'
if
self
.
is_lit
:
if
self
.
is_lit
:
...
...
This diff is collapsed.
Click to expand it.
comments/views.py
+
2
−
0
View file @
cc703cff
...
@@ -32,6 +32,7 @@ def vet_submitted_comment_ack(request, comment_id):
...
@@ -32,6 +32,7 @@ def vet_submitted_comment_ack(request, comment_id):
if
form
.
cleaned_data
[
'
action_option
'
]
==
'
1
'
:
if
form
.
cleaned_data
[
'
action_option
'
]
==
'
1
'
:
# accept the comment as is
# accept the comment as is
comment
.
status
=
1
comment
.
status
=
1
comment
.
vetted_by
=
request
.
user
.
contributor
comment
.
save
()
comment
.
save
()
email_text
=
(
'
Dear
'
+
title_dict
[
comment
.
author
.
title
]
+
'
'
+
comment
.
author
.
user
.
last_name
+
email_text
=
(
'
Dear
'
+
title_dict
[
comment
.
author
.
title
]
+
'
'
+
comment
.
author
.
user
.
last_name
+
'
,
\n\n
The Comment you have submitted, concerning publication with title
'
)
'
,
\n\n
The Comment you have submitted, concerning publication with title
'
)
...
@@ -112,6 +113,7 @@ def reply_to_comment(request, comment_id):
...
@@ -112,6 +113,7 @@ def reply_to_comment(request, comment_id):
is_ans
=
form
.
cleaned_data
[
'
is_ans
'
],
is_ans
=
form
.
cleaned_data
[
'
is_ans
'
],
is_obj
=
form
.
cleaned_data
[
'
is_obj
'
],
is_obj
=
form
.
cleaned_data
[
'
is_obj
'
],
is_rep
=
form
.
cleaned_data
[
'
is_rep
'
],
is_rep
=
form
.
cleaned_data
[
'
is_rep
'
],
is_cor
=
form
.
cleaned_data
[
'
is_cor
'
],
is_val
=
form
.
cleaned_data
[
'
is_val
'
],
is_val
=
form
.
cleaned_data
[
'
is_val
'
],
is_lit
=
form
.
cleaned_data
[
'
is_lit
'
],
is_lit
=
form
.
cleaned_data
[
'
is_lit
'
],
is_sug
=
form
.
cleaned_data
[
'
is_sug
'
],
is_sug
=
form
.
cleaned_data
[
'
is_sug
'
],
...
...
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