* 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:
parent
8f81a7a7de
commit
178c5e13e0
|
@ -165,6 +165,8 @@ class InternetDraft(models.Model):
|
|||
if self.status.status != 'Active' and not self.expired_tombstone:
|
||||
r = max(r - 1, 0)
|
||||
return "%02d" % r
|
||||
def doctype(self):
|
||||
return "Draft"
|
||||
|
||||
class Meta:
|
||||
db_table = "internet_drafts"
|
||||
|
@ -331,6 +333,8 @@ class Rfc(models.Model):
|
|||
return "RFC"
|
||||
def doclink(self):
|
||||
return "http://www.ietf.org/rfc/%s" % ( self.displayname() )
|
||||
def doctype(self):
|
||||
return "RFC"
|
||||
class Meta:
|
||||
db_table = 'rfcs'
|
||||
verbose_name = 'RFC'
|
||||
|
@ -454,14 +458,14 @@ class IDInternal(models.Model):
|
|||
return self._cached_rfc
|
||||
else:
|
||||
return self.draft
|
||||
def public_comments(self):
|
||||
return self.comments().filter(public_flag=1)
|
||||
def comments(self):
|
||||
if self.rfc_flag == 0:
|
||||
filter = models.Q(rfc_flag=0)|models.Q(rfc_flag__isnull=True)
|
||||
else:
|
||||
filter = models.Q(rfc_flag=1)
|
||||
return self.documentcomment_set.all().filter(filter).order_by('-comment_date','-comment_time')
|
||||
# would filter by rfc_flag but the database is broken. (see
|
||||
# trac ticket #96) so this risks collisions.
|
||||
return self.documentcomment_set.all().order_by('-comment_date','-comment_time','-id')
|
||||
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):
|
||||
return IDInternal.objects.filter(ballot=self.ballot_id,primary_flag=1)
|
||||
def ballot_others(self):
|
||||
|
|
|
@ -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/ https://datatracker.ietf.org/public/pidtracker.cgi
|
||||
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
|
||||
|
|
|
@ -60,8 +60,8 @@ def search(request):
|
|||
status = args.get('search_status_id', '')
|
||||
if status != '':
|
||||
q_objs.append(Q(draft__status=status,rfc_flag=0))
|
||||
matches = IDInternal.objects.all().filter(*q_objs).filter(primary_flag=1)
|
||||
matches = matches.order_by('cur_state', 'cur_sub_state_id')
|
||||
matches = IDInternal.objects.all().filter(*q_objs)
|
||||
matches = matches.order_by('cur_state', 'cur_sub_state', 'ballot')
|
||||
else:
|
||||
matches = None
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<tr bgcolor="white">
|
||||
<td>
|
||||
<div class="largefont3">
|
||||
Draft Name:
|
||||
{{ object.document.doctype }} Name:
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
@ -33,12 +33,12 @@
|
|||
{{ object.document.displayname }}</a>
|
||||
<font color="red">
|
||||
{% if object.via_rfc_editor %}
|
||||
Independent submission via RFC Editor
|
||||
(Independent submission via RFC Editor)
|
||||
{% else %}
|
||||
{% ifequal object.document.group_acronym "none" %}
|
||||
Individual submission
|
||||
(Individual submission)
|
||||
{% else %}
|
||||
WG <{{ object.document.group_acronym }}> submission
|
||||
(WG <{{ object.document.group_acronym }}> submission)
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
</font>
|
||||
|
@ -207,11 +207,7 @@
|
|||
<a name="action"></a>
|
||||
<table border="1" bgcolor="black">
|
||||
<tr><td><font color="white"><h3>Actions</h3></font>
|
||||
{% comment %}
|
||||
# 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 %}
|
||||
{% regroup object.ballot_set by docstate as grouped %}
|
||||
{% include "idtracker/search_result_table.html" %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -229,7 +225,7 @@
|
|||
<th>Comment</th>
|
||||
</tr>
|
||||
|
||||
{% for comment in object.comments %}
|
||||
{% for comment in object.public_comments %}
|
||||
<tr bgcolor="{% cycle #CFE1CC,#7DC189 %}">
|
||||
<td>{{ comment.date }}</td>
|
||||
|
||||
|
@ -245,7 +241,7 @@
|
|||
but that actually changes the visible spacing in most
|
||||
browsers, so we let layout concerns make us write
|
||||
invalid HTML. -->
|
||||
<form action="comment/{{ comment.id }}" method="GET">
|
||||
<form action="{{ comment.get_absolute_url }}" method="GET">
|
||||
<td>
|
||||
<input type="submit" value="View Detail">
|
||||
</td>
|
||||
|
|
|
@ -4,11 +4,6 @@
|
|||
<tr bgcolor="#A3A3A3"><th> </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 %}
|
||||
{% 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 %}
|
||||
</table>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in a new issue