* search_result_row.html no longer takes care of the ballot set rendering for you; you have to pass it the entire contents of the ballot set.

* Model and template changes to allow documents to report their name via doctype() to allow "Draft Name:" vs. "RFC Name:"
* Add parenthesis around the submission type to match the cgi
* Pass the whole ballot set to search_result_row from idinternal_detail
* Display only public comments in idinternal_detail
* Use comment.get_absolute_url instead of a relative URL.  (This fixes /idtracker/NNN/comment/YYY/ which wouldn't work)
* Add a search url to compare
* In view, when searching, don't filter for primary_flag=1, but do order by ballot and -primary_flag so that the results are grouped properly.
* Introduce public_comments() accessor which filters comments()
* Fix comments() to not use rfc_flag, to match the schema
* Order ballot_set() by -primary_flag so the results are grouped properly.
 - Legacy-Id: 312
This commit is contained in:
Bill Fenner 2007-06-11 16:53:25 +00:00
parent 8f81a7a7de
commit 178c5e13e0
5 changed files with 20 additions and 24 deletions

View file

@ -165,6 +165,8 @@ class InternetDraft(models.Model):
if self.status.status != 'Active' and not self.expired_tombstone: if self.status.status != 'Active' and not self.expired_tombstone:
r = max(r - 1, 0) r = max(r - 1, 0)
return "%02d" % r return "%02d" % r
def doctype(self):
return "Draft"
class Meta: class Meta:
db_table = "internet_drafts" db_table = "internet_drafts"
@ -331,6 +333,8 @@ class Rfc(models.Model):
return "RFC" return "RFC"
def doclink(self): def doclink(self):
return "http://www.ietf.org/rfc/%s" % ( self.displayname() ) return "http://www.ietf.org/rfc/%s" % ( self.displayname() )
def doctype(self):
return "RFC"
class Meta: class Meta:
db_table = 'rfcs' db_table = 'rfcs'
verbose_name = 'RFC' verbose_name = 'RFC'
@ -454,14 +458,14 @@ class IDInternal(models.Model):
return self._cached_rfc return self._cached_rfc
else: else:
return self.draft return self.draft
def public_comments(self):
return self.comments().filter(public_flag=1)
def comments(self): def comments(self):
if self.rfc_flag == 0: # would filter by rfc_flag but the database is broken. (see
filter = models.Q(rfc_flag=0)|models.Q(rfc_flag__isnull=True) # trac ticket #96) so this risks collisions.
else: return self.documentcomment_set.all().order_by('-comment_date','-comment_time','-id')
filter = models.Q(rfc_flag=1)
return self.documentcomment_set.all().filter(filter).order_by('-comment_date','-comment_time')
def ballot_set(self): def ballot_set(self):
return IDInternal.objects.filter(ballot=self.ballot_id) return IDInternal.objects.filter(ballot=self.ballot_id).order_by('-primary_flag')
def ballot_primary(self): def ballot_primary(self):
return IDInternal.objects.filter(ballot=self.ballot_id,primary_flag=1) return IDInternal.objects.filter(ballot=self.ballot_id,primary_flag=1)
def ballot_others(self): def ballot_others(self):

View file

@ -14,3 +14,4 @@
200 /idtracker/ballot/1760/ https://datatracker.ietf.org/public/pidtracker.cgi?command=print_ballot&ballot_id=1760&filename=draft-ietf-isis-link-attr 200 /idtracker/ballot/1760/ https://datatracker.ietf.org/public/pidtracker.cgi?command=print_ballot&ballot_id=1760&filename=draft-ietf-isis-link-attr
200 /idtracker/ https://datatracker.ietf.org/public/pidtracker.cgi 200 /idtracker/ https://datatracker.ietf.org/public/pidtracker.cgi
200 /feeds/comments/draft-ietf-isis-link-attr/ 200 /feeds/comments/draft-ietf-isis-link-attr/
200 /idtracker/?search_filename=bgp-m https://datatracker.ietf.org/public/pidtracker.cgi?command=search_list&search_job_owner=0&search_group_acronym=&search_status_id=&search_cur_state=&sub_state_id=6&search_filename=bgp-m&search_rfcnumber=&search_area_acronym=&search_button=SEARCH

View file

@ -60,8 +60,8 @@ def search(request):
status = args.get('search_status_id', '') status = args.get('search_status_id', '')
if status != '': if status != '':
q_objs.append(Q(draft__status=status,rfc_flag=0)) q_objs.append(Q(draft__status=status,rfc_flag=0))
matches = IDInternal.objects.all().filter(*q_objs).filter(primary_flag=1) matches = IDInternal.objects.all().filter(*q_objs)
matches = matches.order_by('cur_state', 'cur_sub_state_id') matches = matches.order_by('cur_state', 'cur_sub_state', 'ballot')
else: else:
matches = None matches = None

View file

@ -23,7 +23,7 @@
<tr bgcolor="white"> <tr bgcolor="white">
<td> <td>
<div class="largefont3"> <div class="largefont3">
Draft Name: {{ object.document.doctype }} Name:
</div> </div>
</td> </td>
@ -33,12 +33,12 @@
{{ object.document.displayname }}</a> {{ object.document.displayname }}</a>
<font color="red"> <font color="red">
{% if object.via_rfc_editor %} {% if object.via_rfc_editor %}
Independent submission via RFC Editor (Independent submission via RFC Editor)
{% else %} {% else %}
{% ifequal object.document.group_acronym "none" %} {% ifequal object.document.group_acronym "none" %}
Individual submission (Individual submission)
{% else %} {% else %}
WG &lt;{{ object.document.group_acronym }}&gt; submission (WG &lt;{{ object.document.group_acronym }}&gt; submission)
{% endifequal %} {% endifequal %}
{% endif %} {% endif %}
</font> </font>
@ -207,11 +207,7 @@
<a name="action"></a> <a name="action"></a>
<table border="1" bgcolor="black"> <table border="1" bgcolor="black">
<tr><td><font color="white"><h3>Actions</h3></font> <tr><td><font color="white"><h3>Actions</h3></font>
{% comment %} {% regroup object.ballot_set by docstate as grouped %}
# this "regroup" is to get the data structure into the shape
# that search_result_table wants - it doesn't do anything real.
{% endcomment %}
{% regroup object.ballot_primary by docstate as grouped %}
{% include "idtracker/search_result_table.html" %} {% include "idtracker/search_result_table.html" %}
</td> </td>
</tr> </tr>
@ -229,7 +225,7 @@
<th>Comment</th> <th>Comment</th>
</tr> </tr>
{% for comment in object.comments %} {% for comment in object.public_comments %}
<tr bgcolor="{% cycle #CFE1CC,#7DC189 %}"> <tr bgcolor="{% cycle #CFE1CC,#7DC189 %}">
<td>{{ comment.date }}</td> <td>{{ comment.date }}</td>
@ -245,7 +241,7 @@
but that actually changes the visible spacing in most but that actually changes the visible spacing in most
browsers, so we let layout concerns make us write browsers, so we let layout concerns make us write
invalid HTML. --> invalid HTML. -->
<form action="comment/{{ comment.id }}" method="GET"> <form action="{{ comment.get_absolute_url }}" method="GET">
<td> <td>
<input type="submit" value="View Detail"> <input type="submit" value="View Detail">
</td> </td>

View file

@ -4,11 +4,6 @@
<tr bgcolor="#A3A3A3"><th>&nbsp;</th><th width="250">Name (Intended Status)</th><th>Ver</th><th>Responsible AD</th><th>Status Date</th><th>Modified</th></tr> <tr bgcolor="#A3A3A3"><th>&nbsp;</th><th width="250">Name (Intended Status)</th><th>Ver</th><th>Responsible AD</th><th>Status Date</th><th>Modified</th></tr>
{% for match in group.list %} {% for match in group.list %}
{% include "idtracker/search_result_row.html" %} {% include "idtracker/search_result_row.html" %}
{% if match.primary_flag %}
{% for match in match.ballot_others %}
{% include "idtracker/search_result_row.html" %}
{% endfor %}
{% endif %}
{% endfor %} {% endfor %}
</table> </table>
{% endfor %} {% endfor %}