Skip to content

Commit

Permalink
Add "last updated" tag to popular projects table
Browse files Browse the repository at this point in the history
  • Loading branch information
ds283 committed Mar 27, 2024
1 parent 71748ae commit 8adaa80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/shared/context/global_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# Contributors: David Seery <D.Seery@sussex.ac.uk>

from datetime import datetime
from typing import List

from flask import has_request_context, session, render_template
Expand Down Expand Up @@ -99,6 +100,7 @@ def _build_global_context():

# assumes _static_ctx has been suitably initialized
return _static_ctx | {
"current_time": datetime.now(),
"real_user": _get_previous_login(),
"home_dashboard_url": home_dashboard_url(),
"is_faculty": is_faculty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{% endif %}
{% endmacro %}

{% macro selection_open(config, change_form, data) %}
{% macro selection_open(config, change_form, data, current_time) %}
<div class="card border-secondary mt-3 mb-3">
<div class="card-header">
<strong>Student selections are currently live</strong>
Expand Down Expand Up @@ -331,7 +331,11 @@
</tbody>
</table>
{% elif blk == 'footer' %}
<div class="small text-muted mt-3">Comparison to 3 days ago</div>
<div class="d-flex flex-row justify-content-between align-items-baseline mt-3">
<div class="small text-muted">Comparison to 3 days ago</div>
<div class="small text-muted">Last
updated: {{ current_time.strftime("%a %d %b %Y %H:%M:%S") }}</div>
</div>
{% endif %}
{% endcall %}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/convenor/dashboard/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
{% elif state == config.SELECTOR_LIFECYCLE_READY_GOLIVE %}
{{ golive(config, golive_form, approval_data) }}
{% elif state == config.SELECTOR_LIFECYCLE_SELECTIONS_OPEN %}
{{ selection_open(config, change_form, convenor_data) }}
{{ selection_open(config, change_form, convenor_data, current_time) }}
{% elif state == config.SELECTOR_LIFECYCLE_READY_MATCHING or state == config.SELECTOR_LIFECYCLE_READY_ROLLOVER%}
{{ selection_closed(config, rollover_in_progress, convenor_data) }}
{% else %}
Expand Down

0 comments on commit 8adaa80

Please sign in to comment.