Exemplo n.º 1
0
Arquivo: main.py Projeto: daisy/lion
 def index(self):
     """Show the links for the main menu"""
     user = util.get_user(self.session)
     if user == None:
         self.session.warn("No user logged in for this session.")
         e = errorpage.ErrorPage(self.session, "Login error")
         return e.index()
     else:
         self.user = user["users.realname"]
         self.language = user["languages.langname"]
         self.session.execute_query("""SELECT addldocsuri, addldocsdesc FROM
             application WHERE appid="%s" """ % self.appid)
         self.addldocsuri, self.addldocsdesc = self.session.cursor.fetchone()
         self.translate_mnemonics, self.translate_accelerators = \
             keys.get_keyboard_translation_flags(self.session)
         return self.respond()
Exemplo n.º 2
0
    def index(self, view, id_anchor=""):
        """Show the big table of translate-able items"""
        self.last_view = view
        user = util.get_user(self.session)
        if user == None:
            e = errorpage.ErrorPage(self.session, "Login error")
            return e.index()
        self.user = user
        self.language = user["languages.langname"]
        self.view_description = VIEW_DESCRIPTIONS[view]
        self.form, self.count = self.make_table(view, self.pagenum)
        self.targetid = id_anchor
        # calculate the num pages for the base class
        self.total_num_pages = self.get_total_num_pages()
        self.warnings = self.get_all_warnings()
        self.translate_mnemonics, self.translate_accelerators = keys.get_keyboard_translation_flags(self.session)

        return self.respond()
Exemplo n.º 3
0
    def index(self, view, id_anchor=""):
        """Show the big table of translate-able items"""
        self.last_view = view
        user = util.get_user(self.session)
        if user == None:
            e = errorpage.ErrorPage(self.session, "Login error")
            return e.index()
        self.user = user
        self.language = user["languages.langname"]
        self.view_description = VIEW_DESCRIPTIONS[view]
        self.form, self.count = self.make_table(view, self.pagenum)
        self.targetid = id_anchor
        # calculate the num pages for the base class
        self.total_num_pages = self.get_total_num_pages()
        self.warnings = self.get_all_warnings()
        self.translate_mnemonics, self.translate_accelerators = \
            keys.get_keyboard_translation_flags(self.session)

        return self.respond()