~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/browser/sprint.py

Merged rocketfuel into trivial.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
__metaclass__ = type
7
7
__all__ = [
 
8
    'HasSprintsView',
8
9
    'SprintAddView',
9
10
    'SprintAttendeesCsvExportView',
10
11
    'SprintBrandingView',
164
165
    enable_only = ['overview', ]
165
166
 
166
167
 
 
168
class HasSprintsView(LaunchpadView):
 
169
 
 
170
    page_title = 'Events'
 
171
 
 
172
 
167
173
class SprintView(HasSpecificationsView):
168
174
 
169
175
    implements(IMajorHeadingView)
225
231
        return dt.strftime('%Y-%m-%d')
226
232
 
227
233
    _local_timeformat = '%H:%M %Z on %A, %Y-%m-%d'
 
234
 
228
235
    @property
229
236
    def local_start(self):
230
237
        """The sprint start time, in the local time zone, as text."""
376
383
        self.attendee_ids = set(
377
384
            attendance.attendeeID for attendance in self.context.attendances)
378
385
 
379
 
 
380
386
    @cachedproperty
381
387
    def spec_filter(self):
382
388
        """Return the specification links with PROPOSED status for this
400
406
        if 'SUBMIT_CANCEL' in form:
401
407
            self.status_message = 'Cancelled'
402
408
            self.request.response.redirect(
403
 
                canonical_url(self.context)+'/+specs')
 
409
                canonical_url(self.context) + '/+specs')
404
410
            return
405
411
 
406
412
        if 'SUBMIT_ACCEPT' not in form and 'SUBMIT_DECLINE' not in form:
439
445
        if leftover == 0:
440
446
            # they are all done, so redirect back to the spec listing page
441
447
            self.request.response.redirect(
442
 
                canonical_url(self.context)+'/+specs')
 
448
                canonical_url(self.context) + '/+specs')
443
449
 
444
450
 
445
451
class SprintMeetingExportView(LaunchpadView):
477
483
                model_specs, ['specificationID']):
478
484
            if subscription.personID not in attendee_set:
479
485
                continue
480
 
            people[subscription.specificationID][subscription.personID] = \
481
 
                subscription.essential
482
 
        # Spec specials - drafter/assignee. Don't need approver for performance
483
 
        # as specifications() above eager loaded the people, and approvers
484
 
        # don't count as a 'required person'.
 
486
            people[subscription.specificationID][
 
487
                subscription.personID] = subscription.essential
 
488
 
 
489
        # Spec specials - drafter/assignee.  Don't need approver for
 
490
        # performance, as specifications() above eager-loaded the
 
491
        # people, and approvers don't count as "required persons."
485
492
        for spec in model_specs:
486
 
            # get the list of attendees that will attend the sprint
 
493
            # Get the list of attendees that will attend the sprint.
487
494
            spec_people = people[spec.id]
488
495
            if spec.assigneeID is not None:
489
496
                spec_people[spec.assigneeID] = True
583
590
                 # We used to store phone, organization, city and
584
591
                 # country, but this was a lie because users could not
585
592
                 # update these fields.
586
 
                 '', # attendance.attendee.phone
587
 
                 '', # attendance.attendee.organization
588
 
                 '', # attendance.attendee.city
589
 
                 '', # country
 
593
                 '',  # attendance.attendee.phone
 
594
                 '',  # attendance.attendee.organization
 
595
                 '',  # attendance.attendee.city
 
596
                 '',  # country
590
597
                 time_zone,
591
598
                 attendance.time_starts.strftime('%Y-%m-%dT%H:%M:%SZ'),
592
599
                 attendance.time_ends.strftime('%Y-%m-%dT%H:%M:%SZ'),