def render_template(self, filename, params=None): if params and "locale" in params.keys(): locale = params["locale"] elif self.user: if self.user.preferences.locale: locale = self.user.preferences.locale else: locale = None i18n.get_i18n().set_locale(locale) if not params: params = {} is_superuser = False if self.user: is_superuser = self.user.is_superuser is_betatester = False if self.user: is_betatester = self.user.is_betatester params["the_user"] = self.user params["the_user_is_superuser"] = is_superuser params["the_user_is_betatester"] = is_betatester if self.user: params["the_user_addgigbandlist"] = self.user.get_add_gig_band_list(self, self.user.key) params["logout_link"] = self.uri_for("logout") if self.user is not None and not self.user.seen_welcome: params["welcome"] = True if self.user is not None and not self.user.seen_motd: params["motd"] = motd_db.get_motd() self.render_response(filename, params)
def render_template(self, filename, params=None): if not params: params = {} # override locale if set in params if params and 'locale' in params.keys(): i18n.get_i18n().set_locale(params['locale']) is_superuser = False if self.user: is_superuser = self.user.is_superuser is_betatester = False if self.user: is_betatester = self.user.is_betatester params['the_user'] = self.user params['the_user_is_superuser'] = is_superuser params['the_user_is_betatester'] = is_betatester if self.user: params[ 'the_user_addgigbandlist'] = self.user.get_add_gig_band_list( self, self.user.key) params['the_user_forumslist'] = self.user.get_forums( self, self.user.key) params['logout_link'] = self.uri_for('logout') if self.user is not None and not self.user.seen_welcome: params['welcome'] = True if self.user is not None and not self.user.seen_motd: params['motd'] = motd_db.get_motd() self.render_response(filename, params)
def _make_page(self, the_user): template_args = {'current': motd_db.get_motd()} self.render_template('motd_admin.html', template_args)
def _make_page(self,the_user): template_args = { 'current' : motd_db.get_motd() } self.render_template('motd_admin.html', template_args)