Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TGDK][Feature] Add Dashboard Panel for Pending Draft Decisions #4562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ def dashboard(request):
section_editor_articles = review_models.EditorAssignment.objects.filter(editor=request.user,
editor_type='section-editor',
article__journal=request.journal)
editor_draft_decisions = review_models.DecisionDraft.objects.filter(editor=request.user, editor_decision__isnull=True)

# TODO: Move most of this to model logic.
context = {
Expand Down Expand Up @@ -633,6 +634,7 @@ def dashboard(request):
'is_author': request.user.is_author(request),
'is_reviewer': request.user.is_reviewer(request),
'section_editor_articles': section_editor_articles,
'editor_draft_decisions': editor_draft_decisions,
'active_submission_count': submission_models.Article.objects.filter(
owner=request.user,
journal=request.journal).exclude(
Expand Down
42 changes: 42 additions & 0 deletions src/templates/admin/core/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,48 @@ <h2>Proofing Corrections</h2>
{% endif %}
{% endfor %}

{% if journal_settings.general.draft_decisions and is_editor %}
<div class="large-12 columns end">
<div class="box">
<div class="title-area">
<h2>Draft Decisions Pending</h2>
</div>
<div class="content">
<table class="scroll">
<thead>
<tr>
<th>ID</th>
<th>Article</th>
<th>Section Editor</th>
<th>Drafted Date</th>
<th>Draft Decision</th>
<th>Actions</th>
</tr>
</thead>
{% for draft in editor_draft_decisions %}
<tr>
<td>{{ draft.article.pk }}</td>
<td>
<a href="{{ draft.article.current_workflow_element_url }}">{{ draft.article.safe_title }}</a>
</td>
<td>{{ draft.section_editor }}</td>
<td>{{ draft.drafted }}</td>
<td>{{ draft.decision|capfirst }}</td>
<td>
<a class="small button" href="{% url 'review_edit_draft_decision' draft.article.pk draft.id %}">Draft Decisions</a>
</td>

</tr>
{% empty %}
<tr>
<td colspan="4">No Draft Decision Requested</td>
</tr>
{% endfor %}
</table>
</div>
</div>
</div>
{% endif %}

{% user_has_role request 'section-editor' as sectioneditor %}
{% if sectioneditor %}
Expand Down