Пример #1
0
 def GET(self, room):
     room = rooms.getroom(room)
     allthreads = threads.forroom(room.id)
     person = auth.getuser()
     
     print config.base.layout(view.threads(room, allthreads), person)
     
Пример #2
0
    def GET(self, room):
        room = rooms.getroom(room)
        transcript = threads.threadtranscript(room.thread_id)
        person = auth.getuser()
        recent = threads.getrecent(person.id, limit=2)

        print config.base.thread(view.lobby(transcript.thread, transcript.messages, person), recent)
Пример #3
0
 def GET(self, id):
     thread = threads.thread(id)
     
     if thread['resolved']:
         web.seeother('/thread/%s/archive/' % id)
     
     transcript = threads.threadtranscript(id)
     threads.updaterecent(person.id, id)
     
     recent = threads.getrecent(person.id, limit=2)
     print config.base.thread(view.thread(transcript.thread, transcript.messages, auth.getuser()), recent, 'thread')
Пример #4
0
 def GET(self):
     person = auth.getuser()
     if person: web.seeother('/dashboard/')
     else:
         print config.base.layout(view.default(), person, title='home')
Пример #5
0
 def GET(self):
     person = auth.getuser()
     recent = threads.getrecent(person.id, limit=40)
     print config.base.layout(view.recent(recent), person)
Пример #6
0
 def GET(self):
     person = auth.getuser()
     recent = threads.getrecent(person.id)
     
     print config.base.layout(view.dashboard(person, recent), person)
Пример #7
0
import web
import config
import simplejson

from web import form

from app.models import threads
from app.models import rooms

from app.utilities import auth

view = web.template.render('app/views/threads/', cache=config.cache)
person = auth.getuser()

def getquestion():
    input = web.input()
    try:
        if input.question:
            return input.question
        else:
            return ''
    except AttributeError:
        pass
        
qform = form.Form(
    form.Dropdown('rooms', [(r.id, r.title) for r in rooms.getrooms()]),
    form.Textbox('summary', form.notnull, size = 50),
    form.Textarea('question', value=getquestion(),
        cols = 50, rows = 20),
)
Пример #8
0
 def GET(self):
     roomlist = rooms.getrooms()
     recentthreads = threads.recent()
     print config.base.layout(view.list(roomlist, recentthreads), auth.getuser())