Skip to content

Commit

Permalink
#3322 articles should no longer be stalled when funding is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Dec 19, 2022
1 parent a345586 commit 7d4d14a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 17 deletions.
19 changes: 16 additions & 3 deletions src/submission/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
from identifiers import logic as id_logic
from identifiers import models as identifier_models
from metrics.logic import ArticleMetrics
from repository import models as repository_models
from review import models as review_models
from utils.function_cache import cache
from utils.logger import get_logger
from utils import setting_handler

logger = get_logger(__name__)

Expand Down Expand Up @@ -1135,27 +1135,40 @@ def get_remote_url(self, request):
return url

def step_to_url(self):
funding_enabled = False
if self.journal and self.journal.submissionconfiguration:
funding_enabled = self.journal.submissionconfiguration.funding

if self.current_step == 1:
return reverse('submit_info', kwargs={'article_id': self.id})
elif self.current_step == 2:
return reverse('submit_authors', kwargs={'article_id': self.id})
elif self.current_step == 3:
return reverse('submit_files', kwargs={'article_id': self.id})
elif self.current_step == 4 and funding_enabled:
return reverse('submit_funding', kwargs={'article_id': self.id})
elif self.current_step == 4:
return reverse('submit_review', kwargs={'article_id': self.id})
else:
return None
return reverse('submit_review', kwargs={'article_id': self.id})

def step_name(self):
funding_enabled = False
if self.journal and self.journal.submissionconfiguration:
funding_enabled = self.journal.submissionconfiguration.funding
if self.current_step == 1:
return 'Article Information'
elif self.current_step == 2:
return 'Article Authors'
elif self.current_step == 3:
return 'Article Files'
elif self.current_step == 4 and funding_enabled:
return 'Article Funding'
elif self.current_step == 4:
return 'Review Article Submission'
elif self.current_step == 5:
elif self.current_step == 5 and funding_enabled:
return 'Review Article Submission'
else:
return 'Submission Complete'

def save(self, *args, **kwargs):
Expand Down
36 changes: 22 additions & 14 deletions src/templates/admin/submission/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,28 @@ <h4>{% if article %}{% if article.current_step >= 3 %}
</div>
</li>
{% if request.journal.submissionconfiguration.funding %}
<li class="li {% if article.current_step >= 4 %}complete{% endif %}">
<div class="status">
<h4>{% if article %}{% if article.current_step >= 4 %}
<a href="{% url 'submit_funding' article.id %}">{% trans "Funding" %}</a>{% else %}
{% trans "Funding" %}{% endif %}{% else %}{% trans "Funding" %}{% endif %} </h4>
</div>
</li>
<li class="li {% if article.current_step >= 4 %}complete{% endif %}">
<div class="status">
<h4>{% if article %}{% if article.current_step >= 4 %}
<a href="{% url 'submit_funding' article.id %}">{% trans "Funding" %}</a>{% else %}
{% trans "Funding" %}{% endif %}{% else %}{% trans "Funding" %}{% endif %} </h4>
</div>
</li>
<li class="li {% if article.current_step >= 5 %}complete{% endif %}">
<div class="status">
<h4>{% if article %}{% if article.current_step >= 5 %}
<a href="{% url 'submit_review' article.id %}">{% trans "Review" %}</a>{% else %}
{% trans "Review" %}{% endif %}{% else %}{% trans "Review" %}{% endif %} </h4>
</div>
</li>
{% else %}
<li class="li {% if article.current_step >= 4 %}complete{% endif %}">
<div class="status">
<h4>{% if article %}{% if article.current_step >= 4 %}
<a href="{% url 'submit_review' article.id %}">{% trans "Review" %}</a>{% else %}
{% trans "Review" %}{% endif %}{% else %}{% trans "Review" %}{% endif %} </h4>
</div>
</li>
{% endif %}
<li class="li {% if article.current_step >= 4 %}complete{% endif %}">
<div class="status">
<h4>{% if article %}{% if article.current_step >= 4 %}
<a href="{% url 'submit_review' article.id %}">{% trans "Review" %}</a>{% else %}
{% trans "Review" %}{% endif %}{% else %}{% trans "Review" %}{% endif %} </h4>
</div>
</li>
</ul>
</div>

0 comments on commit 7d4d14a

Please sign in to comment.