Ejemplo n.º 1
0
def render():
    form = cgi.FieldStorage()
    if 'who' in form:
        user = form['who'].value
    else:
        user = ''

    if 'mood' in form and form['mood'].value == "sad":
        print '<iframe src="http://www.omfgdogs.com/" width="1920" height="1080" frameborder="0"></iframe>'

    data = dict(
        matelist = matelist.get_matelist(user),
        news_pane_contents = news.get_news_pane(user),
        gallery = gallery.get_gallery(user),
        courses_pane_contents = courses.get_courses_pane(user),
        profile_picture = images.get_profile_picture(user),
        controls = mate.get_control_panel(user),
        edit_pane_tab = editor.get_edit_tab(user),
        edit_pane_contents = editor.render(user),
        upload_pane_tab = upload.get_upload_tab(user),
        upload_pane_contents = upload.render(user),
        suggest_pane_tab = suggest.get_suggest_tab(user),
        suggest_pane_contents = suggest.get_suggest_pane(user),
        privacy_pane_tab = privacy.get_privacy_tab(user),
        privacy_pane_contents = privacy.get_privacy_pane(user),
    )

    data.update(privacy.get_user_data(user));

    return tempy.render('matepage.template', data)
Ejemplo n.º 2
0
def render_results(results):

    full_string = "";

    for result in results:
        data = dict(
            profile_picture = images.get_profile_picture(result),
            user_page = cgienv.get_URL() + "?who=" + result
        )
        data.update(db.get_user_data (result))
        full_string += tempy.substitute('search_result.template', data)

    return full_string
Ejemplo n.º 3
0
def render(users):
    result = '';

    for i in xrange (0, len(users), 3):
        group = users[i:i+3]

        result += '<div class="row-fluid" id="userlist">'

        for user in group:

            result += '<div class="span4">'
            result += '<div class="span6"><a href="?who=' + user + '">' + images.get_profile_picture(user) + "</a></div>\n"
            result += '<div class="span6"><br /><a href="?who=' + user + '"><p><b>' + db.get_data(user, 'name') + "</b></p></a></div>\n"
            result += '</div>'
        result += '<br />'
        result += '</div>'
       
    return result
Ejemplo n.º 4
0
def comment_format(comment):
    data = {}
    data['image'] = images.get_profile_picture(comment[0])
    data['user'] = matedb.get_data(comment[0], 'name')
    data['message'] = comment[1]
    return tempy.substitute('news_comment.template', data)