Example #1
0
def showsuite_rating(stid=None):
    session_init(session, db)

    for st in db.filtered_query('suite'):
        if st.id == stid:
            stname, notes, _pid = st.name, st.notes, st.person_id
    if stname is None:
        error = 'Could not find Suite #%i' % stid
        return render_template('ptable.html', error=error)

    ratings = []
    for score, review, dtime, pid in suite_ratings(db, stid):
        person = db.get_person(pid)
        ratings.append({
            'score': score,
            'review': multiline_text(review),
            'date': fmttime(dtime),
            'person_email': person.email,
            'person_name': person.name,
            'person_affil': person.affiliation
        })

    return render_template('show_suite_ratings.html',
                           ratings=ratings,
                           suite_notes=notes,
                           suite_name=stname)
Example #2
0
def rate_suite(stid=None):
    session_init(session, db)
    error = None
    if session['username'] is None:
        error = 'must be logged in to rate suite'
        return redirect(url_for('suites', stid=stid, error=error))

    for st in db.filtered_query('suite'):
        if st.id == stid:
            stname, notes, person_id = st.name, st.notes, st.person_id

    pid = session['person_id']
    score = 3
    review = '<review>'
    for _s, _r, _d, _p in suite_ratings(db, stid):
        if _p == pid:
            score = _s
            review = _r

    return render_template('ratesuite.html',
                           error=error,
                           suite_id=stid,
                           suite_name=stname,
                           person_id=pid,
                           score=score,
                           review=review)
def showsuite_rating(stid=None):
    session_init(session, db)

    for st in db.filtered_query('suite'):
        if st.id == stid:
            stname, notes, _pid = st.name, st.notes, st.person_id
    if stname is None:
        error = 'Could not find Suite #%i' % stid
        return render_template('ptable.html', error=error)

    ratings = []
    for score, review, dtime, pid in suite_ratings(db, stid):
        person = db.get_person(pid)
        ratings.append({'score': score, 'review': multiline_text(review),
                        'date': fmttime(dtime),
                        'person_email': person.email,
                        'person_name': person.name,
                        'person_affil': person.affiliation})

    return render_template('show_suite_ratings.html',
                           ratings=ratings, suite_notes=notes,
                           suite_name=stname)
def rate_suite(stid=None):
    session_init(session, db)
    error=None
    if session['username'] is None:
        error='must be logged in to rate suite'
        return redirect(url_for('suites', stid=stid, error=error))

    for st in db.filtered_query('suite'):
        if st.id == stid:
            stname, notes, person_id = st.name, st.notes, st.person_id

    pid = session['person_id']
    score = 3
    review = '<review>'
    for _s, _r, _d, _p in suite_ratings(db, stid):
        if _p == pid:
            score = _s
            review =  _r

    return render_template('ratesuite.html', error=error,
                           suite_id=stid, suite_name=stname,
                           person_id=pid, score=score, review=review)