Skip to content

Commit

Permalink
Change dashboard tile implementation to align footers
Browse files Browse the repository at this point in the history
  • Loading branch information
ds283 committed Mar 25, 2024
1 parent 21c6275 commit 553f12d
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,31 @@
{% set rejected_ok = rejected == 0 %}
<div class="row gy-3">
<div class="col-3">
{% call dashboard_tile("Approved", title_icon="check-circle", icon_state=approved_ok) %}
<span class="fw-bold fs-1 {% if approved_ok %}text-success{% else %}text-primary{% endif %}">{{ approved }}</span>
{% call(blk) dashboard_tile("Approved", title_icon="check-circle", icon_state=approved_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if approved_ok %}text-success{% else %}text-primary{% endif %}">{{ approved }}</span>
{% endif %}
{% endcall %}
</div>
<div class="col-3">
{% call dashboard_tile("Rejected", title_icon="times-circle", icon_state=rejected_ok) %}
<span class="fw-bold fs-1 {% if rejected_ok %}text-success{% else %}text-danger{% endif %}">{{ rejected }}</span>
{% call(blk) dashboard_tile("Rejected", title_icon="times-circle", icon_state=rejected_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if rejected_ok %}text-success{% else %}text-danger{% endif %}">{{ rejected }}</span>
{% endif %}
{% endcall %}
</div>
<div class="col-3">
{% call dashboard_tile("Pending", title_icon="circle", icon_state=pending_ok) %}
<span class="fw-bold fs-1 {% if pending_ok %}text-success{% else %}text-primary{% endif %}">{{ pending }}</span>
{% call(blk) dashboard_tile("Pending", title_icon="circle", icon_state=pending_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if pending_ok %}text-success{% else %}text-primary{% endif %}">{{ pending }}</span>
{% endif %}
{% endcall %}
</div>
<div class="col-3">
{% call dashboard_tile("Queued", title_icon="circle", icon_state=queued_ok) %}
<span class="fw-bold fs-1 {% if queued_ok %}text-success{% else %}text-primary{% endif %}">{{ queued }}</span>
{% call(blk) dashboard_tile("Queued", title_icon="circle", icon_state=queued_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if queued_ok %}text-success{% else %}text-primary{% endif %}">{{ queued }}</span>
{% endif %}
{% endcall %}
</div>
</div>
Expand Down
47 changes: 28 additions & 19 deletions app/templates/convenor/dashboard/overview_cards/period_closed.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,50 +34,59 @@
{% set not_pushed_ok = not_pushed > 0 %}
<div class="row gy-3 {{ topclass }}">
<div class="col">
{% call dashboard_tile("Pushed", title_icon="check-circle", icon_state=pushed_ok) %}
<span class="fw-bold fs-1 {% if pushed_ok %}text-success{% else %}text-primary{% endif %}">{{ pushed }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% call(blk) dashboard_tile("Pushed", title_icon="check-circle", icon_state=pushed_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if pushed_ok %}text-success{% else %}text-primary{% endif %}">{{ pushed }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% endif %}
{% endcall %}
</div>
<div class="col">
{% call dashboard_tile("Ready", title_icon="circle", icon_state=not_pushed_ok) %}
<span class="fw-bold fs-1 {% if not_pushed_ok %}text-success{% else %}text-secondary{% endif %}">{{ not_pushed }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% if not_pushed > 0 %}
<div class="small mb-0">
<div>
{% call(blk) dashboard_tile("Ready", title_icon="circle", icon_state=not_pushed_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if not_pushed_ok %}text-success{% else %}text-secondary{% endif %}">{{ not_pushed }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% elif blk == 'footer' %}
{% if not_pushed > 0 %}
<div class="small mb-0">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.push_feedback', id=period.id) }}">
Push feedback
</a>
</div>
</div>
{% endif %}
{% endif %}
{% endcall %}
</div>
{% if period.collect_project_feedback %}
{% set supv_ok = supv == total %}
{% set mark_ok = mark == total %}
<div class="col">
{% call dashboard_tile("Supervisors", title_icon="circle", icon_state=supv_ok) %}
<span class="fw-bold fs-1 {% if supv_ok %}text-success{% else %}text-primary{% endif %}">{{ supv }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% call(blk) dashboard_tile("Supervisors", title_icon="circle", icon_state=supv_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if supv_ok %}text-success{% else %}text-primary{% endif %}">{{ supv }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% endif %}
{% endcall %}
</div>
<div class="col">
{% call dashboard_tile("Examiners", title_icon="circle", icon_state=mark_ok) %}
<span class="fw-bold fs-1 {% if mark_ok %}text-success{% else %}text-primary{% endif %}">{{ mark }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% call(blk) dashboard_tile("Examiners", title_icon="circle", icon_state=mark_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if mark_ok %}text-success{% else %}text-primary{% endif %}">{{ mark }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% endif %}
{% endcall %}
</div>
{% endif %}
{% if period.has_presentation and period.collect_presentation_feedback %}
{% set pres = period.number_submitters_presentation_feedback %}
{% set pres_ok = pres == total %}
<div class="col">
{% call dashboard_tile("Presentation", title_icon="circle", icon_state=mark_ok) %}
<span class="fw-bold fs-1 {% if pres_ok %}text-success{% else %}text-primary{% endif %}">{{ pres }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% call(blk) dashboard_tile("Presentation", title_icon="circle", icon_state=mark_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if pres_ok %}text-success{% else %}text-primary{% endif %}">{{ pres }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% endif %}
{% endcall %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,57 +82,66 @@
{% set custom_ok = outstanding_custom == 0 %}
<div class="row gy-3">
<div class="col">
{% call dashboard_tile("Submitted", title_icon="circle", icon_state=submitted_ok) %}
<span class="fw-bold fs-1 {% if submitted_ok %}text-primary{% else %}text-warning{% endif %}">{{ submitted }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
<div class="small mb-0 d-flex flex-column gap-1 justify-content-start align-content-start">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.project_class.id, state_filter='submitted') }}">View
selectors
</a>
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selector_grid', id=config.pclass_id) }}">
View selector grid
</a>
</div>
{% call(blk) dashboard_tile("Submitted", title_icon="circle", icon_state=submitted_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if submitted_ok %}text-primary{% else %}text-warning{% endif %}">{{ submitted }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% elif blk == 'footer' %}
<div class="small mb-0 d-flex flex-column gap-1 justify-content-start align-content-start">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.project_class.id, state_filter='submitted') }}">View
selectors
</a>
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selector_grid', id=config.pclass_id) }}">
View selector grid
</a>
</div>
{% endif %}
{% endcall %}
</div>
<div class="col">
{% call dashboard_tile("Missing", title_icon="circle", icon_state=missing_ok) %}
<span class="fw-bold fs-1 {% if missing_ok %}text-primary{% else %}text-warning{% endif %}">{{ missing }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
<div class="small mb-0">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.project_class.id, state_filter='none') }}">View
selectors</a>
</div>
{% call(blk) dashboard_tile("Missing", title_icon="circle", icon_state=missing_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if missing_ok %}text-primary{% else %}text-warning{% endif %}">{{ missing }}</span>
<span class="fs-4 text-muted">/{{ total }}</span>
{% elif blk == 'footer' %}
<div class="small mb-0">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.project_class.id, state_filter='none') }}">View
selectors</a>
</div>
{% endif %}
{% endcall %}
</div>
<div class="col">
{% call dashboard_tile("Custom offers", title_icon="circle", icon_state=custom_ok) %}
<span class="fw-bold fs-1 {% if custom_ok > 0 %}text-primary{% else %}text-warning{% endif %}">{{ outstanding_custom }}</span>
<span class="text-muted"><span class="fs-4">/{{ custom_total }}</span> <span
class="text-uppercase">outstanding</span></span>
<div class="text-secondary mt-4 d-flex flex-column gap-1 justify-content-start align-content-start small">
{% if custom_accepted > 0 %}
<span class="text-secondary"><span
class="fw-semibold">{{ custom_accepted }}</span>/{{ custom_total }} <span
class="text-uppercase">accepted</span></span>
{% endif %}
{% if custom_declined > 0 %}
<span class="text-secondary"><span
class="fw-semibold">{{ custom_declined }}</span>/{{ custom_total }} <span
class="text-uppercase">declined</span></span>
{% endif %}
</div>
<div class="small mb-0 mt-2 d-flex flex-column gap-1 justify-content-start align-items-start">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.liveprojects', id=config.pclass_id, state_filter='custom') }}">View
offers by project</a>
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.pclass_id, state_filter='custom') }}">View
offers by selector</a>
</div>
{% call(blk) dashboard_tile("Custom offers", title_icon="circle", icon_state=custom_ok) %}
{% if blk == 'body' %}
<span class="fw-bold fs-1 {% if custom_ok > 0 %}text-primary{% else %}text-warning{% endif %}">{{ outstanding_custom }}</span>
<span class="text-muted"><span class="fs-4">/{{ custom_total }}</span> <span
class="text-uppercase">outstanding</span></span>
<div class="text-secondary mt-4 d-flex flex-column gap-1 justify-content-start align-content-start small">
{% if custom_accepted > 0 %}
<span class="text-secondary"><span
class="fw-semibold">{{ custom_accepted }}</span>/{{ custom_total }} <span
class="text-uppercase">accepted</span></span>
{% endif %}
{% if custom_declined > 0 %}
<span class="text-secondary"><span
class="fw-semibold">{{ custom_declined }}</span>/{{ custom_total }} <span
class="text-uppercase">declined</span></span>
{% endif %}
</div>
{% elif blk == 'footer' %}
<div class="small mb-0 mt-2 d-flex flex-column gap-1 justify-content-start align-items-start">
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.liveprojects', id=config.pclass_id, state_filter='custom') }}">View
offers by project</a>
<a class="text-decoration-none link-primary"
href="{{ url_for('convenor.selectors', id=config.pclass_id, state_filter='custom') }}">View
offers by selector</a>
</div>
{% endif %}
{% endcall %}
</div>
</div>
Expand Down
Loading

0 comments on commit 553f12d

Please sign in to comment.