Skip to content

Commit

Permalink
fix: Color the background of table rows for an AD based on their ball…
Browse files Browse the repository at this point in the history
…ot (ietf-tools#3867)

Instead of just adding a colored bar on the right-hand side.
  • Loading branch information
larseggert authored Apr 22, 2022
1 parent f4b0b45 commit cd9a2ee
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
23 changes: 23 additions & 0 deletions ietf/static/css/ietf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,29 @@ td.position-empty {
border: none !important;
}

tr.position-moretime-row,
tr.position-notready-row,
tr.position-discuss-row,
tr.position-block-row {
background-color: tint-color($color-discuss, 90%);
}

tr.position-yes-row {
background-color: tint-color($color-yes, 90%);
}

tr.position-noobj-row {
background-color: tint-color($color-noobj, 90%);
}

tr.position-abstain-row {
background-color: tint-color($color-abstain, 90%);
}

tr.position-recuse-row {
background-color: tint-color($color-recuse, 90%);
}


/* === Edit Meeting Schedule ====================================== */

Expand Down
11 changes: 1 addition & 10 deletions ietf/templates/doc/search/search_result_row.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
{% load ballot_icon %}
{% load person_filters %}
{% load django_bootstrap5 %}
<tr{% spaceless %}
{% if color_ad_position %} {% with doc|ballotposition:user as pos %} {% if pos %}class="position-{{ pos.slug }}-row"{% endif %}
{% endwith %}
{% endif %}
{% endspaceless %}>
<tr {% if color_ad_position %}{% with doc|ballotposition:user as pos %}{% if pos %}class="position-{{ pos.slug }}-row"{% endif %}{% endwith %}{% endif %}>
<td>
{% if user.is_authenticated %}
<a href="{% url "ietf.community.views.untrack_document" username=request.user.username name=doc.name %}"
Expand Down Expand Up @@ -155,9 +151,4 @@
{% endif %}
</td>
{% endif %}
{% if color_ad_position %}
{% with doc|ballotposition:user as pos %}
<td {% if pos %}class="changebar position-{{ pos.slug }}"{% endif %}></td>
{% endwith %}
{% endif %}
</tr>
6 changes: 1 addition & 5 deletions ietf/templates/doc/search/search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@
<tbody>
<tr class="table-info">
<td></td>
{% if color_ad_position %}
<th scope="col" colspan="{{ meta.headers|length }}">
{% else %}
<th scope="col" colspan="{{ meta.headers|length|add:"-1" }}">
{% endif %}
<th scope="col" colspan="{{ meta.headers|length|add:"-1" }}">
{{ doc_group.grouper|plural:doc_group.list }} ({{ doc_group.list|length }} {{"hit"|plural:doc_group.list }})
</th>
</tr>
Expand Down
3 changes: 1 addition & 2 deletions ietf/templates/iesg/agenda_documents.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ <h2>
<th scope="col" data-sort="status">Status</th>
<th scope="col" class="d-none d-sm-table-cell" data-sort="ipr">IPR</th>
<th scope="col" class="d-none d-sm-table-cell" data-sort="ad">AD/Shepherd</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
Expand All @@ -71,4 +70,4 @@ <h2>
{% endblock %}
{% block js %}
<script src="{% static "ietf/js/list.js" %}"></script>
{% endblock %}
{% endblock %}

0 comments on commit cd9a2ee

Please sign in to comment.