def get(self, userID = None): activeTab = self.request.get('activeTab') activeTabClass = renderClasses.activeTab(activeTab) localUser = localUsers.localUser() if userID is None: if localUser.exists: self.render('profile.html', userBag = renderClasses.userBag(localUser.id), profileActive = 'active', thisUser = localUser, impressions = renderClasses.twoColumnImpressions(localUser), activeTab = activeTabClass, displaySecure = 'visible', displaySecureAlt = 'none') else: self.redirect('/authenticate?error=you must be logged in for that') else: sameUser = False if localUser.exists: if userID == localUser.id: sameUser = True if sameUser: self.redirect('/profile?activeTab=%s' % activeTab) else: thisUser = localUsers.localUser(userID = userID) self.render('profile.html', userBag = renderClasses.userBag(thisUser.id), impressions = renderClasses.twoColumnImpressions(localUser, commentUserID = thisUser.id), activeTab = activeTabClass, displaySecure = 'none', thisUser = thisUser, displaySecureAlt = 'visible')
def get(self, lensID): localUser = localUsers.localUser() lens = getLens(lensID) lensStats = renderClasses.lensStats(lensID) sortMethod = self.request.get('sortMethod') activeTab = self.request.get('activeTab') if lens is not None: self.render('lensPage.html', lens = lens, lensStats = renderClasses.lensStats(lensID), userComment = renderClasses.userComment(lensID, localUser), comments = renderClasses.threeColumns(lensID, localUser, sortMethod=sortMethod), activePill = renderClasses.activePill(sortMethod), activeTab = renderClasses.activeTab(activeTab), uses = renderClasses.lensUses(lensID), userUses = renderClasses.userUses(lensID, localUser), lensStatus = userBag.lensStatus(localUser, lensID = lensID)) else: self.redirect('/')