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
f1559f16
Commit
f1559f16
authored
7 years ago
by
Geert Kapteijns
Browse files
Options
Downloads
Patches
Plain Diff
Add messages upon success on query and request commentary forms.
parent
e3723b45
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
commentaries/forms.py
+0
-1
0 additions, 1 deletion
commentaries/forms.py
commentaries/views.py
+10
-0
10 additions, 0 deletions
commentaries/views.py
strings/__init__.py
+2
-0
2 additions, 0 deletions
strings/__init__.py
with
12 additions
and
1 deletion
commentaries/forms.py
+
0
−
1
View file @
f1559f16
...
@@ -31,7 +31,6 @@ class DOIToQueryForm(forms.Form):
...
@@ -31,7 +31,6 @@ class DOIToQueryForm(forms.Form):
return
input_doi
return
input_doi
def
request_published_article_form_prefill_data
(
self
):
def
request_published_article_form_prefill_data
(
self
):
additional_form_data
=
{
'
pub_DOI
'
:
self
.
cleaned_data
[
'
doi
'
]}
additional_form_data
=
{
'
pub_DOI
'
:
self
.
cleaned_data
[
'
doi
'
]}
return
{
**
self
.
crossref_data
,
**
additional_form_data
}
return
{
**
self
.
crossref_data
,
**
additional_form_data
}
...
...
This diff is collapsed.
Click to expand it.
commentaries/views.py
+
10
−
0
View file @
f1559f16
...
@@ -43,6 +43,10 @@ class RequestPublishedArticle(CreateView):
...
@@ -43,6 +43,10 @@ class RequestPublishedArticle(CreateView):
context
[
'
doi_query_form
'
]
=
DOIToQueryForm
()
context
[
'
doi_query_form
'
]
=
DOIToQueryForm
()
return
context
return
context
def
form_valid
(
self
,
form
):
messages
.
success
(
self
.
request
,
strings
.
acknowledge_request_commentary
)
return
super
(
RequestArxivPreprint
,
self
).
form_valid
(
form
)
@method_decorator
(
permission_required
(
@method_decorator
(
permission_required
(
'
scipost.can_request_commentary_pages
'
,
raise_exception
=
True
),
name
=
'
dispatch
'
)
'
scipost.can_request_commentary_pages
'
,
raise_exception
=
True
),
name
=
'
dispatch
'
)
...
@@ -56,6 +60,10 @@ class RequestArxivPreprint(CreateView):
...
@@ -56,6 +60,10 @@ class RequestArxivPreprint(CreateView):
context
[
'
arxiv_query_form
'
]
=
ArxivQueryForm
()
context
[
'
arxiv_query_form
'
]
=
ArxivQueryForm
()
return
context
return
context
def
form_valid
(
self
,
form
):
messages
.
success
(
self
.
request
,
strings
.
acknowledge_request_commentary
)
return
super
(
RequestArxivPreprint
,
self
).
form_valid
(
form
)
@permission_required
(
'
scipost.can_request_commentary_pages
'
,
raise_exception
=
True
)
@permission_required
(
'
scipost.can_request_commentary_pages
'
,
raise_exception
=
True
)
def
prefill_using_DOI
(
request
):
def
prefill_using_DOI
(
request
):
...
@@ -65,6 +73,7 @@ def prefill_using_DOI(request):
...
@@ -65,6 +73,7 @@ def prefill_using_DOI(request):
if
doi_query_form
.
is_valid
():
if
doi_query_form
.
is_valid
():
prefill_data
=
doi_query_form
.
request_published_article_form_prefill_data
()
prefill_data
=
doi_query_form
.
request_published_article_form_prefill_data
()
form
=
RequestPublishedArticleForm
(
initial
=
prefill_data
)
form
=
RequestPublishedArticleForm
(
initial
=
prefill_data
)
messages
.
success
(
request
,
strings
.
acknowledge_doi_query
)
else
:
else
:
form
=
RequestPublishedArticleForm
()
form
=
RequestPublishedArticleForm
()
...
@@ -84,6 +93,7 @@ def prefill_using_arxiv_identifier(request):
...
@@ -84,6 +93,7 @@ def prefill_using_arxiv_identifier(request):
if
arxiv_query_form
.
is_valid
():
if
arxiv_query_form
.
is_valid
():
prefill_data
=
arxiv_query_form
.
request_arxiv_preprint_form_prefill_data
()
prefill_data
=
arxiv_query_form
.
request_arxiv_preprint_form_prefill_data
()
form
=
RequestArxivPreprintForm
(
initial
=
prefill_data
)
form
=
RequestArxivPreprintForm
(
initial
=
prefill_data
)
messages
.
success
(
request
,
strings
.
acknowledge_arxiv_query
)
else
:
else
:
form
=
RequestArxivPreprintForm
()
form
=
RequestArxivPreprintForm
()
...
...
This diff is collapsed.
Click to expand it.
strings/__init__.py
+
2
−
0
View file @
f1559f16
...
@@ -10,6 +10,8 @@ acknowledge_request_commentary = (
...
@@ -10,6 +10,8 @@ acknowledge_request_commentary = (
acknowledge_submit_comment
=
(
acknowledge_submit_comment
=
(
"
Thank you for contributing a Comment. It will soon be vetted by an Editor.
"
"
Thank you for contributing a Comment. It will soon be vetted by an Editor.
"
)
)
acknowledge_doi_query
=
"
Crossref query by DOI successful.
"
acknowledge_arxiv_query
=
"
Arxiv query successful.
"
# Arxiv response is not valid
# Arxiv response is not valid
arxiv_caller_errormessages
=
{
arxiv_caller_errormessages
=
{
...
...
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