예제 #1
0
def slide():
    global tag
    global picurl
    if request.method == "GET":
        taglist = db.getTaglist()
        piclist = db.getPics(tag)
        return render_template("slide.html", taglist=taglist, piclist=piclist)
    else:
        url = request.form["hidSrc"]
        picurl = url
        return redirect(url_for("/image"))
예제 #2
0
def image():
    import db

    if request.method == "GET":
        taglist = db.getTaglist()
        tags = db.getTags(picurl)
        url = request.form["hidSrc"]
        commentlist = db.getComments(picurl)
        return render_template("image.html", taglist=taglist, tags=tags, commentlist=commentlist, pic=url)
    else:
        button = request.form["button"]

        if button == "submit":
            aComment = request.form["comment"]
            db.addComment(picurl, aComment)
        elif button == "submitnewtag":
            if request.form["Addnewtag"]:
                aTag = request.form["Addnewtag"]
                db.addTag(picurl, aTag)
            else:
                aTag = request.form["select1"]
                db.addTag(picurl, aTag)