Skip to content
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
8 changes: 4 additions & 4 deletions src/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from importlib import import_module
import json
from urllib.parse import unquote, urlencode
from urllib.parse import urlencode
import pytz
import time
import warnings
Expand All @@ -16,20 +16,18 @@
from django.contrib.auth import authenticate, logout, login
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.urls import NoReverseMatch, reverse, reverse_lazy
from django.urls import NoReverseMatch, reverse
from django.shortcuts import render, get_object_or_404, redirect, Http404
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.http import HttpResponse, QueryDict
from django.contrib.messages.views import SuccessMessageMixin
from django.contrib.sessions.models import Session
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.db import IntegrityError
from django.conf import settings as django_settings
from django.views.decorators.http import require_POST
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.generic import CreateView, UpdateView, DeleteView
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _
from django.utils.html import mark_safe
Expand Down Expand Up @@ -817,6 +815,8 @@ def dashboard(request):
editor=request.user,
editor_type="section-editor",
article__journal=request.journal,
).order_by(
"-article__date_submitted",
)

# TODO: Move most of this to model logic.
Expand Down
3 changes: 2 additions & 1 deletion src/templates/admin/core/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ <h2>Proofing Corrections</h2>
<h2>Section Editor</h2>
</div>
<div class="content">
<table class="scroll">
<table id="section-editor-articles" class="scroll">
<thead>
<tr>
<th>ID</th>
Expand Down Expand Up @@ -221,4 +221,5 @@ <h2>Section Editor</h2>
{% if published_submissions %}{% include "admin/elements/datatables.html" with target="#published" sort=2 order="desc" %}{% endif %}
{% include "admin/elements/datatables.html" with target="#active" sort=2 order="desc" %}
{% include "admin/elements/datatables.html" with target="#incomplete" sort=2 order="desc" %}
{% include "admin/elements/datatables.html" with target="#section-editor-articles" sort=3 order="desc" save_state=True %}
{% endblock %}
1 change: 1 addition & 0 deletions src/templates/admin/elements/datatables.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$(document).ready(function() {
'{{ target }}'.split(' ').forEach(target => {
$(target).DataTable({
{% if save_state %}"stateSave": true,{% endif %}
"lengthMenu": [[25, 50, 10, 5, -1], [25, 50, 10, 5, "All"]],
{% if hide_length %}"bLengthChange": false,{% endif %}
{% if hide_page %}"bPaginate": false,{% endif %}
Expand Down