|
1 | | -{% load i18n %} |
| 1 | +{% load i18n heroicons %} |
2 | 2 |
|
3 | | -<ul class="round-block"> |
4 | | - {% for round in rounds %} |
5 | | - {% if forloop.counter0 < 5 %} |
6 | | - <li class="round-block__item"> |
7 | | - <a href="{{round.get_absolute_url}}" |
8 | | - class="round-block__title hover:text-dark-blue" |
9 | | - >{{ round }}</a> |
10 | | - <p class="round-block__fund"> |
11 | | - {{ round.fund|default_if_none:"-" }} </p> |
12 | | - <p class="round-block__date"> |
13 | | - {% if round.end_date %} |
14 | | - {{ display_text }} {{ round.end_date|date:"SHORT_DATE_FORMAT" }} |
15 | | - {% else %} |
16 | | - {% trans "Open" %} |
17 | | - {% endif %} |
18 | | - </p> |
19 | | - <p class="round-block__determination"> |
20 | | - {% if round.progress is None %} |
21 | | - - |
22 | | - {% else %} |
23 | | - {{ round.progress }}% {% trans 'Determined' %} ({{ round.closed_submissions }}/{{ round.total_submissions }}) |
24 | | - {% endif %} |
25 | | - </p> |
26 | | - <a class="round-block__view" href="{{round.get_absolute_url}}">{% trans 'View' %} |
27 | | - </a> |
28 | | - {% if can_export %} |
29 | | - <a class="round-block__view" href="{% url 'apply:submissions:list' %}{% if round.fund %}?round={{round.pk}}{% else %}?fund={{round.pk}}{% endif %}&format=csv" onclick="return confirm('{% blocktrans %}Are you sure you want to download the submissions as a csv file? This file may contain sensitive information, so please handle it carefully.{% endblocktrans %}');">{% trans 'Export' %}</a> |
| 3 | +<div class="card card-border shadow-xs"> |
| 4 | + <div class="p-0 card-body"> |
| 5 | + <ul class="divide-y divide-base-200"> |
| 6 | + {% for round in rounds %} |
| 7 | + {% if forloop.counter0 < 5 %} |
| 8 | + <li class="transition-all duration-200 group hover:bg-base-200/50"> |
| 9 | + <div class="flex flex-col gap-4 p-4 sm:grid sm:grid-cols-12 sm:gap-4 sm:items-center"> |
| 10 | + <!-- Title and Fund --> |
| 11 | + <div class="sm:col-span-5 lg:col-span-6"> |
| 12 | + <div class="flex flex-col gap-1"> |
| 13 | + <a href="{{ round.get_absolute_url }}" |
| 14 | + class="text-lg font-semibold transition-colors duration-200 text-base-content line-clamp-2 sm:line-clamp-1 hover:text-primary"> |
| 15 | + {{ round }} |
| 16 | + </a> |
| 17 | + <div class="flex flex-wrap gap-2 items-center"> |
| 18 | + <span class="badge badge-info badge-outline badge-sm"> |
| 19 | + {% if round.end_date %} |
| 20 | + {{ display_text }} {{ round.end_date|date:"SHORT_DATE_FORMAT" }} |
| 21 | + {% else %} |
| 22 | + {% trans "Open" %} |
| 23 | + {% endif %} |
| 24 | + </span> |
| 25 | + {% if round.fund %} |
| 26 | + <span class="text-sm text-base-content/70">{{ round.fund }}</span> |
| 27 | + {% endif %} |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + </div> |
| 31 | + |
| 32 | + <!-- Progress --> |
| 33 | + <div class="sm:col-span-4 lg:col-span-3"> |
| 34 | + {% if round.progress is not None %} |
| 35 | + <div class="flex gap-3 items-center"> |
| 36 | + <div |
| 37 | + class="radial-progress text-info" |
| 38 | + style="--value:{{ round.progress }}; --size:2.5rem; --thickness:.2rem;" |
| 39 | + class="sm:[--size:3rem] sm:[--thickness:.25rem]" |
| 40 | + aria-valuenow="{{ round.progress }}" |
| 41 | + role="progressbar" |
| 42 | + > |
| 43 | + <span class="text-xs font-semibold">{{ round.progress }}%</span> |
| 44 | + </div> |
| 45 | + <div class="text-sm text-base-content/70"> |
| 46 | + <span class="sm:block">{% trans 'Determined' %}</span> |
| 47 | + <span class="font-medium">{{ round.closed_submissions }}/{{ round.total_submissions }}</span> |
| 48 | + </div> |
| 49 | + </div> |
| 50 | + {% else %} |
| 51 | + <div class="hidden sm:block text-base-content/50">—</div> |
| 52 | + {% endif %} |
| 53 | + </div> |
| 54 | + |
| 55 | + <!-- Actions --> |
| 56 | + <div class="flex gap-2 sm:col-span-3 sm:justify-end"> |
| 57 | + <a class="flex-1 sm:flex-initial btn btn-primary btn-sm" |
| 58 | + href="{{ round.get_absolute_url }}" |
| 59 | + aria-label="{% trans 'View details for' %} {{ round }}" |
| 60 | + > |
| 61 | + {% heroicon_outline "eye" aria_hidden="true" class="w-4 h-4 sm:hidden lg:block" stroke_width="1.5" %} |
| 62 | + {% trans 'View' %} |
| 63 | + </a> |
| 64 | + {% if can_export %} |
| 65 | + <a class="flex-1 sm:flex-initial btn btn-outline btn-secondary btn-sm" |
| 66 | + href="{% url 'apply:submissions:list' %}{% if round.fund %}?round={{ round.pk }}{% else %}?fund={{ round.pk }}{% endif %}&format=csv" |
| 67 | + onclick="return confirm('{% blocktrans %}Are you sure you want to download the submissions as a csv file? This file may contain sensitive information, so please handle it carefully.{% endblocktrans %}');"> |
| 68 | + {% heroicon_mini "arrow-down-tray" aria_hidden="true" class="w-4 h-4 sm:hidden lg:block" stroke_width="1.5" %} |
| 69 | + {% trans 'Export' %} |
| 70 | + </a> |
| 71 | + {% endif %} |
| 72 | + </div> |
| 73 | + </div> |
| 74 | + </li> |
| 75 | + {% else %} |
| 76 | + <li class="bg-base-200/30"> |
| 77 | + <div class="p-2 text-center"> |
| 78 | + <a href="{% url 'apply:rounds:list' %}{{ query }}" |
| 79 | + class="btn btn-ghost btn-sm"> |
| 80 | + {% trans 'Show all' %} |
| 81 | + {% heroicon_mini "arrow-right" class="w-4 h-4" aria_hidden="true" stroke_width="1.5" %} |
| 82 | + </a> |
| 83 | + </div> |
| 84 | + </li> |
30 | 85 | {% endif %} |
31 | | - </li> |
32 | | - {% else %} |
33 | | - <li class="round-block__item round-block__item--more"> |
34 | | - <a href="{% url 'apply:rounds:list' %}{{ query }}">{% trans 'Show all' %}</a> |
35 | | - </li> |
36 | | - {% endif %} |
37 | | - {% empty %} |
38 | | - {% block empty_round %} |
39 | | - <p class="round-block__not-found"> |
40 | | - {% trans "There are no" %} {% if round.end_date %} {{ display_text|lower }} {% else %} {{ type|lower }} {% endif %} {% trans "rounds" %} |
41 | | - </p> |
42 | | - {% endblock %} |
43 | | - {% endfor %} |
44 | | -</ul> |
| 86 | + {% empty %} |
| 87 | + {% block empty_round %} |
| 88 | + <li class="p-8 text-center"> |
| 89 | + <div class="flex flex-col gap-2 items-center"> |
| 90 | + <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-12 h-12 text-base-content/30"> |
| 91 | + <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5m6 4.125l2.25 2.25m0 0l2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z" /> |
| 92 | + </svg> |
| 93 | + <p class="text-base-content/70"> |
| 94 | + {% trans "There are no" %} {% if round.end_date %} {{ display_text|lower }} {% else %} {{ type|lower }} {% endif %} {% trans "rounds" %} |
| 95 | + </p> |
| 96 | + </div> |
| 97 | + </li> |
| 98 | + {% endblock %} |
| 99 | + {% endfor %} |
| 100 | + </ul> |
| 101 | + </div> |
| 102 | +</div> |
0 commit comments