~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/person.py

  • Committer: Curtis Hovey
  • Date: 2010-09-21 04:21:16 UTC
  • mto: This revision was merged to the branch mainline in revision 11593.
  • Revision ID: curtis.hovey@canonical.com-20100921042116-dcytfpq1gbpwxq84
Removed code and tests that render google maps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
147
147
    helpers,
148
148
    )
149
149
from canonical.launchpad.browser.feeds import FeedsMixin
150
 
from canonical.launchpad.browser.launchpad import get_launchpad_views
151
150
from canonical.launchpad.interfaces.account import (
152
151
    AccountStatus,
153
152
    IAccount,
239
238
from lp.code.browser.sourcepackagerecipelisting import HasRecipesMenuMixin
240
239
from lp.code.errors import InvalidNamespace
241
240
from lp.code.interfaces.branchnamespace import IBranchNamespaceSet
242
 
from lp.registry.browser import MapMixin
243
241
from lp.registry.browser.branding import BrandingChangeView
244
242
from lp.registry.browser.mailinglists import enabled_with_active_mailing_list
245
243
from lp.registry.browser.menu import (
3338
3336
        return self.state is EmailAddressVisibleState.ALLOWED
3339
3337
 
3340
3338
 
3341
 
class PersonIndexView(XRDSContentNegotiationMixin, MapMixin, PersonView):
 
3339
class PersonIndexView(XRDSContentNegotiationMixin, PersonView):
3342
3340
    """View class for person +index and +xrds pages."""
3343
3341
 
3344
3342
    xrds_template = ViewPageTemplateFile(
3346
3344
 
3347
3345
    def initialize(self):
3348
3346
        super(PersonIndexView, self).initialize()
3349
 
        # This view requires the gmap2 Javascript in order to render the map
3350
 
        # with the person's usual location. The location is only availble if
3351
 
        # the location is set, visible, and the viewing user wants to see it.
3352
 
        launchpad_views = get_launchpad_views(self.request.cookies)
3353
 
        self._small_map = launchpad_views['small_maps']
3354
 
        if (self.gmap2_enabled
3355
 
            and self.has_visible_location and self._small_map):
3356
 
            self.request.needs_gmap2 = True
3357
3347
        if self.request.method == "POST":
3358
3348
            self.processForm()
3359
3349
 
3410
3400
        assert self.has_visible_location, (
3411
3401
            "Can't generate the map for a person who hasn't set a "
3412
3402
            "visible location.")
3413
 
        assert self.request.needs_gmap2 or not self._small_map, (
3414
 
            "To use this method a view must flag that it needs gmap2.")
3415
 
 
3416
3403
        replacements = {'center_lat': self.context.latitude,
3417
3404
                        'center_lng': self.context.longitude}
3418
3405
        return u"""