diff --git a/production/templates/production/production.html b/production/templates/production/production.html index 5da7ba51fbe55739f91cb24b40be5c4ebe4a26c6..7eff288ad197485c9bcf4662bbd97156a978a3fa 100644 --- a/production/templates/production/production.html +++ b/production/templates/production/production.html @@ -24,14 +24,9 @@ <div class="tab-nav-container"> <div class="tab-nav-inner"> <ul class="nav btn-group personal-page-nav" role="tablist"> - {% if perms.scipost.can_view_all_production_streams %} - <li class="nav-item btn btn-outline-secondary"> - <a href="#summary" class="nav-link active" data-toggle="tab">Summary</a> - </li> - {% endif %} - <li class="nav-item btn btn-outline-secondary"> - <a href="#streams" class="nav-link{% if not perms.scipost.can_view_all_production_streams %} active{% endif %}" data-toggle="tab">{{ perms.scipost.can_assign_production_officer|yesno:"Streams,My Streams" }}</a> - </li> + <li class="nav-item btn btn-outline-secondary"> + <a href="#summary" class="nav-link active" data-toggle="tab">Production streams</a> + </li> <li class="nav-item btn btn-outline-secondary"> <a href="#mytimesheet" class="nav-link" data-toggle="tab">My Timesheet</a> </li> @@ -47,141 +42,76 @@ </div> <div class="tab-content"> - {% if perms.scipost.can_view_all_production_streams %} - <div class="tab-pane active" id="summary" role="tabpanel"> - <div class="row"> - <div class="col-12"> - <h2 class="highlight">Streams summary</h2> - <table class="table table-fixed"> - <thead> + <div class="tab-pane active" id="summary" role="tabpanel"> + <div class="row"> + <div class="col-12"> + <h2 class="highlight">Production streams</h2> + <table class="table table-fixed"> + <thead> + <tr> + <th style="width: 30%;">Submission</th> + <th>Target Journal<br/>(Tier)</th> + <th>Status</th> + <th class="py-1"> + Latest activity + <br> + Submission accepted + </th> + <th>Has supervisor</th> + <th> + Production officer + <br> + Invitations officer + </th> + </tr> + </thead> + <tbody> + {% for stream in streams %} <tr> - <th style="width: 30%;">Submission</th> - <th>Target Journal<br/>(Tier)</th> - <th>Status</th> - <th class="py-1"> - Latest activity - <br> - Submission accepted - </th> - <th>Has supervisor</th> - <th> - Production officer - <br> - Invitations officer - </th> - </tr> - </thead> - <tbody> - {% for stream in streams %} - <tr> - <td> - <a href="{{ stream.get_absolute_url }}">{{ stream.submission.title }}</a> - <br> - by {{ stream.submission.author_list }} - </td> - <td>{{ stream.submission.submitted_to }}{% for rec in stream.submission.eicrecommendations.all %}<br/>({{ rec|Tier }}){% endfor %}</td> - <td> - <div class="label label-{% if stream.status == 'initiated' %}outline-danger{% else %}secondary{% endif %} label-sm">{{ stream.get_status_display }}</div> - </td> - <td> - {{ stream.latest_activity|timesince }} ago - <br> - <span class="text-muted">{{ stream.opened|timesince }} ago</span> - </td> - <td> - {% if stream.supervisor %} - <i class="fa fa-check text-success"></i> - {{ stream.supervisor }} - {% else %} - <i class="fa fa-times text-danger"></i> - {% endif %} - </td> - <td> - {% if stream.officer %} - <i class="fa fa-check text-success"></i> - {{ stream.officer }} - {% else %} - <i class="fa fa-times text-danger"></i> - {% endif %} - <br> - {% if stream.invitations_officer %} - <i class="fa fa-check text-success"></i> - {{ stream.invitations_officer }} - {% else %} - <i class="fa fa-times text-danger"></i> - {% endif %} - </td> - </tr> - {% endfor %} - </tbody> - </table> - </div> - </div> - </div> - {% endif %} - - - <div class="tab-pane{% if not perms.scipost.can_view_all_production_streams %} active{% endif %}" id="streams" role="tabpanel"> - <div class="row"> - <div class="col-12"> - <h2 class="highlight">{{ perms.scipost.can_assign_production_officer|yesno:"Streams,My Streams" }}</h2> - <a href="{% url 'production:completed' %}">View completed streams</a> - </div> - </div> - - <div class="row"> - <div class="col-6"> - <ul class="list-unstyled" data-target="active-list"> - {% for stream in streams %} - <li class="px-2 py-1"> - <div class="d-flex justify-content-start"> - <div class="icons pr-2"> - <i class="fa fa-users" data-toggle="tooltip" data-html="true" title="" data-original-title=" - Supervisor: {% if stream.supervisor %}{{ stream.supervisor.user.first_name }} {{ stream.supervisor.user.last_name }}{% else %}<em>Unassigned</em>{% endif %}<br> - Officer: {% if stream.officer %}{{ stream.officer.user.first_name }} {{ stream.officer.user.last_name }}{% else %}<em>Unassigned</em>{% endif %} - "></i> - {% if stream.supervisor.user == request.user %} + <td> + <a href="{{ stream.get_absolute_url }}">{{ stream.submission.title }}</a> <br> - <i class="fa fa-info-circle" data-toggle="tooltip" data-html="true" title="" data-original-title="You are assigned as supervisor"></i> - {% endif %} - </div> - <div> - <p class="mb-1"> - <a href="{% url 'production:stream' stream.id %}" data-toggle="dynamic" data-target="#details">{{ stream.submission.title }}</a><br> - <em>by {{ stream.submission.author_list }}</em> - </p> - <div class="py-1"> - <p class="mb-1">Submission accepted <strong>{{ stream.opened|timesince }} ago</strong></p> + by {{ stream.submission.author_list }} + </td> + <td>{{ stream.submission.submitted_to }}{% for rec in stream.submission.eicrecommendations.all %}<br/>({{ rec|Tier }}){% endfor %}</td> + <td> <div class="label label-{% if stream.status == 'initiated' %}outline-danger{% else %}secondary{% endif %} label-sm">{{ stream.get_status_display }}</div> + </td> + <td> + {{ stream.latest_activity|timesince }} ago <br> - <a href="{% url 'production:stream' stream.id %}" data-toggle="dynamic" data-target="#details" class="btn btn-default px-0">See stream details</a> - </div> - - - </div> - </div> - </li> - {% endfor %} - </ul> - - </div> - <div class="col-6"> - <div class="card center-loader bg-white" id="details"> - {% if stream %} - {% include 'production/partials/production_stream_card.html' %} - {% else %} - <div class="text-center py-4"> - <i class="fa fa-hand-o-left fa-3x" aria-hidden="true"></i> - - <h3>Choose a Stream to see more details</h3> - </div> - {% endif %} + <span class="text-muted">{{ stream.opened|timesince }} ago</span> + </td> + <td> + {% if stream.supervisor %} + <i class="fa fa-check text-success"></i> + {{ stream.supervisor }} + {% else %} + <i class="fa fa-times text-danger"></i> + {% endif %} + </td> + <td> + {% if stream.officer %} + <i class="fa fa-check text-success"></i> + {{ stream.officer }} + {% else %} + <i class="fa fa-times text-danger"></i> + {% endif %} + <br> + {% if stream.invitations_officer %} + <i class="fa fa-check text-success"></i> + {{ stream.invitations_officer }} + {% else %} + <i class="fa fa-times text-danger"></i> + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> + </table> </div> - </div> </div> - </div> - <div class="tab-pane" id="mytimesheet" role="tabpanel"> <div class="row">