Ejemplo n.º 1
0
 def get(self):
     if users.is_current_user_admin():
         stuff = models.get_all_stuff()
         numbers = []
         for s in stuff:
             numbers.append(s.number)
         t_path = 'templates/admin-add.html'
         admin_main = views.render_view(t_path, 'add', numbers)
         self.response.out.write(admin_main)
     else:
         self.redirect('/')
Ejemplo n.º 2
0
 def get(self,mode):
     if users.is_current_user_admin():
         if mode == "log":
             t_path = 'templates/admin-editlogs.html'
             logs = models.get_logs()
             page = views.render_view(t_path, 'editlogs',logs[0])
         if mode == "stuff":
             t_path = 'templates/admin-editstuff.html'
             stuff = models.get_all_stuff()
             page = views.render_view(t_path, 'editstuff', stuff)
         if mode == "ttext":
             t_path = 'templates/admin-edittt.html'
             tt = models.get_all_tt()
             page = views.render_view(t_path, 'edittt', tt)
         self.response.out.write(page)
     else:
         self.redirect('/')
Ejemplo n.º 3
0
 def renderStuff(self):
     t_path = 'templates/public-stufflist.html'
     stuff = models.get_all_stuff()
     return views.render_view(t_path, 'stufflist', stuff)