Skip to content

Commit a8e9044

Browse files
authored
fix: Color agenda table row based on AD position (ietf-tools#6192)
Fixes ietf-tools#6184
1 parent aa955f0 commit a8e9044

3 files changed

Lines changed: 116 additions & 68 deletions

File tree

ietf/static/css/ietf.scss

Lines changed: 67 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,28 @@ $popover-max-width: 100%;
1212

1313
// Override default fonts
1414

15-
$font-family-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
16-
$font-family-monospace: "Noto Sans Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
15+
$font-family-sans-serif: "Inter",
16+
system-ui,
17+
-apple-system,
18+
"Segoe UI",
19+
Roboto,
20+
"Helvetica Neue",
21+
"Noto Sans",
22+
"Liberation Sans",
23+
Arial,
24+
sans-serif,
25+
"Apple Color Emoji",
26+
"Segoe UI Emoji",
27+
"Segoe UI Symbol",
28+
"Noto Color Emoji";
29+
$font-family-monospace: "Noto Sans Mono",
30+
SFMono-Regular,
31+
Menlo,
32+
Monaco,
33+
Consolas,
34+
"Liberation Mono",
35+
"Courier New",
36+
monospace;
1737

1838
// Enable color modes
1939
$color-mode-type: data;
@@ -506,29 +526,57 @@ td.position-empty {
506526
border: none !important;
507527
}
508528

509-
tr.position-moretime-row,
510-
tr.position-notready-row,
511-
tr.position-discuss-row,
512-
tr.position-block-row {
513-
background-color: tint-color($color-discuss, 85%);
514-
}
529+
[data-bs-theme="light"] {
515530

516-
tr.position-yes-row {
517-
background-color: tint-color($color-yes, 75%);
518-
}
531+
tr.position-moretime-row,
532+
tr.position-notready-row,
533+
tr.position-discuss-row,
534+
tr.position-block-row {
535+
background-color: tint-color($color-discuss, 85%);
536+
}
519537

520-
tr.position-noobj-row {
521-
background-color: tint-color($color-noobj, 50%);
522-
}
538+
tr.position-yes-row {
539+
background-color: tint-color($color-yes, 75%);
540+
}
523541

524-
tr.position-abstain-row {
525-
background-color: tint-color($color-abstain, 85%);
526-
}
542+
tr.position-noobj-row {
543+
background-color: tint-color($color-noobj, 50%);
544+
}
545+
546+
tr.position-abstain-row {
547+
background-color: tint-color($color-abstain, 85%);
548+
}
527549

528-
tr.position-recuse-row {
529-
background-color: tint-color($color-recuse, 85%);
550+
tr.position-recuse-row {
551+
background-color: tint-color($color-recuse, 85%);
552+
}
530553
}
531554

555+
[data-bs-theme="dark"] {
556+
557+
tr.position-moretime-row,
558+
tr.position-notready-row,
559+
tr.position-discuss-row,
560+
tr.position-block-row {
561+
background-color: shade-color($color-discuss, 85%);
562+
}
563+
564+
tr.position-yes-row {
565+
background-color: shade-color($color-yes, 75%);
566+
}
567+
568+
tr.position-noobj-row {
569+
background-color: shade-color($color-noobj, 75%);
570+
}
571+
572+
tr.position-abstain-row {
573+
background-color: shade-color($color-abstain, 85%);
574+
}
575+
576+
tr.position-recuse-row {
577+
background-color: shade-color($color-recuse, 85%);
578+
}
579+
}
532580

533581
/* === Edit Meeting Schedule ====================================== */
534582

ietf/templates/doc/search/search_result_row.html

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{% load person_filters %}
88
{% load django_bootstrap5 %}
99
<tr {% if color_ad_position %}{% with doc|ballotposition:user as pos %}{% if pos %}class="position-{{ pos.slug }}-row"{% endif %}{% endwith %}{% endif %}>
10-
<td>
10+
<td class="bg-transparent">
1111
{% if user.is_authenticated %}
1212
<a href="{% url "ietf.community.views.untrack_document" username=request.user.username name=doc.name %}"
1313
class="track-untrack-doc {% if not doc.tracked_in_personal_community_list %}d-none{% endif %}"
@@ -45,7 +45,7 @@
4545
</a>
4646
{% endfor %}
4747
</td>
48-
<td class="doc">
48+
<td class="doc bg-transparent">
4949
{% if doc.pages %}<small class="float-end text-body-secondary d-none d-sm-block">{{ doc.pages }} page{{ doc.pages|pluralize }}</small>{% endif %}
5050
<div>
5151
<a href="{{ doc.get_absolute_url }}">
@@ -105,50 +105,50 @@
105105
</div>
106106
{% endif %}
107107
</td>
108-
<td>
109-
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
110-
{% if doc.rev != "00" %}
111-
<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">
112-
{% elif doc.replaces %}
113-
<a href="{{ rfcdiff_base_url }}?url1={{ doc.replaces_canonical_name }}&amp;url2={{ doc.name }}-{{ doc.rev }}">
114-
{% endif %}
115-
{% endif %}
116-
{% if doc.get_state_slug == "rfc" %}
117-
{{ doc.latest_revision_date|date:"Y-m" }}
118-
{% else %}
119-
{{ doc.latest_revision_date|date:"Y-m-d" }}
120-
{% endif %}
121-
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
122-
{% if doc.rev != "00" or doc.replaces %}</a>{% endif %}
123-
{% endif %}
124-
{% if doc.latest_revision_date|timesince_days|new_enough:request %}
125-
<br>
126-
<div class="float-end">
127-
<span class="badge rounded-pill text-bg-success">New</span>
128-
</div>
129-
{% endif %}
130-
{% if doc.get_state_slug == "active" and doc.expirable and doc.expires|timesince_days|expires_soon:request %}
131-
<br>
132-
<span class="badge rounded-pill text-bg-warning">Expires soon</span>
133-
{% endif %}
134-
</td>
135-
{% include "doc/search/status_columns.html" %}
136-
<td class="text-center d-none d-sm-table-cell">
137-
{% if doc.related_ipr %}
138-
<a href="{% url "ietf.ipr.views.search" %}?submit=draft&amp;id={{ doc.name }}">
139-
<span class="badge rounded-pill text-bg-info">{{ doc.related_ipr|length }}</span>
140-
</a>
141-
{% endif %}
142-
</td>
143-
{% if ad_name == None or ad_name != doc.ad.plain_name %}
144-
<td class="d-none d-sm-table-cell">
145-
{% if doc.ad %}
146-
{% person_link doc.ad title="Area Director" %}
147-
{% endif %}
148-
<br>
149-
{% if doc.shepherd %}
150-
{% email_person_link doc.shepherd title="Shepherd" class="small text-body-secondary" %}
151-
{% endif %}
152-
</td>
108+
<td class="bg-transparent">
109+
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
110+
{% if doc.rev != "00" %}
111+
<a href="{{ rfcdiff_base_url }}?url2={{ doc.name }}-{{ doc.rev }}">
112+
{% elif doc.replaces %}
113+
<a href="{{ rfcdiff_base_url }}?url1={{ doc.replaces_canonical_name }}&amp;url2={{ doc.name }}-{{ doc.rev }}">
114+
{% endif %}
115+
{% endif %}
116+
{% if doc.get_state_slug == "rfc" %}
117+
{{ doc.latest_revision_date|date:"Y-m" }}
118+
{% else %}
119+
{{ doc.latest_revision_date|date:"Y-m-d" }}
120+
{% endif %}
121+
{% if doc.latest_revision_date|timesince_days|new_enough:request and doc.get_state_slug != "rfc" %}
122+
{% if doc.rev != "00" or doc.replaces %}</a>{% endif %}
123+
{% endif %}
124+
{% if doc.latest_revision_date|timesince_days|new_enough:request %}
125+
<br>
126+
<div class="float-end">
127+
<span class="badge rounded-pill text-bg-success">New</span>
128+
</div>
129+
{% endif %}
130+
{% if doc.get_state_slug == "active" and doc.expirable and doc.expires|timesince_days|expires_soon:request %}
131+
<br>
132+
<span class="badge rounded-pill text-bg-warning">Expires soon</span>
133+
{% endif %}
134+
</td>
135+
{% include "doc/search/status_columns.html" %}
136+
<td class="text-center d-none d-sm-table-cell bg-transparent">
137+
{% if doc.related_ipr %}
138+
<a href="{% url "ietf.ipr.views.search" %}?submit=draft&amp;id={{ doc.name }}">
139+
<span class="badge rounded-pill text-bg-info">{{ doc.related_ipr|length }}</span>
140+
</a>
141+
{% endif %}
142+
</td>
143+
{% if ad_name == None or ad_name != doc.ad.plain_name %}
144+
<td class="d-none d-sm-table-cell bg-transparent">
145+
{% if doc.ad %}
146+
{% person_link doc.ad title="Area Director" %}
147+
{% endif %}
148+
<br>
149+
{% if doc.shepherd %}
150+
{% email_person_link doc.shepherd title="Shepherd" class="small text-body-secondary" %}
153151
{% endif %}
154-
</tr>
152+
</td>
153+
{% endif %}
154+
</tr>

ietf/templates/doc/search/status_columns.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% load origin %}
33
{% origin %}
44
{% load ietf_filters ballot_icon person_filters %}
5-
<td class="status">
5+
<td class="status bg-transparent">
66
<div class="float-end ms-1 mb-1" id="ballot-icon-{{ doc.name }}">{% ballot_icon doc %}</div>
77
{% if not doc.get_state_slug == "rfc" %}
88
{% if '::' in doc.friendly_state %}

0 commit comments

Comments
 (0)