Esempio n. 1
0
    def save_settings(self, username):
        self.linkcolor = self.request.get('linkcolor')
        self.sidebarcolor = self.request.get('sidebarcolor')
        self.headercolor = self.request.get('headercolor')
        self.headerfont = self.request.get('headerfont')
        self.bodyfont = self.request.get('bodyfont')
        self.projects = bool(self.request.get('projects'))
        self.courses = bool(self.request.get('courses'))
        self.books = bool(self.request.get('books'))
        self.online = bool(self.request.get('online'))
        self.opensource = bool(self.request.get('opensource'))
        self.meatspace = bool(self.request.get('meatspace'))

        
        s = Settings.by_username(username)
        s.link_color = self.linkcolor
        s.sidebar_color = self.sidebarcolor
        s.header_color = self.headercolor
        s.header_font = self.headerfont
        s.body_font = self.bodyfont
        s.projects = self.projects
        s.courses = self.courses
        s.books = self.books
        s.online = self.online
        s.open_source = self.opensource
        s.meatspace = self.meatspace
        s.put()
Esempio n. 2
0
 def add_settings(self, params, username):
     s = Settings.by_username(username)
     if s:
         params['linkcolor'] = s.link_color
         params['sidebarcolor'] = s.sidebar_color
         params['headercolor'] = s.header_color
         params['headerfont'] = s.header_font
         params['bodyfont'] = s.body_font
         params['projects'] = s.projects
         params['courses'] = s.courses
         params['books'] = s.books
         params['online'] = s.online
         params['opensource'] = s.open_source
         params['meatspace'] = s.meatspace
Esempio n. 3
0
    def get(self, username):
        
        #Check if user exists
        u = User.by_name(username)
        if not u:
            self.response.out.write('404 Not Found')

        else:
            i = TranscriptItem.by_username(username)
            
            s = Settings.by_username(username)
            params = { 'username': u.username,
                       'name': u.name,
                       'twitter': u.twitter,
                       'github': u.github,
                       'website': u.website,
                       'projects': s.projects,
                       'courses': s.courses,
                       'books': s.books,
                       'online': s.online,
                       'opensource': s.open_source,
                       'meatspace': s.meatspace,
                       'items': list(i) }
            self.render('transcript.html', **params)