Skip to content

Commit 328ecb0

Browse files
committed
Replace old charter branches with new branch based on conversion branch and some preliminary work on generalizing document handling
[[Split portion of a mixed commit.]] - Legacy-Id: 3883.1
1 parent f999045 commit 328ecb0

24 files changed

Lines changed: 291 additions & 174 deletions

ietf/doc/proxy.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def id_document_key(self):
3636
#group = models.ForeignKey(Acronym, db_column='group_acronym_id')
3737
@property
3838
def group(self):
39-
from group.proxy import Acronym as AcronymProxy
39+
from ietf.group.proxy import Acronym as AcronymProxy
4040
g = super(InternetDraft, self).group
4141
return AcronymProxy().from_object(g) if g else None
4242
#filename = models.CharField(max_length=255, unique=True)
@@ -365,13 +365,13 @@ def prev_state(self):
365365
@property
366366
def mark_by(self):
367367
e = self.latest_event()
368-
from person.proxy import IESGLogin as IESGLoginProxy
368+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
369369
return IESGLoginProxy().from_object(e.by) if e else None
370370

371371
# job_owner = models.ForeignKey(IESGLogin, db_column='job_owner', related_name='documents')
372372
@property
373373
def job_owner(self):
374-
from person.proxy import IESGLogin as IESGLoginProxy
374+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
375375
return IESGLoginProxy().from_object(self.ad) if self.ad else None
376376

377377
#event_date = models.DateField(null=True)
@@ -383,7 +383,7 @@ def event_date(self):
383383
#area_acronym = models.ForeignKey(Area)
384384
@property
385385
def area_acronym(self):
386-
from group.proxy import Area
386+
from ietf.group.proxy import Area
387387
g = super(InternetDraft, self).group # be careful with group which is proxied
388388
if g and g.type_id != "individ":
389389
return Area().from_object(g.parent)
@@ -462,7 +462,7 @@ def noproblem(self):
462462
@property
463463
def resurrect_requested_by(self):
464464
e = self.latest_event(type__in=("requested_resurrect", "completed_resurrect"))
465-
from person.proxy import IESGLogin as IESGLoginProxy
465+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
466466
return IESGLoginProxy().from_object(e.by) if e and e.type == "requested_resurrect" else None
467467

468468
#approved_in_minute = models.IntegerField(null=True, blank=True)
@@ -522,7 +522,7 @@ def an_sent_date(self):
522522
@property
523523
def an_sent_by(self):
524524
e = self.latest_event(type="iesg_approved")
525-
from person.proxy import IESGLogin as IESGLoginProxy
525+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
526526
return IESGLoginProxy().from_object(e.by) if e else None
527527

528528
#defer = models.BooleanField()
@@ -535,7 +535,7 @@ def defer(self):
535535
@property
536536
def defer_by(self):
537537
e = self.latest_event(type="changed_document", desc__startswith="State changed to <b>IESG Evaluation - Defer</b>")
538-
from person.proxy import IESGLogin as IESGLoginProxy
538+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
539539
return IESGLoginProxy().from_object(e.by) if e else None
540540

541541
#defer_date = models.DateField(null=True, blank=True)
@@ -572,7 +572,7 @@ def ballot_issued(self):
572572
# return remarks
573573
def active_positions(self):
574574
"""Returns a list of dicts, with AD and Position tuples"""
575-
from person.proxy import IESGLogin as IESGLoginProxy
575+
from ietf.person.proxy import IESGLogin as IESGLoginProxy
576576
from ietf.doc.utils import active_ballot_positions
577577

578578
res = []
@@ -892,7 +892,7 @@ def filename(self):
892892

893893
@property
894894
def ipr(self):
895-
from ipr.models import IprDraftProxy
895+
from ietf.ipr.models import IprDraftProxy
896896
return IprDraftProxy.objects.filter(doc_alias=self.pk)
897897

898898
class Meta:

ietf/group/proxy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def status_id(self):
138138
#meeting_scheduled = models.CharField(blank=True, max_length=3)
139139
@property
140140
def meeting_scheduled(self):
141-
from meeting.models import Meeting
141+
from ietf.meeting.models import Meeting
142142
latest_meeting = Meeting.objects.order_by('-date')[0]
143143
return "YES" if self.session_set.filter(meeting=latest_meeting) else "NO"
144144
#email_address = models.CharField(blank=True, max_length=60)

ietf/idrfc/generate_fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# script
1515
from django.core.serializers import serialize
1616
from django.db.models import Q
17-
from idtracker.models import *
18-
from iesg.models import *
17+
from ietf.idtracker.models import *
18+
from ietf.iesg.models import *
1919

2020
def output(name, qs):
2121
try:

ietf/idrfc/urls.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@
4040
(r'^active/$', views_search.active),
4141
(r'^in-last-call/$', views_search.in_last_call),
4242
url(r'^ad/(?P<name>[A-Za-z0-9.-]+)/$', views_search.by_ad, name="doc_search_by_ad"),
43-
44-
url(r'^(?P<name>[A-Za-z0-9.-]+)/((?P<tab>ballot|writeup|history)/)?$', views_doc.document_main, name="doc_view"),
43+
44+
url(r'^(?P<name>[A-Za-z0-9.-]+)/$', views_doc.document_main, name="doc_view"),
45+
url(r'^(?P<name>[A-Za-z0-9.-]+)/history/$', views_doc.document_history),
46+
url(r'^(?P<name>[A-Za-z0-9.-]+)/writeup/$', views_doc.document_writeup),
47+
url(r'^(?P<name>[A-Za-z0-9.-]+)/ballot/$', views_doc.document_ballot),
4548
(r'^(?P<name>[A-Za-z0-9.-]+)/doc.json$', views_doc.document_debug),
46-
(r'^(?P<name>[A-Za-z0-9.-]+)/_ballot.data$', views_doc.document_ballot),
49+
(r'^(?P<name>[A-Za-z0-9.-]+)/_ballot.data$', views_doc.ballot_html), # why is this url so weird instead of just ballot.html?
4750
(r'^(?P<name>[A-Za-z0-9.-]+)/ballot.tsv$', views_doc.ballot_tsv),
4851
(r'^(?P<name>[A-Za-z0-9.-]+)/ballot.json$', views_doc.ballot_json),
4952

ietf/idrfc/views_doc.py

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,52 @@
5151
from ietf.idrfc.idrfc_wrapper import BallotWrapper, IdWrapper, RfcWrapper
5252
from ietf.ietfworkflows.utils import get_full_info_for_draft
5353

54+
def render_document_top(request, doc, tab):
55+
tabs = []
56+
tabs.append(("Document", "document", urlreverse("idrfc.views_doc.document_main", kwargs=dict(name=doc.name))))
57+
58+
if doc_type == "draft":
59+
tabs.append(("IESG Evaluation Record", "ballot", urlreverse("idrfc.views_doc.document_ballot", kwargs=dict(name=doc.name))))
60+
elif doc_type == "charter":
61+
tabs.append(("IESG Review", "ballot", urlreverse("idrfc.views_doc.document_ballot", kwargs=dict(name=doc.name))))
62+
63+
tabs.append(("IESG Writeups", "writeup", urlreverse("idrfc.views_doc.document_writeup", kwargs=dict(name=doc.name))))
64+
tabs.append(("History", "history", urlreverse("idrfc.views_doc.document_history", kwargs=dict(name=doc.name))))
65+
66+
return render_to_string("idrfc/document_top.html",
67+
dict(doc=doc,
68+
tabs=tabs,
69+
selected=tab))
70+
71+
72+
def document_main(request, name):
73+
if name.startswith("ietf-charter-"):
74+
# FIXME: render top
75+
# render content
76+
# refactor history similarly? or use directly
77+
# refactor writeup, generalize on names and links to edit
78+
# refactor ballot to have multiple ballot typesiet
79+
80+
return render_to_response("idrfc/doc_tab_document.html",
81+
{'content1':content1,
82+
'content2':content2,
83+
'doc': doc,
84+
'tab': "document",
85+
'include_text':include_text(request)},
86+
context_instance=RequestContext(request));
87+
88+
89+
return document_main_idrfc(request, name, "document")
90+
91+
def document_history(request, name):
92+
return document_main_idrfc(request, name, "history")
93+
94+
def document_writeup(request, name):
95+
return document_main_idrfc(request, name, "writeup")
96+
97+
def document_ballot(request, name):
98+
return document_main_idrfc(request, name, "ballot")
99+
54100
def document_debug(request, name):
55101
r = re.compile("^rfc([1-9][0-9]*)$")
56102
m = r.match(name)
@@ -114,9 +160,7 @@ def document_main_rfc(request, rfc_number, tab):
114160
context_instance=RequestContext(request));
115161

116162
@decorator_from_middleware(GZipMiddleware)
117-
def document_main(request, name, tab):
118-
if tab is None:
119-
tab = "document"
163+
def document_main_idrfc(request, name, tab):
120164
r = re.compile("^rfc([1-9][0-9]*)$")
121165
m = r.match(name)
122166
if m:
@@ -288,7 +332,7 @@ def get_ballot(name):
288332
ballot = BallotWrapper(id)
289333
return ballot, doc
290334

291-
def document_ballot(request, name):
335+
def ballot_html(request, name):
292336
ballot, doc = get_ballot(name)
293337
return render_to_response('idrfc/doc_ballot.html', {'ballot':ballot, 'doc':doc}, context_instance=RequestContext(request))
294338

@@ -301,3 +345,4 @@ def ballot_json(request, name):
301345
response = HttpResponse(mimetype='text/plain')
302346
response.write(json.dumps(ballot.dict(), indent=2))
303347
return response
348+

ietf/iesg/views.py

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434

3535
import codecs, re, os, glob
36+
import datetime
37+
import tarfile
38+
3639
from ietf.idtracker.models import IDInternal, InternetDraft,AreaGroup, Position, IESGLogin, Acronym
3740
from django.views.generic.list_detail import object_list
3841
from django.views.generic.simple import direct_to_template
@@ -50,8 +53,8 @@
5053
from ietf.ietfauth.decorators import group_required
5154
from ietf.idtracker.templatetags.ietf_filters import in_group
5255
from ietf.ipr.models import IprRfc, IprDraft, IprDetail
53-
import datetime
54-
import tarfile
56+
from redesign.doc.models import TelechatDocEvent
57+
from redesign.group.models import Group
5558

5659
def date_threshold():
5760
"""Return the first day of the month that is 185 days ago."""
@@ -208,6 +211,23 @@ def get_doc_sectionREDESIGN(id):
208211
s = s + "1"
209212
return s
210213

214+
def get_wg_section(wg):
215+
s = ""
216+
charter_slug = None
217+
if wg.charter:
218+
charter_slug = wg.charter.get_state_slug()
219+
if wg.state_id == "proposed":
220+
if charter_slug == "intrev":
221+
s = '411'
222+
elif charter_slug == "iesgrev":
223+
s = '412'
224+
elif wg.state_id == "active":
225+
if charter_slug == "intrev":
226+
s = '421'
227+
elif charter_slug == "iesgrev":
228+
s = '422'
229+
return s
230+
211231
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
212232
get_doc_section = get_doc_sectionREDESIGN
213233

@@ -253,15 +273,14 @@ def agenda_docs(date, next_agenda):
253273
return res
254274

255275
def agenda_wg_actions(date):
256-
mapping = {12:'411', 13:'412',22:'421',23:'422'}
257-
matches = WGAction.objects.filter(agenda=1,telechat_date=date,category__in=mapping.keys()).order_by('category')
258-
res = {}
259-
for o in matches:
260-
section_key = "s"+mapping[o.category]
276+
matches = Group.objects.filter(charter__docevent__telechatdocevent__telechat_date=date)
277+
278+
res = dict(("s%s%s%s" % (i, j, k), []) for i in range(2, 5) for j in range (1, 4) for k in range(1, 4))
279+
for wg in matches:
280+
section_key = "s" + get_wg_section(wg)
261281
if section_key not in res:
262282
res[section_key] = []
263-
area = AreaGroup.objects.get(group=o.group_acronym)
264-
res[section_key].append({'obj':o, 'area':str(area.area)})
283+
res[section_key].append({'obj':wg})
265284
return res
266285

267286
def agenda_management_issues(date):

ietf/ietfauth/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@
1818
url(r'^reset/$', 'password_reset_view', name='password_reset'),
1919
url(r'^reset/confirm/(?P<username>[\w.@+-]+)/(?P<date>[\d]+)/(?P<realm>[\w]+)/(?P<reset_hash>[a-f0-9]+)/$', 'confirm_password_reset', name='confirm_password_reset'),
2020
url(r'^ajax/check_username/$', 'ajax_check_username', name='ajax_check_username'),
21-
2221
)

ietf/ipr/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def list_drafts(request):
4949
mimetype="text/plain")
5050

5151
def list_draftsREDESIGN(request):
52-
from ipr.models import IprDocAlias
52+
from ietf.ipr.models import IprDocAlias
5353

5454
docipr = {}
5555

ietf/templates/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<div id="ietf-login" class="noprint">{% if user.is_authenticated %}
6666
{{ user }}
6767
{% else %}
68-
<a href="https://datatracker.ietf.org/accounts/login/?next={{request.get_full_path|urlencode}}" rel="nofollow">Sign In</a>
68+
<a href="https://{{ request.get_host }}/accounts/login/?next={{request.get_full_path|urlencode}}" rel="nofollow">Sign In</a>
6969
{% endif %}</div>
7070
{% endif %}
7171

ietf/templates/base_leftmenu.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
<li><a href="{% url doc_search_by_ad name=user.get_profile.person.full_name_as_key %}">My Documents</a></li>
4343
<li><a href="{% url ietf.iesg.views.agenda_documents %}">Next Telechat</a></li>
4444
<li><a href="{% url ietf.iesg.views.discusses %}">Discusses</a></li>
45+
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
4546
{# FIXME: wgcharter <li><a href="{% url wg_search_by_area name=user|ad_area %}">Working Groups</a></li> #}
4647
{% endif %}
4748
{% if user|in_group:"Secretariat" %}
4849
<li class="sect first">Secretariat</li>
4950
<li><a href="{% url ietf.iesg.views.telechat_dates %}">Telechat Dates</a></li>
51+
<li><a href="{% url ietf.iesg.views.working_group_actions %}">Working Groups</a></li>
5052
{# FIXME: wgcharter <li><a href="{% url wg_search_in_process %}">Working Groups</a></li> #}
5153
{% endif %}
5254
{% if user %}

0 commit comments

Comments
 (0)