Esempio n. 1
0
def tag(name):
    tagged = current_wiki.index_by_tag(name)
    new_pages = []

    for t in tagged:
        p = Page.get_highest_version_of_file_path(t.path)
        if t.path == p and t not in new_pages:
            new_pages.append(t)

    return render_template('tag.html', pages=new_pages, tag=name)
Esempio n. 2
0
def related(url):
    # get url
    page = current_wiki.get_or_404(url)

    # make list of tags about original article
    tags = page.tags
    tagslist =  tags.split(", ")

    #blank list to hold other articles with the same tags
    tagged = []
    for i in tagslist:
        # append tag category
        tagged.append(i.capitalize())
        #check if list of articles is only the original article, if not then add the article
        if len(current_wiki.index_by_tag(i)) > 1:
            tagged += current_wiki.index_by_tag(i)
        #if there are no other articles other than the orignal article, append this statement
        else:
            tagged.append("No other wikis with this tag")

    return render_template('related.html', tags=tagslist, page = page, pages = tagged)
Esempio n. 3
0
def tag(name):
    tagged = current_wiki.index_by_tag(name)
    return render_template('tag.html', pages=tagged, tag=name)
Esempio n. 4
0
def tag(name):
    tagged = current_wiki.index_by_tag(name)
    return render_template('tag.html', pages=tagged, tag=name)