Skip to content

Commit

Permalink
Tweaks to new convenor project popularity dashboard table
Browse files Browse the repository at this point in the history
  • Loading branch information
ds283 committed Mar 25, 2024
1 parent 9c08133 commit 69316fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions app/tasks/popularity.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, timedelta
from math import floor
from typing import List, Tuple
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
{% set d = delta['score_rank'] %}
{% if d is not none %}
{% if d > 0 %}
<span class="text-success {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<span class="ms-2 text-success {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<i class="fas fa-caret-up"></i> {{ d }}
</span>
{% elif d < 0 %}
<span class="text-danger {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<span class="ms-2 text-danger {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<i class="fas fa-caret-down"></i> {{ -d }}
</span>
{% else %}
<span class="text-secondary {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<i class="fas fa-equals"></i> {{ 0 }}
<span class="ms-2 text-secondary {% if user_classes is not none %}{{ user_classes }}{% endif %}">
<i class="fas fa-equals"></i>
</span>
{% endif %}
{% if period is not none %}
<span class="ms-2 text-muted {% if user_classes is not none %}{{ user_classes }}{% endif %}"></span>
<span class="ms-2 text-muted
{% if user_classes is not none %}{{ user_classes }}{% endif %}">{{ period }}</span>
{% endif %}
{% endif %}
{% endif %}
Expand Down Expand Up @@ -234,13 +235,13 @@
{% if popular_data is not none %}
<div class="row mb-3">
<div class="col">
{% call dashboard_tile("Popular projects", title_icon="arrow-up", icon_state=none) %}
{% call dashboard_tile("Popular projects", title_icon="arrow-up", icon_state=none, user_block_classes="w-100") %}
<table class="table table-sm table-striped">
<thead>
<tr>
<th width="25% small">Project</th>
<th width="20% small">Owner</th>
<th width="15% small">Last view</th>
<th width="15% small">Owner</th>
<th width="20% small">Last view</th>
<th width="10% small">Popularity</th>
<th width="10% small">Selections</th>
<th width="10% small">Bookmarks</th>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/dashboard_widgets.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% macro dashboard_tile(title, title_icon=none, icon_state=none, border=false, bg="light") %}
{% macro dashboard_tile(title, title_icon=none, icon_state=none, border=false, bg="light", user_block_classes=none) %}
<div class="card {% if border %}border-2{% else %}border-0{% endif %} bg-{{ bg }} h-100">
<div class="card-body">
<div class="row">
<div class="col d-flex justify-content-between">
<div>
<div {% if user_block_classes is not none %}class="{{ user_block_classes }}"{% endif %}>
<div class="d-flex flex-row gap-2 justify-content-left align-items-start">
{% set text_class = "text-success" if icon_state is true else ("text-warning" if icon_state is false else "text-secondary") %}
<i class="{{ text_class }} fs-6 fas fa-{{ title_icon }} me-1 pt-1"></i>
Expand Down

0 comments on commit 69316fb

Please sign in to comment.