Exemplo n.º 1
0
def reviewSet(reviewid=None):
    studyset = models.getSetById(reviewid)
    if not studyset:
        return "404 set not found"
    #terms,defs,termtypes,deftypes = models.getSetData(studyset)
    terms = models.getStudyData(studyset)
    isCreator = False
    isFav = False
    if g.userId != None:
        creator = models.getCreator(reviewid).username
        isCreator = creator.lower() == g.userId.lower()
        isFav = models.favExists(g.userId.lower(), reviewid)
    # TODO: ESCAPE QUOTES
    # ,defs=defs,termtypes=termtypes, deftypes=deftypes,
    return render_template('reviewset.html',settitle=studyset.title,
        private=studyset.isprivate,terms=terms, setId=reviewid,
        isEditable=True, isCreator=isCreator,isFavable=True,isFav=isFav)
Exemplo n.º 2
0
def tagImage(setId=None, play=None):
    theSet = models.getTagSet(setId)
    width,height = models.getImageDims(setId)
    tags = models.getImageTags(setId)
    isCreator = False
    if g.userId != None:
        creator = models.getCreator(setId).username
        isCreator = creator.lower() == g.userId.lower()
    isGame,isEdit = False,False
    if play == 'edit':
        isEdit = True
    elif play:
        isGame = True
    isFav = False 
    if g.userId:
        isFav = models.favExists(g.userId.lower(), setId) #TODO BREAKS WHEN NOT LOGGED IN
    return render_template('tagimage.html', theset=theSet, setId=setId,imgwidth=width,
        imgheight=height, tags=tags, isCreator=isCreator,isGame=isGame, isEditable=True, isEdit=isEdit,
        isFavable=True,isFav=isFav, flashes=get_flashed_messages())