From 6ecfecc944f9d0e7ef245e995e2e36a988f9db98 Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Thu, 28 Dec 2023 15:21:17 +0200 Subject: [PATCH] add worklog indicator to fellowship details --- .../templates/colleges/fellowship_detail.html | 150 ++++++++++++------ 1 file changed, 102 insertions(+), 48 deletions(-) diff --git a/scipost_django/colleges/templates/colleges/fellowship_detail.html b/scipost_django/colleges/templates/colleges/fellowship_detail.html index 4694a11c6..c9e067041 100644 --- a/scipost_django/colleges/templates/colleges/fellowship_detail.html +++ b/scipost_django/colleges/templates/colleges/fellowship_detail.html @@ -7,12 +7,14 @@ <span class="breadcrumb-item">Fellowship details</span> {% endblock %} -{% block pagetitle %}: Fellowship details{% endblock pagetitle %} +{% block pagetitle %} + : Fellowship details +{% endblock pagetitle %} {% block content %} <h1 class="highlight">Fellowship details</h1> <h2 class="text-primary">{{ fellowship }}</h2> - <br> + <br /> <div class="row"> <div class="col-md-6"> @@ -26,27 +28,36 @@ </tr> <tr> <th>Fellow</th> - <td><a href="{{ fellowship.contributor.profile.get_absolute_url }}">{{ fellowship.contributor }}</a></td> - </tr> - {% if "edadmin" in user_roles %} - <tr> - <th>Primary email</th> - <td><a href="mailto:{{ fellowship.contributor.profile.email }}?body=Dear%20{{ fellowship.contributor.formal_str }},%0A%0A" - class="text-primary">{{ fellowship.contributor.profile.email }}</a> + <td> + <a href="{{ fellowship.contributor.profile.get_absolute_url }}">{{ fellowship.contributor }}</a> </td> </tr> + + {% if "edadmin" in user_roles %} + <tr> + <th>Primary email</th> + <td> + <a href="mailto:{{ fellowship.contributor.profile.email }}?body=Dear%20{{ fellowship.contributor.formal_str }},%0A%0A" + class="text-primary">{{ fellowship.contributor.profile.email }}</a> + </td> + </tr> {% endif %} + <tr> <th>Academic field</th> <td>{{ fellowship.contributor.profile.acad_field }}</td> </tr> <tr> <th>Start date</th> - <td>{{ fellowship.start_date|default:'<i>No start date</i>' }}</td> + <td> + {{ fellowship.start_date|default:'<i>No start date</i>' }} + </td> </tr> <tr> <th>End date</th> - <td>{{ fellowship.until_date|default:'<i>No end date</i>' }}</td> + <td> + {{ fellowship.until_date|default:'<i>No end date</i>' }} + </td> </tr> <tr> <th>Pool size</th> @@ -55,30 +66,37 @@ <tr> <th>Type</th> <td> - {% if fellowship.guest %} - <span class="text-warning">Guest</span> - {% elif fellowship.senior %} - <span class="text-success">Senior</span> - {% else %} - <span class="text-primary">Regular</span> - {% endif %} -` </td> + + {% if fellowship.guest %} + <span class="text-warning">Guest</span> + {% elif fellowship.senior %} + <span class="text-success">Senior</span> + {% else %} + <span class="text-primary">Regular</span> + {% endif %} + + ` + </td> </tr> </tbody> </table> <p> - <a href="{% url 'colleges:fellowship_update' fellowship.id %}" class="btn btn-info ms-2">Update this Fellowship</a><br/> - <small>[hint: to terminate it, just set the <em>until_date</em> to today]</small> + <a href="{% url 'colleges:fellowship_update' fellowship.id %}" + class="btn btn-info ms-2">Update this Fellowship</a> + <br /> + <small>[hint: to terminate it, just set the <em>until_date</em> to today]</small> </p> </div> <div class="col-md-6"> <div class="adminLinks"> - <h3>Admin actions</h3> - <ul> - <li>After initial setup: <a href="{% url 'colleges:fellowship_email_start' pk=fellowship.id %}">send Fellowship start email</a></li> - </ul> + <h3>Admin actions</h3> + <ul> + <li> + After initial setup: <a href="{% url 'colleges:fellowship_email_start' pk=fellowship.id %}">send Fellowship start email</a> + </li> + </ul> </div> <h3>All fellowships of this fellow</h3> @@ -92,32 +110,42 @@ </tr> </thead> <tbody> + {% for fship in fellowship.sibling_fellowships %} <tr> <td>{{ fship.id }}</td> <td> - {% if fship.guest %} - <span class="text-warning">Guest</span> - {% elif fship.senior %} - <span class="text-success">Senior</span> - {% else %} - <span class="text-primary">Regular</span> - {% endif %} - </td> - <td> - {% if fship.start_date %} - from {{ fship.start_date }} - {% endif %} - {% if fship.until_date %} - until {{ fship.until_date }} + + {% if fship.guest %} + <span class="text-warning">Guest</span> + {% elif fship.senior %} + <span class="text-success">Senior</span> + {% else %} + <span class="text-primary">Regular</span> {% endif %} - {% if not fship.start_date and not fship.until_date %} - <i>Unlimited</i> + + </td> + <td> + + {% if fship.start_date %}from {{ fship.start_date }}{% endif %} + + {% if fship.until_date %}until {{ fship.until_date }}{% endif %} + + {% if not fship.start_date and not fship.until_date %}<i>Unlimited</i>{% endif %} + + </td> + <td> + + {% if fship.id != fellowship.id %} + <a href="{{ fship.get_absolute_url }}">See details</a> + {% else %} + (this page) {% endif %} + </td> - <td>{% if fship.id != fellowship.id %}<a href="{{ fship.get_absolute_url }}">See details</a>{% else %}(this page){% endif %}</td> </tr> {% endfor %} + </tbody> </table> <a href="{% url 'colleges:fellowship_create' contributor_id=fellowship.contributor.id %}">Add new Fellowship for {{ fellowship.contributor }}</a> @@ -138,30 +166,46 @@ </tr> </thead> <tbody> + {% for proceedings in fellowship.proceedings.all %} <tr> <td>{{ proceedings.event_name }}</td> - <td><a href="{{ proceedings.get_absolute_url }}">{{ proceedings.issue }}</a></td> + <td> + <a href="{{ proceedings.get_absolute_url }}">{{ proceedings.issue }}</a> + </td> <td>{{ proceedings.submissions_open }}</td> <td>{{ proceedings.submissions_deadline }}</td> <td>{{ proceedings.submissions_close }}</td> - <td><a class="text-danger" href="{% url 'colleges:fellowship_remove_proceedings' fellowship.id proceedings.id %}">Remove Proceedings</a></td> + <td> + <a class="text-danger" + href="{% url 'colleges:fellowship_remove_proceedings' fellowship.id proceedings.id %}">Remove Proceedings</a> + </td> </tr> {% endfor %} + <tr> - <td colspan="6" class="py-3 text-center"><a href="{% url 'colleges:fellowship_add_proceedings' fellowship.id %}">Add Proceedings to Guest Fellowship</a></td> + <td colspan="6" class="py-3 text-center"> + <a href="{% url 'colleges:fellowship_add_proceedings' fellowship.id %}">Add Proceedings to Guest Fellowship</a> + </td> </tr> </tbody> </table> {% endif %} - <h3 class="highlight">Assignments</h3> + <div class="highlight d-flex justify-content-between p-2"> + <h3 class="m-0 ">Assignments</h3> + <h5 class="m-0 ms-3 pe-2"> + Workload indicator + {% include "icons/reception.html" with value=fellowship.contributor.editorial_assignments.ongoing.count max=4 %} + </h5> + </div> <div class="row"> <div class="col-12"> <h4>Ongoing:</h4> </div> <div class="col-12"> <ul class="list-group list-group-flush"> + {% for assignment in fellowship.contributor.editorial_assignments.ongoing %} <li class="list-group-item"> <div class="card-body px-0"> @@ -172,6 +216,7 @@ {% empty %} <li class="list-group-item">No ongoing assignments</li> {% endfor %} + </ul> </div> @@ -181,6 +226,7 @@ <div class="col-12"> <ul class="list-group list-group-flush"> + {% for assignment in fellowship.contributor.editorial_assignments.completed %} <li class="list-group-item"> <div class="card-body px-0"> @@ -191,6 +237,7 @@ {% empty %} <li class="list-group-item">No completed assignments</li> {% endfor %} + </ul> </div> </div> @@ -204,6 +251,7 @@ </tr> </thead> <tbody> + {% for submission in fellowship.pool.all %} <tr> <td> @@ -211,16 +259,22 @@ </td> <td>{{ submission.get_status_display }}</td> <td> + {% if submission.editor_in_charge == fellowship.contributor %} <strong>Fellow is Editor-in-charge</strong> {% else %} - <a class="text-danger" href="{% url 'colleges:fellowship_remove_submission' fellowship.id submission.preprint.identifier_w_vn_nr %}">Remove from this Fellowship's pool</a> + <a class="text-danger" + href="{% url 'colleges:fellowship_remove_submission' fellowship.id submission.preprint.identifier_w_vn_nr %}">Remove from this Fellowship's pool</a> {% endif %} + </td> </tr> {% endfor %} + <tr> - <td colspan="3" class="py-3 text-center"><a href="{% url 'colleges:fellowship_add_submission' fellowship.id %}">Add Submission to this Fellowship's pool</a></td> + <td colspan="3" class="py-3 text-center"> + <a href="{% url 'colleges:fellowship_add_submission' fellowship.id %}">Add Submission to this Fellowship's pool</a> + </td> </tr> </tbody> </table> -- GitLab