Exemplo n.º 1
0
def delete(id):
    page = pm.get_page(id)
    if not page:
        abort(404)
    pm.delete(page)
    flash(_('Page deleted.'), 'success')
    return redirect(url_for('home'))
Exemplo n.º 2
0
def history(id):
    page = pm.get_page(id)
    commitSHA = request.args.get('commitSHA', None)
    if commitSHA:
        version = request.args.get('version', None)
        content = pm.get_version(id, commitSHA)
        return render_template('version.html', page=page, content=content, version=version, commitSHA=commitSHA)
    logs = pm.get_page_logs(id)
    return render_template('history.html', page=page, logs=logs)
Exemplo n.º 3
0
def recommendation(id):
    recs = getRecommendedItems(id)
    recommendation = [(pm.get_page(rec[0]), rec[1]) for rec in recs]
    return render_template('recommendations.html', recs=recommendation)