datatracker/ietf/templates/idtracker/search_result_row.html
Bill Fenner 2bf510f43b Add "myifchanged" tag, which is different from the standard ifchanged
in two ways:
 * It permits an "else" clause.  This code is from http://code.djangoproject.com/ticket/4534
 * It doesn't push the context while rendering, so context changes can be performed (like the change that cycle makes: putting the current value into the context)

Use this new tag to cycle the row color if the ballot_id has changed, or
if it's a synthetic document.
 - Legacy-Id: 380
2007-06-13 18:43:56 +00:00

38 lines
1.8 KiB
HTML

{% load myifchanged %}
<tr bgcolor="#{% myifchanged match.ballot_id %}{% cycle F8D6F8,E2AFE2 as ballotcolor %}{% else %}{% if match.synthetic %}{% cycle ballotcolor %}{% else %}{{ ballotcolor }}{% endif %}{% endmyifchanged %}">
{% if match.synthetic %}
<td>&nbsp;</td>
{% else %}
<!-- this form element technically belongs inside the <td>
but that actually changes the visible spacing in most
browsers, so we let layout concerns make us write
invalid HTML. -->
<form method="GET" action="{% url ietf.idtracker.views.view_id match.document.filename %}"><td><input type="submit" value="DETAIL"></td></form>
{% endif %}
<td>{% if match.primary_flag %}<li>{% else %}<dd>{% endif %}{{ match.document.filename_with_link }} ({{ match.document.intended_status }})
{% ifequal match.document.status.status "Replaced" %}
<br>&nbsp;&nbsp;&nbsp;&nbsp;Replaced by
{% if match.document.replaced_by.idinternal %}
<a href="{% url ietf.idtracker.views.search %}?search_filename={{ match.document.replaced_by.filename }}">
{% endif %}
{{ match.document.replaced_by.filename }}
{% if match.document.replaced_by.idinternal %}
</a>
{% endif %}
{% endifequal %}
{% if match.document.replaces_set.count %}
<br>&nbsp;&nbsp;&nbsp;&nbsp;Replaces
{% for replaces in match.document.replaces_set.all %}
{% if replaces.idinternal %}
<a href="{% url ietf.idtracker.views.search %}?search_filename={{ replaces.filename }}">
{% endif %}
{{ replaces.filename }}{% if replaces.idinternal %}</a>{% endif %}{% if not forloop.last %},{% endif %}
{% endfor %}
{% endif %}
</td>
<td>{{ match.document.revision }}</td>
<td>{{ match.job_owner }}</td>
<td>{% firstof match.status_date "" %}</td>
<td>{{ match.event_date }}</td>
</tr>