diff --git a/ietf/idrfc/views_doc.py b/ietf/idrfc/views_doc.py index 9cd32580e..6e1ac2b59 100644 --- a/ietf/idrfc/views_doc.py +++ b/ietf/idrfc/views_doc.py @@ -569,36 +569,39 @@ def get_ballot(name): from ietf.doc.models import DocAlias alias = get_object_or_404(DocAlias, name=name) d = alias.document - id = get_object_or_404(InternetDraft, name=d.name) - try: - if not id.ballot.ballot_issued: + id = None + bw = None + dw = None + if (d.type_id=='draft'): + id = get_object_or_404(InternetDraft, name=d.name) + try: + if not id.ballot.ballot_issued: + raise Http404 + except BallotInfo.DoesNotExist: raise Http404 - except BallotInfo.DoesNotExist: - raise Http404 + + bw = BallotWrapper(id) # XXX Fixme: Eliminate this as we go forward + # Python caches ~100 regex'es -- explicitly compiling it inside a method + # (where you then throw away the compiled version!) doesn't make sense at + # all. + if re.search("^rfc([1-9][0-9]*)$", name): + id.viewing_as_rfc = True + dw = RfcWrapper(id) + else: + dw = IdWrapper(id) + # XXX Fixme: Eliminate 'dw' as we go forward try: b = d.latest_event(BallotDocEvent, type="created_ballot") except BallotDocEvent.DoesNotExist: raise Http404 - bw = BallotWrapper(id) # XXX Fixme: Eliminate this as we go forward - - # Python caches ~100 regex'es -- explicitly compiling it inside a method - # (where you then throw away the compiled version!) doesn't make sense at - # all. - if re.search("^rfc([1-9][0-9]*)$", name): - id.viewing_as_rfc = True - dw = RfcWrapper(id) - else: - dw = IdWrapper(id) - # XXX Fixme: Eliminate 'dw' as we go forward - - return (bw, dw, b, d) def ballot_html(request, name): bw, dw, ballot, doc = get_ballot(name) - return render_to_response('idrfc/doc_ballot.html', {'bw':bw, 'dw':dw, 'ballot':ballot, 'doc':doc}, context_instance=RequestContext(request)) + content = document_ballot_content(request, doc, ballot.pk, editable=True) + return HttpResponse(content) def ballot_tsv(request, name): ballot, doc, b, d = get_ballot(name) diff --git a/ietf/templates/idrfc/doc_ballot.html b/ietf/templates/idrfc/doc_ballot.html index 225afcd0c..fcc3bbe8b 100644 --- a/ietf/templates/idrfc/doc_ballot.html +++ b/ietf/templates/idrfc/doc_ballot.html @@ -33,15 +33,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -->{% endcomment %} {% load ietf_filters %}
-
{% if doc_ballot_edit_button and user|in_group:"Area_Director,Secretariat" %}
{% if user|in_group:"Area_Director" %}
{% endif %}
-{% if bw.was_deferred %}
+{% if doc.active_defer_event %}
- Ballot deferred by {{ bw.deferred_by }} on {{ bw.deferred_date }}.
+Ballot deferred by {{ doc.active_defer_event.by }} on {{ doc.active_defer_event.time|date:"Y-m-d" }}.
{% else %}
{% endif %}
diff --git a/static/js/base.js b/static/js/base.js
index 6749d912e..d92eb8344 100644
--- a/static/js/base.js
+++ b/static/js/base.js
@@ -46,8 +46,9 @@ function showBallot(draftName, editPositionUrl) {
document.getElementById("ietf-extras").appendChild(el);
var buttons = [{text:"Close", handler:handleClose, isDefault:true}];
- if (("Area_Director" in IETF.user_groups) ||
- ("Secretariat" in IETF.user_groups)) {
+// if (("Area_Director" in IETF.user_groups) ||
+// ("Secretariat" in IETF.user_groups)) {
+ if ("Area_Director" in IETF.user_groups) {
buttons.unshift({text:"Edit Position", handler:handleEditPosition});
}
var kl = [new YAHOO.util.KeyListener(document, {keys:27}, handleClose)]
|