diff --git a/production/templates/production/base.html b/production/templates/production/base.html index ca23a80a9318602f0c6d95dbddb1e11607b7d0c6..1083c6714cc3567626951aaa45b5de426091be5f 100644 --- a/production/templates/production/base.html +++ b/production/templates/production/base.html @@ -3,13 +3,13 @@ {% block container_class %}{{block.super}} pb-5{% endblock container_class %} {% block breadcrumb %} - <div class="breadcrumb-container"> - <div class="container"> - <nav class="breadcrumb"> - {% block breadcrumb_items %} - <a href="{% url 'production:production' %}" class="breadcrumb-item">Production page</a> - {% endblock %} - </nav> - </div> + <div class="breadcrumb-container"> + <div class="container"> + <nav class="breadcrumb"> + {% block breadcrumb_items %} + <a href="{% url 'production:production' %}" class="breadcrumb-item">Production page</a> + {% endblock %} + </nav> </div> + </div> {% endblock %} diff --git a/production/templates/production/completed.html b/production/templates/production/completed.html index f5a80521b88400faa419fd7edbacbfe484066f03..bd7d8947cdf238d7347bd1ebca40b96cf508033c 100644 --- a/production/templates/production/completed.html +++ b/production/templates/production/completed.html @@ -1,8 +1,8 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <span class="breadcrumb-item">Completed production streams</span> + {{block.super}} + <span class="breadcrumb-item">Completed production streams</span> {% endblock %} {% block pagetitle %}: Completed production streams{% endblock pagetitle %} @@ -11,23 +11,23 @@ {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Completed production streams</h1> + <h1 class="highlight">Completed production streams</h1> </div> -</div> -<div class="row"> - <div class="col-12"> - <ul class="list-group list-group-flush"> - {% for stream in streams %} - <li class="list-group-item"> + </div> + <div class="row"> + <div class="col-12"> + <ul class="list-group list-group-flush"> + {% for stream in streams %} + <li class="list-group-item"> {% include 'production/partials/production_stream_card_completed.html' with stream=stream %} - </li> - {% empty %} - <li class="list-group-item">No completed production streams found.</li> - {% endfor %} - </ul> + </li> + {% empty %} + <li class="list-group-item">No completed production streams found.</li> + {% endfor %} + </ul> + </div> </div> -</div> {% endblock content %} diff --git a/production/templates/production/partials/production_events.html b/production/templates/production/partials/production_events.html index 74fbd57a54ee493a522c938c6f1e6fd311ae9857..aa90da95765affc08f8c2f369176708e9e9acb50 100644 --- a/production/templates/production/partials/production_events.html +++ b/production/templates/production/partials/production_events.html @@ -2,52 +2,52 @@ <ul class="list-unstyled"> {% for event in events %} - <li id="event_{{ event.id }}" class="pb-2"> - <div class="d-flex justify-content-between"> - <div> - <strong>{{ event.noted_by.user.first_name }} {{ event.noted_by.user.last_name }}</strong> - <br> - {{ event.get_event_displa|linebreaksbr }} - </div> - <div class="text-muted text-right d-flex justify-content-end"> - <div> - {{ event.noted_on }} - {% if event.duration %} - <br> - <strong>Duration: {{ event.duration|duration }}</strong> - {% endif %} - </div> + <li id="event_{{ event.id }}" class="pb-2"> + <div class="d-flex justify-content-between"> + <div> + <strong>{{ event.noted_by.user.first_name }} {{ event.noted_by.user.last_name }}</strong> + <br> + {{ event.get_event_displa|linebreaksbr }} + </div> + <div class="text-muted text-right d-flex justify-content-end"> + <div> + {{ event.noted_on }} + {% if event.duration %} + <br> + <strong>Duration: {{ event.duration|duration }}</strong> + {% endif %} + </div> - {% if not non_editable %} - {% if event.noted_by == request.user.production_user and event.editable %} - <div class="pl-2"> - <a href="{% url 'production:update_event' event.id %}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a> - <a class="text-danger" href="{% url 'production:delete_event' event.id %}"><i class="fa fa-trash" aria-hidden="true"></i></a> - </div> - {% endif %} - {% endif %} - </div> - </div> - - {% if event.comments %} - <p class="mt-2 mb-0"> - {% if event.noted_to %} - {{ event.noted_by.user.first_name }} {{ event.noted_by.user.last_name }} {{ event.comments|linebreaksbr }} {{ event.noted_to.user.first_name }} {{ event.noted_to.user.last_name }}. - {% else %} - {{ event.comments|safe|linebreaksbr }} - {% endif %} - </p> + {% if not non_editable %} + {% if event.noted_by == request.user.production_user and event.editable %} + <div class="pl-2"> + <a href="{% url 'production:update_event' event.id %}"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></a> + <a class="text-danger" href="{% url 'production:delete_event' event.id %}"><i class="fa fa-trash" aria-hidden="true"></i></a> + </div> + {% endif %} {% endif %} + </div> + </div> - {% if event.attachments.exists %} - <ul> - {% for attachment in event.attachments.all %} - <li><a href="{{ attachment.get_absolute_url }}" target="_blank">Download Attachment {{ forloop.counter }}</a></li> - {% endfor %} - </ul> + {% if event.comments %} + <p class="mt-2 mb-0"> + {% if event.noted_to %} + {{ event.noted_by.user.first_name }} {{ event.noted_by.user.last_name }} {{ event.comments|linebreaksbr }} {{ event.noted_to.user.first_name }} {{ event.noted_to.user.last_name }}. + {% else %} + {{ event.comments|safe|linebreaksbr }} {% endif %} - </li> - {% empty %} - <li>No events were found.</li> - {% endfor %} + </p> + {% endif %} + + {% if event.attachments.exists %} + <ul> + {% for attachment in event.attachments.all %} + <li><a href="{{ attachment.get_absolute_url }}" target="_blank">Download Attachment {{ forloop.counter }}</a></li> + {% endfor %} + </ul> + {% endif %} + </li> + {% empty %} + <li>No events were found.</li> + {% endfor %} </ul> diff --git a/production/templates/production/partials/production_stream_card.html b/production/templates/production/partials/production_stream_card.html index b5939891f5fc72eab4532bfe304ca59e3fd85011..b0538685d025b84fd68c8ed12ed31b6dcac161e4 100644 --- a/production/templates/production/partials/production_stream_card.html +++ b/production/templates/production/partials/production_stream_card.html @@ -4,7 +4,7 @@ {% load scipost_extras %} {% block actions %} - {% include 'production/partials/stream_status_changes.html' with form=status_form stream=stream %} + {% include 'production/partials/stream_status_changes.html' with form=status_form stream=stream %} <h3>Events</h3> {% include 'production/partials/production_events.html' with events=stream.events.all_without_duration %} @@ -12,131 +12,131 @@ {% if "can_work_for_stream" in sub_perms and prodevent_form %} <h3>Add message to the Stream</h3> <form action="{% url 'production:add_event' stream_id=stream.id %}" method="post" class="mb-2"> - {% csrf_token %} - {{ prodevent_form|bootstrap }} - <input type="submit" class="btn btn-outline-secondary" name="submit" value="Submit"> + {% csrf_token %} + {{ prodevent_form|bootstrap }} + <input type="submit" class="btn btn-outline-secondary" name="submit" value="Submit"> </form> {% endif %} <h3>Work Log</h3> {% if "can_work_for_stream" in sub_perms and work_log_form %} <ul> - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#log_form">Add hours to the Stream</a> - <form id="log_form" style="display: none;" action="{% url 'production:add_work_log' stream_id=stream.id %}" method="post" class="mb-2"> - {% csrf_token %} - {{ work_log_form|bootstrap }} - <input type="submit" class="btn btn-outline-secondary" name="submit" value="Log"> - </form> - </li> + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#log_form">Add hours to the Stream</a> + <form id="log_form" style="display: none;" action="{% url 'production:add_work_log' stream_id=stream.id %}" method="post" class="mb-2"> + {% csrf_token %} + {{ work_log_form|bootstrap }} + <input type="submit" class="btn btn-outline-secondary" name="submit" value="Log"> + </form> + </li> </ul> {% endif %} {% include 'partials/finances/logs.html' with logs=stream.work_logs.all %} {% if stream.total_duration %} - <hr> - <p class="text-right">Total duration for this stream: <strong>{{ stream.total_duration|duration }}</strong></p> + <hr> + <p class="text-right">Total duration for this stream: <strong>{{ stream.total_duration|duration }}</strong></p> {% endif %} - {% if "can_perform_supervisory_actions" in sub_perms or "can_work_for_stream" in sub_perms %} - <h3>Actions</h3> - <ul> - {% if "can_perform_supervisory_actions" in sub_perms %} - {% if perms.scipost.can_assign_production_supervisor and assign_supervisor_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#add_supervisor_{{stream.id}}">Assign Production Supervisor to this stream</a> - <div id="add_supervisor_{{stream.id}}" style="display: none;"> - <form class="my-3" action="{% url 'production:add_supervisor' stream_id=stream.id %}" method="post"> - {% csrf_token %} - {{ assign_supervisor_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Add supervisor"> - </form> - </div> - </li> - {% endif %} - {% if perms.scipost.can_assign_production_officer %} - {% if assign_officer_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#add_officer_{{stream.id}}">Assign Production Officer to this stream</a> - <div id="add_officer_{{stream.id}}" style="display: none;"> - <form class="my-3" action="{% url 'production:add_officer' stream_id=stream.id %}" method="post"> - {% csrf_token %} - {{ assign_officer_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> - </form> - </div> - </li> - {% endif %} - {% if assign_officer_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#add_invs_officer_{{stream.id}}">Assign Invitations Officer to this stream</a> - <div id="add_invs_officer_{{stream.id}}" style="display: none;"> - <form class="my-3" action="{% url 'production:add_invitations_officer' stream_id=stream.id %}" method="post"> - {% csrf_token %} - {{ assign_invitiations_officer_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> - </form> - </div> - </li> - {% endif %} - {% endif %} - {% endif %} + {% if "can_perform_supervisory_actions" in sub_perms or "can_work_for_stream" in sub_perms %} + <h3>Actions</h3> + <ul> + {% if "can_perform_supervisory_actions" in sub_perms %} + {% if perms.scipost.can_assign_production_supervisor and assign_supervisor_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#add_supervisor_{{stream.id}}">Assign Production Supervisor to this stream</a> + <div id="add_supervisor_{{stream.id}}" style="display: none;"> + <form class="my-3" action="{% url 'production:add_supervisor' stream_id=stream.id %}" method="post"> + {% csrf_token %} + {{ assign_supervisor_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Add supervisor"> + </form> + </div> + </li> + {% endif %} + {% if perms.scipost.can_assign_production_officer %} + {% if assign_officer_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#add_officer_{{stream.id}}">Assign Production Officer to this stream</a> + <div id="add_officer_{{stream.id}}" style="display: none;"> + <form class="my-3" action="{% url 'production:add_officer' stream_id=stream.id %}" method="post"> + {% csrf_token %} + {{ assign_officer_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> + </form> + </div> + </li> + {% endif %} + {% if assign_officer_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#add_invs_officer_{{stream.id}}">Assign Invitations Officer to this stream</a> + <div id="add_invs_officer_{{stream.id}}" style="display: none;"> + <form class="my-3" action="{% url 'production:add_invitations_officer' stream_id=stream.id %}" method="post"> + {% csrf_token %} + {{ assign_invitiations_officer_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Add officer"> + </form> + </div> + </li> + {% endif %} + {% endif %} + {% endif %} - {% if "can_work_for_stream" in sub_perms %} - {% if perms.scipost.can_upload_proofs and upload_proofs_form %} - <li> - <a href="javascript:;" data-toggle="toggle" data-target="#upload_proofs">Upload Proofs</a> - <div id="upload_proofs" style="display: none;"> - <form class="my-3" action="{% url 'production:upload_proofs' stream_id=stream.id %}" method="post" enctype="multipart/form-data"> - {% csrf_token %} - {{ upload_proofs_form|bootstrap_inline }} - <input type="submit" class="btn btn-outline-primary" name="submit" value="Upload"> - </form> - </div> - </li> - {% endif %} - {% endif %} + {% if "can_work_for_stream" in sub_perms %} + {% if perms.scipost.can_upload_proofs and upload_proofs_form %} + <li> + <a href="javascript:;" data-toggle="toggle" data-target="#upload_proofs">Upload Proofs</a> + <div id="upload_proofs" style="display: none;"> + <form class="my-3" action="{% url 'production:upload_proofs' stream_id=stream.id %}" method="post" enctype="multipart/form-data"> + {% csrf_token %} + {{ upload_proofs_form|bootstrap_inline }} + <input type="submit" class="btn btn-outline-primary" name="submit" value="Upload"> + </form> + </div> + </li> + {% endif %} + {% endif %} - {% if perms.scipost.can_publish_accepted_submission %} - <li><a href="{% url 'production:mark_as_completed' stream_id=stream.id %}">Mark this stream as completed</a></li> - {% endif %} - {% if perms.scipost.can_draft_publication and stream.status == 'accepted' %} - <li><a href="{% url 'journals:update_publication' stream.submission.preprint.identifier_w_vn_nr %}">Draft Publication</a></li> - {% endif %} - </ul> - {% endif %} + {% if perms.scipost.can_publish_accepted_submission %} + <li><a href="{% url 'production:mark_as_completed' stream_id=stream.id %}">Mark this stream as completed</a></li> + {% endif %} + {% if perms.scipost.can_draft_publication and stream.status == 'accepted' %} + <li><a href="{% url 'journals:update_publication' stream.submission.preprint.identifier_w_vn_nr %}">Draft Publication</a></li> + {% endif %} + </ul> + {% endif %} {% endblock %} {% block officers %} - <li>Production Supervisor: - {% if stream.supervisor %} - <strong>{{ stream.supervisor }}</strong> - {% if perms.scipost.can_assign_production_supervisor %} - · <a href="{% url 'production:remove_supervisor' stream_id=stream.id officer_id=stream.supervisor.id %}" class="text-danger">Remove from stream</a> - {% endif %} - {% else %} - <em>No Supervisor assigned yet.</em> - {% endif %} - </li> - <li>Production Officer: - {% if stream.officer %} - <strong>{{ stream.officer }}</strong> - {% if "can_work_for_stream" in sub_perms and perms.scipost.can_assign_production_officer %} - · <a href="{% url 'production:remove_officer' stream_id=stream.id officer_id=stream.officer.id %}" class="text-danger">Remove from stream</a> - {% endif %} - {% else %} - <em>No Officer assigned yet.</em> - {% endif %} - </li> - <li>Invitations Officer: - {% if stream.invitations_officer %} - <strong>{{ stream.invitations_officer }}</strong> - {% if "can_work_for_stream" in sub_perms and perms.scipost.can_assign_production_officer %} - · <a href="{% url 'production:remove_invitations_officer' stream_id=stream.id officer_id=stream.invitations_officer.id %}" class="text-danger">Remove from stream</a> - {% endif %} - {% else %} - <em>No Invitations Officer assigned yet.</em> - {% endif %} - </li> + <li>Production Supervisor: + {% if stream.supervisor %} + <strong>{{ stream.supervisor }}</strong> + {% if perms.scipost.can_assign_production_supervisor %} + · <a href="{% url 'production:remove_supervisor' stream_id=stream.id officer_id=stream.supervisor.id %}" class="text-danger">Remove from stream</a> + {% endif %} + {% else %} + <em>No Supervisor assigned yet.</em> + {% endif %} + </li> + <li>Production Officer: + {% if stream.officer %} + <strong>{{ stream.officer }}</strong> + {% if "can_work_for_stream" in sub_perms and perms.scipost.can_assign_production_officer %} + · <a href="{% url 'production:remove_officer' stream_id=stream.id officer_id=stream.officer.id %}" class="text-danger">Remove from stream</a> + {% endif %} + {% else %} + <em>No Officer assigned yet.</em> + {% endif %} + </li> + <li>Invitations Officer: + {% if stream.invitations_officer %} + <strong>{{ stream.invitations_officer }}</strong> + {% if "can_work_for_stream" in sub_perms and perms.scipost.can_assign_production_officer %} + · <a href="{% url 'production:remove_invitations_officer' stream_id=stream.id officer_id=stream.invitations_officer.id %}" class="text-danger">Remove from stream</a> + {% endif %} + {% else %} + <em>No Invitations Officer assigned yet.</em> + {% endif %} + </li> {% endblock %} diff --git a/production/templates/production/partials/production_stream_card_completed.html b/production/templates/production/partials/production_stream_card_completed.html index 03f54ec4c5a0b0a5c6aa743238708b1a09e3506b..d2bb8450c55a8bc4edfe6aefbe4596d0e1771fe0 100644 --- a/production/templates/production/partials/production_stream_card_completed.html +++ b/production/templates/production/partials/production_stream_card_completed.html @@ -5,79 +5,79 @@ {% get_obj_perms request.user for stream as "sub_perms" %} <div class="card-body" id="stream_{{stream.id}}"> - {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} + {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} </div> <div class="card-body"> - {% if perms.scipost.can_draft_publication and stream.status == 'accepted' %} - <p>The proofs have been accepted. Please start <a href="{% url 'journals:update_publication' stream.submission.preprint.identifier_w_vn_nr %}">drafting the Publication here</a>.</p> - {% endif %} - <h3>Stream details</h3> - <ul> - <li>Status: <span class="label label-secondary label-sm">{{ stream.get_status_display }}</span></li> - {% block officers %} - <li>Production Supervisor: - {% if stream.supervisor %} - <strong>{{ stream.supervisor }}</strong> - {% else %} - <em>No Supervisor assigned.</em> - {% endif %} - </li> - <li>Production Officer: - {% if stream.officer %} - <strong>{{ stream.officer }}</strong> - {% else %} - <em>No Officer assigned.</em> - {% endif %} - </li> - <li>Invitations Officer: - {% if stream.invitations_officer %} - <strong>{{ stream.invitations_officer }}</strong> - {% else %} - <em>No Invitations Officer assigned.</em> - {% endif %} - </li> - {% endblock %} - </ul> + {% if perms.scipost.can_draft_publication and stream.status == 'accepted' %} + <p>The proofs have been accepted. Please start <a href="{% url 'journals:update_publication' stream.submission.preprint.identifier_w_vn_nr %}">drafting the Publication here</a>.</p> + {% endif %} + <h3>Stream details</h3> + <ul> + <li>Status: <span class="label label-secondary label-sm">{{ stream.get_status_display }}</span></li> + {% block officers %} + <li>Production Supervisor: + {% if stream.supervisor %} + <strong>{{ stream.supervisor }}</strong> + {% else %} + <em>No Supervisor assigned.</em> + {% endif %} + </li> + <li>Production Officer: + {% if stream.officer %} + <strong>{{ stream.officer }}</strong> + {% else %} + <em>No Officer assigned.</em> + {% endif %} + </li> + <li>Invitations Officer: + {% if stream.invitations_officer %} + <strong>{{ stream.invitations_officer }}</strong> + {% else %} + <em>No Invitations Officer assigned.</em> + {% endif %} + </li> + {% endblock %} + </ul> - {% block actions %} - <h3>Events</h3> - {% include 'production/partials/production_events.html' with events=stream.events.all_without_duration non_editable=1 %} + {% block actions %} + <h3>Events</h3> + {% include 'production/partials/production_events.html' with events=stream.events.all_without_duration non_editable=1 %} - <h3>Work Log</h3> - {% include 'partials/finances/logs.html' with logs=stream.work_logs.all %} + <h3>Work Log</h3> + {% include 'partials/finances/logs.html' with logs=stream.work_logs.all %} - {% if stream.total_duration %} - <hr class="sm"> - <p class="pl-4 ml-3">Total duration for this stream: <strong>{{ stream.total_duration|duration }}</strong></p> - {% endif %} - {% endblock %} + {% if stream.total_duration %} + <hr class="sm"> + <p class="pl-4 ml-3">Total duration for this stream: <strong>{{ stream.total_duration|duration }}</strong></p> + {% endif %} + {% endblock %} - {% if "can_work_for_stream" in sub_perms %} - <h3>Proofs</h3> - <ul> - {% for proofs in stream.proofs.all %} - <li class="py-1"> - <a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Version {{ proofs.version }}</a> · <span class="label label-secondary label-sm">{{ proofs.get_status_display }}</span><br> - Uploaded by: {{ proofs.uploaded_by.user.first_name }} {{ proofs.uploaded_by.user.last_name }}<br> - Accessible for authors: {{ proofs.accessible_for_authors|yesno:'<strong>Yes</strong>,No'|safe }}<br> + {% if "can_work_for_stream" in sub_perms %} + <h3>Proofs</h3> + <ul> + {% for proofs in stream.proofs.all %} + <li class="py-1"> + <a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Version {{ proofs.version }}</a> · <span class="label label-secondary label-sm">{{ proofs.get_status_display }}</span><br> + Uploaded by: {{ proofs.uploaded_by.user.first_name }} {{ proofs.uploaded_by.user.last_name }}<br> + Accessible for authors: {{ proofs.accessible_for_authors|yesno:'<strong>Yes</strong>,No'|safe }}<br> - {% if perms.scipost.can_run_proofs_by_authors %} - {% if proofs.status == 'uploaded' %} - <strong><span class="text-danger">See details for open actions:</span></strong> - <ul> - <li><a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Accept or decline proofs</a></li> - </ul> - {% elif proofs.status == 'accepted_sup' %} - <strong><span class="text-danger">See details for open actions:</span></strong> - <ul> - <li><a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Send proofs to authors</a></li> - </ul> - {% endif %} - {% endif %} - </li> - {% empty %} - <li>No Proofs found.</li> - {% endfor %} - </ul> - {% endif %} + {% if perms.scipost.can_run_proofs_by_authors %} + {% if proofs.status == 'uploaded' %} + <strong><span class="text-danger">See details for open actions:</span></strong> + <ul> + <li><a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Accept or decline proofs</a></li> + </ul> + {% elif proofs.status == 'accepted_sup' %} + <strong><span class="text-danger">See details for open actions:</span></strong> + <ul> + <li><a href="{% url 'production:proofs' stream_id=stream.id version=proofs.version %}">Send proofs to authors</a></li> + </ul> + {% endif %} + {% endif %} + </li> + {% empty %} + <li>No Proofs found.</li> + {% endfor %} + </ul> + {% endif %} </div> diff --git a/production/templates/production/partials/production_timesheet_card.html b/production/templates/production/partials/production_timesheet_card.html index 462d0b2eb08b1dd2677c645fc80472db16a01c32..31888ab3320177dbef206de264af5919a918cd5b 100644 --- a/production/templates/production/partials/production_timesheet_card.html +++ b/production/templates/production/partials/production_timesheet_card.html @@ -10,18 +10,18 @@ </thead> <tbody role="tablist"> {% for event in events %} - {% if event.duration %} - <tr> - <td>{{ event.noted_on }}</td> - <td>{{ event.stream }}</td> - <td>{{ event.get_event_display }}</td> - <td>{{ event.duration }}</td> - </tr> - {% endif %} + {% if event.duration %} + <tr> + <td>{{ event.noted_on }}</td> + <td>{{ event.stream }}</td> + <td>{{ event.get_event_display }}</td> + <td>{{ event.duration }}</td> + </tr> + {% endif %} {% empty %} - <tr> - <td colspan="4">No events found.</td> - </tr> + <tr> + <td colspan="4">No events found.</td> + </tr> {% endfor %} </tbody> </table> diff --git a/production/templates/production/partials/stream_status_changes.html b/production/templates/production/partials/stream_status_changes.html index 6ade74af290681a717806091502ddbde14db562f..2ca717986c11031d2d961d05bc2a83ae96cffc60 100644 --- a/production/templates/production/partials/stream_status_changes.html +++ b/production/templates/production/partials/stream_status_changes.html @@ -1,14 +1,14 @@ {% load bootstrap %} {% if perms.scipost.can_take_decisions_related_to_proofs and form.fields.status.choices|length > 0 %} - <h3>Change current stream status:</h3> - <form method="post" action="{% url 'production:update_status' stream.id %}" class="form-inline"> - {% csrf_token %} - {{ form|bootstrap_inline }} - <div class="form-group row"> - <div class="col-form-label col ml-2"> - <button type="submit" class="btn btn-primary">Change</button> - </div> - </div> - </form> + <h3>Change current stream status:</h3> + <form method="post" action="{% url 'production:update_status' stream.id %}" class="form-inline"> + {% csrf_token %} + {{ form|bootstrap_inline }} + <div class="form-group row"> + <div class="col-form-label col ml-2"> + <button type="submit" class="btn btn-primary">Change</button> + </div> + </div> + </form> {% endif %} diff --git a/production/templates/production/production.html b/production/templates/production/production.html index a5821b1321a5a893982faf731f00b9328dc2ad7e..17956525816c044c954c65da74b3038ee8460e8c 100644 --- a/production/templates/production/production.html +++ b/production/templates/production/production.html @@ -1,7 +1,7 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - <span class="breadcrumb-item">Production page</span> + <span class="breadcrumb-item">Production page</span> {% endblock %} {% block pagetitle %}: Production page{% endblock pagetitle %} @@ -12,171 +12,171 @@ {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Production</h1> + <h1 class="highlight">Production</h1> </div> -</div> + </div> -<div class="row"> - <div class="col-12"> - <div class="tab-nav-container"> - <div class="tab-nav-inner"> - <ul class="nav btn-group personal-page-nav" role="tablist"> - <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> - {% if perms.scipost.can_promote_user_to_production_officer %} - <li class="nav-item btn btn-outline-secondary"> - <a href="#officers" class="nav-link" data-toggle="tab">Production Team</a> - </li> - {% endif %} - </ul> + <div class="row"> + <div class="col-12"> + <div class="tab-nav-container"> + <div class="tab-nav-inner"> + <ul class="nav btn-group personal-page-nav" role="tablist"> + <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> + {% if perms.scipost.can_promote_user_to_production_officer %} + <li class="nav-item btn btn-outline-secondary"> + <a href="#officers" class="nav-link" data-toggle="tab">Production Team</a> + </li> + {% endif %} + </ul> + </div> </div> </div> </div> -</div> -<div class="tab-content"> - <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> - <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 %}">{{ 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 class="tab-content"> + <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> + <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 %}">{{ 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> - <div class="tab-pane" id="mytimesheet" role="tabpanel"> - <div class="row"> - <div class="col-12"> - <h2 class="highlight">My Timesheet</h2> - {% if perms.scipost.can_view_timesheets %} + <div class="tab-pane" id="mytimesheet" role="tabpanel"> + <div class="row"> + <div class="col-12"> + <h2 class="highlight">My Timesheet</h2> + {% if perms.scipost.can_view_timesheets %} <a href="{% url 'finances:timesheets' %}">See team timesheets</a> - {% endif %} + {% endif %} + </div> </div> - </div> - <table class="table mb-5"> - <thead class="thead-default"> - <tr> - <th>Date</th> - <th>Comment</th> - <th>Stream</th> - <th>Log type</th> - <th>Duration</th> - </tr> - </thead> - <tbody role="tablist"> - {% for log in request.user.work_logs.all %} - <tr> - <td>{{ log.work_date }}</td> - <td>{{ log.comments }}</td> - <td>{{ log.content }}</td> - <td>{{ log.log_type }}</td> - <td>{{ log.duration|duration }}</td> - </tr> - {% empty %} - <tr> - <td colspan="4">No logs found.</td> - </tr> - {% endfor %} - </tbody> - </table> - </div> + <table class="table mb-5"> + <thead class="thead-default"> + <tr> + <th>Date</th> + <th>Comment</th> + <th>Stream</th> + <th>Log type</th> + <th>Duration</th> + </tr> + </thead> + <tbody role="tablist"> + {% for log in request.user.work_logs.all %} + <tr> + <td>{{ log.work_date }}</td> + <td>{{ log.comments }}</td> + <td>{{ log.content }}</td> + <td>{{ log.log_type }}</td> + <td>{{ log.duration|duration }}</td> + </tr> + {% empty %} + <tr> + <td colspan="4">No logs found.</td> + </tr> + {% endfor %} + </tbody> + </table> + </div> - {% if perms.scipost.can_promote_user_to_production_officer %} + {% if perms.scipost.can_promote_user_to_production_officer %} <div class="tab-pane" id="officers" role="tabpanel"> - <h2 class="highlight">Production Tream</h2> - <h3>Current Production Team</h3> - <ul> - {% for officer in production_officers %} - <li>{{ officer }} - <form action="{% url 'production:delete_officer' officer.id %}" class="d-inline px-1" method="post"> - {% csrf_token %} - <input type="submit" class="btn btn-danger mb-1" value="Remove Officer"> - </form> - </li> - {% endfor %} - </ul> - - {% if new_officer_form %} - <h3>Promote user to Production Officer</h3> - <form action="{% url 'production:user_to_officer' %}" method="post"> + <h2 class="highlight">Production Tream</h2> + <h3>Current Production Team</h3> + <ul> + {% for officer in production_officers %} + <li>{{ officer }} + <form action="{% url 'production:delete_officer' officer.id %}" class="d-inline px-1" method="post"> {% csrf_token %} - {{ new_officer_form|bootstrap }} - <input type="submit" class="btn btn-primary" value="Promote to Production Officer"> - </form> - {% endif %} + <input type="submit" class="btn btn-danger mb-1" value="Remove Officer"> + </form> + </li> + {% endfor %} + </ul> + + {% if new_officer_form %} + <h3>Promote user to Production Officer</h3> + <form action="{% url 'production:user_to_officer' %}" method="post"> + {% csrf_token %} + {{ new_officer_form|bootstrap }} + <input type="submit" class="btn btn-primary" value="Promote to Production Officer"> + </form> + {% endif %} </div> - {% endif %} + {% endif %} -</div> + </div> {% endblock content %} diff --git a/production/templates/production/productionevent_confirm_delete.html b/production/templates/production/productionevent_confirm_delete.html index 6661f0406c64a0637abe95540ca8bf4f8d2d2c27..d9ac5f91ff5e56fce6c0e7ee699677ee7f279a0b 100644 --- a/production/templates/production/productionevent_confirm_delete.html +++ b/production/templates/production/productionevent_confirm_delete.html @@ -1,39 +1,39 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <span class="breadcrumb-item">Delete production event</span> + {{block.super}} + <span class="breadcrumb-item">Delete production event</span> {% endblock %} {% load bootstrap %} {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Delete production event</h1> - {% include 'partials/submissions/submission_card_content.html' with submission=object.stream.submission %} + <h1 class="highlight">Delete production event</h1> + {% include 'partials/submissions/submission_card_content.html' with submission=object.stream.submission %} </div> -</div> -<div class="row"> - <div class="col-12"> + </div> + <div class="row"> + <div class="col-12"> <form method="post"> {% csrf_token %} - <h3 class="mb-2">Are you sure you want to delete this production event?</h3> - <div class="card card-outline-secondary"> - <div class="card-body"> - <p class="mb-0 font-weight-bold">{{ object.get_event_display }} - </p> - <p class="text-muted mb-1">noted {{ object.noted_on }} by {{ object.noted_by }}</p> - {% if object.comments %} - <div>{{ object.comments|linebreaks }}</div> - {% endif %} - </div> - </div> - <input type="submit" class="btn btn-danger" value="Yes, delete event" /> + <h3 class="mb-2">Are you sure you want to delete this production event?</h3> + <div class="card card-outline-secondary"> + <div class="card-body"> + <p class="mb-0 font-weight-bold">{{ object.get_event_display }} + </p> + <p class="text-muted mb-1">noted {{ object.noted_on }} by {{ object.noted_by }}</p> + {% if object.comments %} + <div>{{ object.comments|linebreaks }}</div> + {% endif %} + </div> + </div> + <input type="submit" class="btn btn-danger" value="Yes, delete event" /> </form> </ul> + </div> </div> -</div> {% endblock content %} diff --git a/production/templates/production/productionevent_form.html b/production/templates/production/productionevent_form.html index 5d89f7a75a031c69f612d0c22d519ef9ed66e831..83a6a5f5c82cb4b4723b4d1bc005ff864a4ebcff 100644 --- a/production/templates/production/productionevent_form.html +++ b/production/templates/production/productionevent_form.html @@ -1,29 +1,29 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <span class="breadcrumb-item">Edit production event</span> + {{block.super}} + <span class="breadcrumb-item">Edit production event</span> {% endblock %} {% load bootstrap %} {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Edit production event</h1> - {% include 'partials/submissions/submission_card_content.html' with submission=object.stream.submission %} + <h1 class="highlight">Edit production event</h1> + {% include 'partials/submissions/submission_card_content.html' with submission=object.stream.submission %} </div> -</div> -<div class="row"> - <div class="col-12"> + </div> + <div class="row"> + <div class="col-12"> <form method="post"> {% csrf_token %} {{ form|bootstrap }} <input type="submit" class="btn btn-outline-secondary" name="submit" value="Submit"> </form> </ul> + </div> </div> -</div> {% endblock content %} diff --git a/production/templates/production/proofs.html b/production/templates/production/proofs.html index b939acd9743c71e4413761dc6d3ce4007bb1ea30..28070da7bb1edb6b8842decf0ba01029ca916aff 100644 --- a/production/templates/production/proofs.html +++ b/production/templates/production/proofs.html @@ -1,49 +1,49 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <a href="{{ stream.get_absolute_url }}" class="breadcrumb-item">Production Stream</a> - <span class="breadcrumb-item">Proofs (version {{ proofs.version }})</span> + {{block.super}} + <a href="{{ stream.get_absolute_url }}" class="breadcrumb-item">Production Stream</a> + <span class="breadcrumb-item">Proofs (version {{ proofs.version }})</span> {% endblock %} {% load bootstrap %} {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Proofs (version {{ proofs.version }})</h1> - {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} + <h1 class="highlight">Proofs (version {{ proofs.version }})</h1> + {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} </div> -</div> -<div class="row"> + </div> + <div class="row"> <div class="col-12"> - <h3>Info</h3> - <ul> - <li>Version: {{ proofs.version }}</li> - <li>Status: <span class="label label-secondary label-sm">{{ proofs.get_status_display }}</span></li> - <li>Uploaded by: {{ proofs.uploaded_by }}</li> - <li>Accessible for Authors: {{ proofs.accessible_for_authors|yesno:'Yes,No' }}</li> - </ul> + <h3>Info</h3> + <ul> + <li>Version: {{ proofs.version }}</li> + <li>Status: <span class="label label-secondary label-sm">{{ proofs.get_status_display }}</span></li> + <li>Uploaded by: {{ proofs.uploaded_by }}</li> + <li>Accessible for Authors: {{ proofs.accessible_for_authors|yesno:'Yes,No' }}</li> + </ul> - <h3>Actions</h3> - <ul> - <li><a href="{% url 'production:proofs_pdf' proofs.slug %}" target="_blank">Download file</a></li> - {% if perms.scipost.can_run_proofs_by_authors %} - {% if proofs.status == 'uploaded' %} - <li> - <a href="{% url 'production:decision' proofs.stream.id proofs.version 'accept' %}">Accept proofs</a> - · - <a href="{% url 'production:decision' proofs.stream.id proofs.version 'decline' %}" class="text-danger">Decline proofs</a> - </li> - {% elif proofs.status == 'accepted_sup' %} - <li><a href="{% url 'production:send_proofs' proofs.stream.id proofs.version %}">Send proofs to authors</a></li> - {% else %} - <li><a href="{% url 'production:toggle_accessibility' proofs.stream.id proofs.version %}">{{ proofs.accessible_for_authors|yesno:'Hide,Make accessible' }} for authors</a></li> - {% endif %} - {% endif %} - </ul> + <h3>Actions</h3> + <ul> + <li><a href="{% url 'production:proofs_pdf' proofs.slug %}" target="_blank">Download file</a></li> + {% if perms.scipost.can_run_proofs_by_authors %} + {% if proofs.status == 'uploaded' %} + <li> + <a href="{% url 'production:decision' proofs.stream.id proofs.version 'accept' %}">Accept proofs</a> + · + <a href="{% url 'production:decision' proofs.stream.id proofs.version 'decline' %}" class="text-danger">Decline proofs</a> + </li> + {% elif proofs.status == 'accepted_sup' %} + <li><a href="{% url 'production:send_proofs' proofs.stream.id proofs.version %}">Send proofs to authors</a></li> + {% else %} + <li><a href="{% url 'production:toggle_accessibility' proofs.stream.id proofs.version %}">{{ proofs.accessible_for_authors|yesno:'Hide,Make accessible' }} for authors</a></li> + {% endif %} + {% endif %} + </ul> </div> -</div> + </div> {% endblock content %} diff --git a/production/templates/production/stream.html b/production/templates/production/stream.html index bc70003ea1f8812f83e4e23788ccee170d589a41..c5443a97054b4eec5565bc15503f5cc836fedbad 100644 --- a/production/templates/production/stream.html +++ b/production/templates/production/stream.html @@ -1,13 +1,13 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <span class="breadcrumb-item">Production Stream</span> + {{block.super}} + <span class="breadcrumb-item">Production Stream</span> {% endblock %} {% block content %} -<h1 class="highlight">Production Stream</h1> -{% include 'production/partials/production_stream_card.html' %} + <h1 class="highlight">Production Stream</h1> + {% include 'production/partials/production_stream_card.html' %} {% endblock content %} diff --git a/production/templates/production/upload_proofs.html b/production/templates/production/upload_proofs.html index 88289ff5915d0cdc623e60bc65d832182f1fa372..7c7704add1697527c6ef0a9ea1afbee7eea08c71 100644 --- a/production/templates/production/upload_proofs.html +++ b/production/templates/production/upload_proofs.html @@ -1,29 +1,29 @@ {% extends 'production/base.html' %} {% block breadcrumb_items %} - {{block.super}} - <span class="breadcrumb-item">Upload Proofs</span> + {{block.super}} + <span class="breadcrumb-item">Upload Proofs</span> {% endblock %} {% load bootstrap %} {% block content %} -<div class="row"> + <div class="row"> <div class="col-12"> - <h1 class="highlight">Upload Proofs</h1> - {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} + <h1 class="highlight">Upload Proofs</h1> + {% include 'partials/submissions/submission_card_content.html' with submission=stream.submission %} </div> -</div> -<div class="row"> - <div class="col-12"> + </div> + <div class="row"> + <div class="col-12"> <form method="post" enctype="multipart/form-data"> {% csrf_token %} {{ form|bootstrap }} <input type="submit" class="btn btn-outline-secondary" name="submit" value="Upload"> </form> </ul> + </div> </div> -</div> {% endblock content %}