~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/canonical/launchpad/browser/person.py

  • Committer: Robert Collins
  • Date: 2005-10-31 18:29:12 UTC
  • mfrom: (1102.1.126)
  • mto: (1102.1.138) (63.1.155)
  • mto: This revision was merged to the branch mainline in revision 2836.
  • Revision ID: robertc@robertcollins.net-20051031182912-5b96cbfc568d7a46
Merge ddaa and my branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    'PersonBugsMenu',
12
12
    'PersonSpecsMenu',
13
13
    'PersonSupportMenu',
 
14
    'PersonCodeMenu',
14
15
    'PersonOverviewMenu',
15
16
    'TeamOverviewMenu',
16
17
    'BaseListView',
61
62
    IKarmaSet, UBUNTU_WIKI_URL, ITeamMembershipSet, IObjectReassignment,
62
63
    ITeamReassignment, IPollSubset, IPerson, ICalendarOwner,
63
64
    BugTaskSearchParams, ITeam, ILibraryFileAliasSet, ITeamMembershipSubset,
64
 
    IPollSet)
 
65
    IPollSet, NotFoundError)
65
66
 
66
67
from canonical.launchpad.browser.editview import SQLObjectEditView
67
68
from canonical.launchpad.browser.form import FormView
90
91
    def breadcrumb(self):
91
92
        return self.context.displayname
92
93
 
 
94
    @stepto('+branch')
 
95
    def traverse_branch(self):
 
96
        stepstogo = self.request.stepstogo
 
97
        product_name = stepstogo.consume()
 
98
        branch_name = stepstogo.consume()
 
99
        if product_name is not None and branch_name is not None:
 
100
            if product_name == '+junk':
 
101
                return self.context.getBranch(None, branch_name)
 
102
            else:
 
103
                return self.context.getBranch(product_name, branch_name)
 
104
        raise NotFoundError
 
105
 
93
106
 
94
107
class TeamNavigation(Navigation, CalendarTraversalMixin):
95
108
 
151
164
    usedfor = IPerson
152
165
 
153
166
    enable_only = ['overview', 'bugs', 'support', 'bounties', 'specifications',
154
 
                   'translations', 'calendar']
 
167
                   'translations', 'calendar', 'code']
 
168
 
 
169
    links = StandardLaunchpadFacets.links + ['code']
155
170
 
156
171
    def overview(self):
157
172
        target = ''
208
223
            self.context.browsername)
209
224
        return Link(target, text, summary)
210
225
 
 
226
    def code(self):
 
227
        target = '+branches'
 
228
        text = 'Code'
 
229
        summary = 'Bazaar Branches for %s' % self.context.browsername
 
230
        return Link(target, text, summary)
 
231
 
211
232
    def calendar(self):
212
233
        target = '+calendar'
213
234
        text = 'Calendar'
298
319
        return Link('+subscribedtickets', text, icon='ticket')
299
320
 
300
321
 
 
322
class PersonCodeMenu(ApplicationMenu):
 
323
 
 
324
    usedfor = IPerson
 
325
    facet = 'code'
 
326
    links = ['authored', 'registered', 'subscribed', 'add']
 
327
 
 
328
    def authored(self):
 
329
        text = 'Show Authored Branches'
 
330
        return Link('+authoredbranches', text, icon='branch')
 
331
 
 
332
    def registered(self):
 
333
        text = 'Show Registered Branches'
 
334
        return Link('+registeredbranches', text, icon='branch')
 
335
 
 
336
    def subscribed(self):
 
337
        text = 'Show Subscribed Branches'
 
338
        return Link('+subscribedbranches', text, icon='branch')
 
339
 
 
340
    def add(self):
 
341
        text = 'Add Bazaar Branch'
 
342
        return Link('+addbranch', text, icon='add')
 
343
 
 
344
 
301
345
class CommonMenuLinks:
302
346
 
303
347
    def common_edit(self):