Skip to content

Commit 340cf8f

Browse files
committed
Review sidebar updates
1 parent 44e89f4 commit 340cf8f

4 files changed

Lines changed: 48 additions & 68 deletions

File tree

hypha/apply/funds/templates/funds/applicationsubmission_reviewer_detail.html

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load i18n static workflow_tags review_tags determination_tags %}
33

44
{% block flags %}
5-
<section class="card card-border bg-base-100 text-base-content" id="screening-status-{{ object.id }}">
5+
<section class="card card-border bg-base-100 shadow-xs" id="screening-status-{{ object.id }}">
66
<div class="card-body">
77
<h2 class="card-title">{% trans "Flags" %}</h2>
88
{% include 'flags/flags.html' with submission=object user=request.user %}
@@ -11,24 +11,26 @@ <h2 class="card-title">{% trans "Flags" %}</h2>
1111
{% endblock %}
1212

1313
{% block reviews %}
14-
<div class="card card-border bg-base-100 text-base-content">
15-
<h5>{% trans "Reviews & assignees" %}</h5>
14+
<div class="card card-border bg-base-100 shadow-xs">
15+
<div class="card-body">
16+
<h2 class="card-title">{% trans "Reviews & assignees" %}</h2>
1617

17-
<div
18-
hx-trigger="revealed"
19-
hx-get="{% url 'funds:submissions:partial-reviews-card' object.id %}"
20-
hx-target="this"
21-
>
22-
<div class="animate-pulse min-h-30">
23-
<div class="mb-3 w-full h-9 bg-base-300"></div>
24-
<div class="mb-1 w-full h-6 bg-base-300"></div>
25-
<div class="mb-3 w-full h-1 bg-base-300"></div>
26-
<div class="mb-3 w-20 h-6 bg-base-300"></div>
18+
<div
19+
hx-trigger="revealed"
20+
hx-get="{% url 'funds:submissions:partial-reviews-card' object.id %}"
21+
hx-target="this"
22+
>
23+
<div class="animate-pulse min-h-30">
24+
<div class="mb-3 w-full h-9 bg-base-300"></div>
25+
<div class="mb-1 w-full h-6 bg-base-300"></div>
26+
<div class="mb-3 w-full h-1 bg-base-300"></div>
27+
<div class="mb-3 w-20 h-6 bg-base-300"></div>
28+
</div>
2729
</div>
28-
</div>
2930

30-
<div class="wrapper wrapper--sidebar-buttons">
31-
{% include 'review/includes/review_button.html' with submission=object class="w-1/2" %}
31+
<div class="card-actions">
32+
{% include 'review/includes/review_button.html' with submission=object %}
33+
</div>
3234
</div>
3335
</div>
3436
{% endblock %}

hypha/apply/funds/templates/funds/includes/review_sidebar.html

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
1-
{% load i18n review_tags %}
1+
{% load i18n review_tags heroicons %}
22

3-
<div class="flex justify-around items-center px-2 bg-base-200">
4-
{% with recommendation|traffic_light as traffic_light_html %}
5-
{% if traffic_light_html %}
6-
<span class="py-1">
7-
{{ recommendation|traffic_light }}
8-
</span>
9-
{% endif %}
10-
{% endwith %}
3+
{% with recommendation|traffic_light as traffic_light_html %}
114
{% with assigned_reviewers|average_review_score as average %}
12-
{% if average %}
13-
<span class="py-1 font-medium">
14-
{{ average }}
15-
</span>
5+
{% if traffic_light_html or average %}
6+
<div class="flex justify-around items-center p-2 mb-2 bg-base-200">
7+
{% if traffic_light_html %}
8+
<span>{{ recommendation|traffic_light }}</span>
9+
{% endif %}
10+
{% if average %}
11+
<span class="font-medium">{{ average }}</span>
12+
{% endif %}
13+
</div>
1614
{% endif %}
1715
{% endwith %}
18-
</div>
16+
{% endwith %}
1917

20-
<ul class="mt-4 reviews-sidebar" id="id_reviewers" x-data='{showHiddenReviewers: false}'>
21-
{% if not staff_reviewers_exist %}
18+
{% if not staff_reviewers_exist %}
19+
<p class="p-2 mb-2 alert alert-info alert-soft">
20+
{% heroicon_outline "information-circle" aria_hidden="true" %}
2221
{% if request.user.is_org_faculty %}
23-
<li class="reviews-sidebar__no-reviews">{% trans "No staff reviewers yet" %}</li>
24-
<hr class="reviews-sidebar__split">
22+
{% trans "No staff reviewers yet" %}
2523
{% else %}
26-
<li class="reviews-sidebar__no-reviews">{% trans "No public reviews yet" %}</li>
27-
<hr class="reviews-sidebar__split">
24+
{% trans "No public reviews yet" %}
2825
{% endif %}
29-
{% endif %}
26+
</p>
27+
{% endif %}
28+
29+
<ul class="reviews-sidebar list" id="id_reviewers" x-data='{showHiddenReviewers: false}'>
3030

3131
{% regroup assigned_reviewers by type as reviewers_list %}
3232

3333
{% for reviewer_type, reviewers in reviewers_list %}
34-
{% if not forloop.first %}
35-
{% ifchanged reviewer_type %}
36-
<hr class="reviews-sidebar__split">
37-
{% endifchanged %}
38-
{% endif %}
39-
4034
{% for reviewer in reviewers %}
4135
{% if reviewer_type.name in hidden_types %}
4236
{% include 'funds/includes/review_sidebar_item.html' with reviewer=reviewer hidden=True %}
@@ -45,13 +39,14 @@
4539
<li>
4640
<a
4741
role="button"
48-
class="text-sm font-bold underline"
42+
class="mt-2 text-sm font-semibold link"
4943
@click.prevent="showHiddenReviewers = !showHiddenReviewers"
5044
href="#"
5145
>
5246
<span x-show="!showHiddenReviewers">{% trans "Show more..." %}</span>
5347
<span x-cloak x-show="showHiddenReviewers">{% trans "Show less..." %}</span>
54-
</a></li>
48+
</a>
49+
</li>
5550
{% endif %}
5651
{% else %}
5752
{% include 'funds/includes/review_sidebar_item.html' with reviewer=reviewer %}

hypha/apply/funds/templates/funds/includes/review_sidebar_item.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{% load i18n wagtailimages_tags heroicons %}
22

33
<li
4-
class="reviews-sidebar__item {% if not reviewer.review %}text-base-content/80 {% endif %}"
5-
{% if hidden and not reviewer.review %}x-cloak x-show="showHiddenReviewers" x-transition.opacity{% endif %}
4+
class="reviews-sidebar__item list-row {% if not reviewer.review %}text-base-content/80 {% endif %}"
5+
{% if hidden and not reviewer.review %}x-cloak x-show="showHiddenReviewers" x-transition.opacity{% endif %}
66
>
77
{% if not reviewer.review or reviewer.review.is_draft %}
88
<div class="reviews-sidebar__name">
@@ -13,7 +13,7 @@
1313
{{ reviewer }}
1414
{% endif %}
1515
</span>
16-
{% if reviewer.role %}{% image reviewer.role.icon max-12x12 %}{% endif %}
16+
{% if reviewer.role and reviewer.role.icon %}{% image reviewer.role.icon max-12x12 %}{% endif %}
1717
</div>
1818
<div>-</div>
1919
<div>-</div>
@@ -32,7 +32,9 @@
3232
{% if reviewer.role %}{% image reviewer.role.icon max-12x12 %}{% endif %}
3333
</div>
3434
</a>
35-
<div class="milli">{{ reviewer.review.created_at|date:"SHORT_DATE_FORMAT" }}</div>
35+
<relative-time datetime="{{ reviewer.review.created_at|date:'c' }}" class="text-xs">
36+
{{ reviewer.review.created_at|date:'SHORT_DATETIME_FORMAT' }}
37+
</relative-time>
3638
</div>
3739
{% else %}
3840
<div class="reviews-sidebar__name">

hypha/static_src/sass/components/_reviews-sidebar.scss

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
.reviews-sidebar {
55
$root: &;
6-
margin-block-end: 20px;
7-
font-weight: variables.$weight--bold;
86

97
&__decision {
108
position: relative;
@@ -16,16 +14,6 @@
1614
}
1715

1816
&__item {
19-
display: flex;
20-
justify-content: space-between;
21-
margin-block-end: 20px;
22-
23-
@supports (display: grid) {
24-
display: grid;
25-
grid-template-columns: 45% 25% 15% 15%;
26-
gap: 5px;
27-
}
28-
2917
&--decision {
3018
margin-block-end: 10px;
3119
font-weight: variables.$weight--semibold;
@@ -80,13 +68,6 @@
8068
position: relative;
8169
display: flex;
8270
align-items: center;
83-
overflow: hidden;
84-
text-overflow: ellipsis;
85-
86-
&:hover {
87-
display: inline-flex;
88-
overflow: visible;
89-
}
9071

9172
img {
9273
margin-inline-start: 7px;

0 commit comments

Comments
 (0)