Skip to content

Commit 2e681f5

Browse files
committed
Update dashboard round and labs section
1 parent 46fb3da commit 2e681f5

5 files changed

Lines changed: 135 additions & 170 deletions

File tree

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
{% extends 'funds/includes/round-block-listing.html' %}
2-
{% load i18n %}
2+
{% load i18n heroicons %}
33

44
{% block empty_round %}
5-
<p class="round-block__not-found">
6-
{% blocktrans with type=type|lower %}You have no {{ type }} rounds or labs assigned to you.{% endblocktrans %}
7-
</p>
5+
<div class="p-8 text-center">
6+
<div class="flex flex-col gap-2 items-center">
7+
{% heroicon_outline "archive-box-x-mark" class="w-12 h-12 text-base-content/30" stroke_width="1.5" aria_hidden="true" %}
8+
<p class="text-base-content/70">
9+
{% blocktrans with type=type|lower %}You have no {{ type }} rounds or labs assigned to you.{% endblocktrans %}
10+
</p>
11+
</div>
12+
</div>
813
{% endblock %}
Lines changed: 100 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,102 @@
1-
{% load i18n %}
1+
{% load i18n heroicons %}
22

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>
3085
{% 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>

hypha/apply/funds/templates/funds/includes/round-block.html

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
{% load i18n %}
2-
<div class="wrapper wrapper--bottom-space"
3-
x-data="{ activeTab: 'open-rounds' }"
4-
x-init="activeTab = window.location.hash && ['#open-rounds', '#closed-rounds'].includes(window.location.hash) ? window.location.hash.substring(1) : activeTab"
2+
<div
3+
class="wrapper wrapper--bottom-space"
4+
x-data="{ activeTab: 'open-rounds' }"
5+
x-init="activeTab = window.location.hash && ['#open-rounds', '#closed-rounds'].includes(window.location.hash) ? window.location.hash.substring(1) : activeTab"
56
>
6-
<section class="flex flex-col justify-between items-center md:flex-row">
7-
<h3 class="mb-2 text-xl">
8-
<a href="{% url 'apply:rounds:list' %}">{{ title }}</a>
9-
</h3>
10-
<div>
11-
<a
12-
class="tab__item tab__item--alt"
13-
href="#open-rounds"
14-
@click="activeTab = 'open-rounds'"
15-
:class="{ 'tab__item--active': activeTab === 'open-rounds' }"
16-
>{% trans "Open" %}</a>
7+
<section class="">
8+
<h2 class="justify-between card-title">
9+
<a href="{% url 'apply:rounds:list' %}" class="link link-hover">{{ title }}</a>
10+
11+
<div role="tablist" class="tabs tabs-border">
12+
<a
13+
role="tab"
14+
class="tab"
15+
href="#open-rounds"
16+
@click="activeTab = 'open-rounds'"
17+
:class="{ 'tab-active': activeTab === 'open-rounds' }"
18+
>{% trans "Open" %}</a>
19+
20+
<a
21+
role="tab"
22+
class="tab"
23+
href="#closed-rounds"
24+
@click="activeTab = 'closed-rounds'"
25+
:class="{ 'tab-active': activeTab === 'closed-rounds' }"
26+
>{% trans "Closed" %}</a>
27+
</div>
28+
</h2>
1729

18-
<a
19-
class="tab__item tab__item--alt"
20-
href="#closed-rounds"
21-
@click="activeTab = 'closed-rounds'"
22-
:class="{ 'tab__item--active': activeTab === 'closed-rounds' }"
23-
>{% trans "Closed" %}</a>
24-
</div>
2530
</section>
2631

2732
{# Open rounds/labs tab #}

hypha/static_src/sass/components/_round-block.scss

Lines changed: 0 additions & 102 deletions
This file was deleted.

hypha/static_src/sass/main.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
@use "components/reviews-sidebar";
2020
@use "components/reviews-summary";
2121
@use "components/rich-text";
22-
@use "components/round-block";
2322
@use "components/sidebar";
2423
@use "components/status-block";
2524
@use "components/submission-meta";

0 commit comments

Comments
 (0)