From 325659d1f5022207b9ebb6690081f85002132f2c Mon Sep 17 00:00:00 2001 From: Daniel Cortes Date: Sat, 16 Feb 2019 03:10:57 -0300 Subject: [PATCH] Creado un "panel" de administracion, basicamente son links a las rutas para crear cosas :3 --- www/admin.py | 2 ++ www/templates/admin/panel.html | 11 +++++++++++ www/templates/base.html | 4 +--- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 www/templates/admin/panel.html diff --git a/www/admin.py b/www/admin.py index d23df34..828624f 100644 --- a/www/admin.py +++ b/www/admin.py @@ -1,9 +1,11 @@ from flask import Blueprint, flash, g, redirect, render_template, request, session, url_for from www.db import get_db +from www.auth import admin_required bp = Blueprint('admin', __name__, url_prefix='/admin') @bp.route('/panel') +@admin_required def panel(): return render_template('admin/panel.html') diff --git a/www/templates/admin/panel.html b/www/templates/admin/panel.html new file mode 100644 index 0000000..35bf789 --- /dev/null +++ b/www/templates/admin/panel.html @@ -0,0 +1,11 @@ +{% extends 'base.html' %} + +{% block title %}admin/panel{% endblock %} + +{% block content %} + +{% endblock %} diff --git a/www/templates/base.html b/www/templates/base.html index c345a36..cb90fa5 100644 --- a/www/templates/base.html +++ b/www/templates/base.html @@ -17,9 +17,7 @@ /recomended /now {% if g.user %} - /create-post - /update-now - /logout + /admin {% endif %}