Skip to content

Commit 609f368

Browse files
committed
Still clunky but far enough along for sprinters to play with and comment on
- Legacy-Id: 9720
1 parent 61474a4 commit 609f368

7 files changed

Lines changed: 90 additions & 12 deletions

File tree

hack_pres.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/python
2+
3+
import os, sys
4+
import django
5+
6+
#basedir = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
7+
#sys.path.insert(0, basedir)
8+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ietf.settings")
9+
10+
django.setup()
11+
12+
from django.db.utils import IntegrityError
13+
from ietf.meeting.views import session_draft_list
14+
from ietf.meeting.models import Meeting
15+
from ietf.doc.models import Document
16+
17+
m93 = Meeting.objects.get(number=93)
18+
19+
for acronym in set(m93.agenda.scheduledsession_set.values_list('session__group__acronym',flat=True)):
20+
for namerev in session_draft_list(93,acronym):
21+
name=namerev[:-3]
22+
rev = namerev[-2:]
23+
doc = Document.objects.filter(docalias__name=name).first()
24+
if not doc:
25+
print "Can't find anything named",name
26+
else:
27+
for session in m93.session_set.filter(group__acronym=acronym):
28+
try:
29+
session.sessionpresentation_set.get_or_create(document=doc,rev=rev)
30+
except IntegrityError:
31+
print "No luck on ",acronym,"->",name,rev

ietf/doc/views_doc.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ def document_main(request, name, rev=None):
299299
status_changes = [ rel.document for rel in status_change_docs if rel.document.get_state_slug() in ('appr-sent','appr-pend')]
300300
proposed_status_changes = [ rel.document for rel in status_change_docs if rel.document.get_state_slug() in ('needshep','adrev','iesgeval','defer','appr-pr')]
301301

302+
presentations = doc.future_presentations()
303+
302304
# remaining actions
303305
actions = []
304306

@@ -361,6 +363,7 @@ def document_main(request, name, rev=None):
361363
table_rows['stream'] += 1 if consensus else 0
362364
table_rows['stream'] += 1 if shepherd_writeup or can_edit_shepherd_writeup else 0
363365
table_rows['stream'] += 1 if published and started_iesg_process and published.time < started_iesg_process.time else 0
366+
table_rows['stream'] += 1 if presentations or can_edit_stream_info else 0
364367

365368
table_rows['iesg'] += 1 if iesg_state and (doc.note or can_edit) else 0
366369

@@ -422,6 +425,7 @@ def document_main(request, name, rev=None):
422425
search_archive=search_archive,
423426
actions=actions,
424427
tracking_document=tracking_document,
428+
presentations=presentations,
425429
),
426430
context_instance=RequestContext(request))
427431

@@ -540,13 +544,15 @@ def document_main(request, name, rev=None):
540544

541545
if doc.type_id in ("slides", "agenda", "minutes"):
542546
can_manage_material = can_manage_materials(request.user, doc.group)
543-
presentations = None
544-
if doc.type_id=='slides' and doc.get_state_slug('slides')=='active' :
545-
presentations = doc.future_presentations()
547+
#presentations = None
548+
#if doc.type_id=='slides' and doc.get_state_slug('slides')=='active' :
549+
# presentations = doc.future_presentations()
550+
presentations = doc.future_presentations()
546551
if doc.meeting_related():
547-
# disallow editing meeting-related stuff through this
548-
# interface for the time being
549-
can_manage_material = False
552+
## disallow editing meeting-related stuff through this
553+
## interface for the time being
554+
# Now try allowing it
555+
# can_manage_material = False
550556
basename = doc.canonical_name() # meeting materials are unversioned at the moment
551557
if doc.external_url:
552558
# we need to remove the extension for the globbing below to work

ietf/doc/views_material.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,15 @@ def time_sort_key(session):
250250
def edit_material_presentations(request, name, acronym=None, date=None, seq=None, week_day=None):
251251

252252
doc = get_object_or_404(Document, name=name)
253-
if not (doc.type_id=='slides' and doc.get_state('slides').slug=='active'):
254-
raise Http404
253+
254+
# For now, allow any document type, in any state to be put on an agenda.
255+
# if not (doc.type_id=='slides' and doc.get_state('slides').slug=='active'):
256+
# raise Http404
255257

256258
group = doc.group
257-
if not (group.features.has_materials and can_manage_materials(request.user,group)):
259+
260+
#if not (group.features.has_materials and can_manage_materials(request.user,group)):
261+
if not can_manage_materials(request.user,group):
258262
raise Http404
259263

260264
sorted_sessions = get_upcoming_manageable_sessions(request.user, doc, acronym, date, seq, week_day)
@@ -301,11 +305,16 @@ def edit_material_presentations(request, name, acronym=None, date=None, seq=None
301305
def material_presentations(request, name, acronym=None, date=None, seq=None, week_day=None):
302306

303307
doc = get_object_or_404(Document, name=name)
304-
if not (doc.type_id=='slides' and doc.get_state('slides').slug=='active'):
305-
raise Http404
308+
309+
# For now, allow any document type, in any state to be put on an agenda.
310+
#if not (doc.type_id=='slides' and doc.get_state('slides').slug=='active'):
311+
# raise Http404
306312

307313
group = doc.group
308-
if not (group.features.has_materials and can_manage_materials(request.user,group)):
314+
315+
#if not (group.features.has_materials and can_manage_materials(request.user,group)):
316+
317+
if not can_manage_materials(request.user,group):
309318
raise Http404
310319

311320
sorted_sessions = get_upcoming_manageable_sessions(request.user, doc, acronym, date, seq, week_day)

ietf/meeting/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,9 @@ def minutes(self):
895895
def slides(self):
896896
return list(self.materials.filter(type='slides').exclude(states__type='slides',states__slug='deleted').order_by('order'))
897897

898+
def drafts(self):
899+
return list(self.materials.filter(type='draft'))
900+
898901
def __unicode__(self):
899902
if self.meeting.type_id == "interim":
900903
return self.meeting.number

ietf/templates/doc/document_draft.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,25 @@
196196
</tr>
197197
{% endif %}
198198

199+
{% if presentations or can_edit_stream_info %}
200+
<tr>
201+
<th>On Agenda</th>
202+
<td class="edit">
203+
{% if not snapshot and can_edit_stream_info %}
204+
{% doc_edit_button "material_presentations" name=doc.name %}
205+
{% endif %}
206+
</td>
207+
208+
<td>
209+
{% if presentations %}
210+
{% for pres in presentations %}{{ pres.session.short_name }} at {{ pres.session.meeting }} {% if pres.rev != doc.rev %}(version -{{ pres.rev }}){% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}
211+
{% else %}
212+
None
213+
{% endif %}
214+
</td>
215+
</tr>
216+
{% endif %}
217+
199218
<tr>
200219
<th>Document shepherd</th>
201220
<td class="edit">

ietf/templates/meeting/group_materials.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@
4848
{% endfor %}
4949
{% endwith %}
5050
</td>
51+
<td>
52+
{% with session.drafts as drafts %}
53+
{% for draft in drafts %}
54+
<a href="{% url "doc_view" name=draft.canonical_name %}">{{ draft.canonical_name }}</a><br>
55+
{% empty %}
56+
<span class="label label-warning">No drafts</span>
57+
{% endfor %}
58+
{% endwith %}
59+
</td>
5160
{% endif %}
5261
</tr>
5362

ietf/templates/meeting/materials.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ <h2 class="anchor-target" id="{{sessions.list.0.group.parent.acronym}}">{{sessio
6464
<th>Agenda</th>
6565
<th>Minutes</th>
6666
<th>Slides</th>
67+
<th>Drafts</th>
6768
</tr>
6869
</thead>
6970

0 commit comments

Comments
 (0)