diff --git a/RecetasPy/old/__init__.py b/RecetasPy/old/__init__.py new file mode 100644 index 0000000..0c3c9b8 --- /dev/null +++ b/RecetasPy/old/__init__.py @@ -0,0 +1,55 @@ +import os +from flask import Flask, url_for +from flask_sqlalchemy import SQLAlchemy +from flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user + +# init SQLAlchemy so we can use it later in our models +db = SQLAlchemy() + +from recetaspy import paginas, auth + +def create_app(): + app = Flask(__name__) + app.config.from_prefixed_env() + + app.config['SECRET_KEY'] = 'secret-key-goes-here' + app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///recipes.db' + app.config['UPLOAD_FOLDER'] = os.path.join(app.instance_path, 'uploads') + + app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16 MB máximo + + # Asegúrate de que el directorio de carga existe + os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True) + + from .models import db + + db.init_app(app) + + login_manager = LoginManager() + login_manager.login_view = 'auth.login' + login_manager.init_app(app) + + + from .models import User + + @login_manager.user_loader + def load_user(user_id): + # since the user_id is just the primary key of our user table, use it in the query for the user + return User.query.get(int(user_id)) + + from . import models + + with app.app_context(): + db.create_all() + + app.register_blueprint(paginas.bp) + app.register_blueprint(auth.bp) + + print(f"Current Environment: {os.getenv('ENVIRONMENT')}") + print(f"Using Database: {app.config.get('DATABASE')}") + print(f"Directorio de uploads: {app.config.get('UPLOAD_FOLDER')}") + print(f"instance: {app.instance_path}") + print(f"Saludo: {os.getenv('SALUDO_DEMO')}") + + return app + diff --git a/RecetasPy/old/auth.py b/RecetasPy/old/auth.py new file mode 100644 index 0000000..778691c --- /dev/null +++ b/RecetasPy/old/auth.py @@ -0,0 +1,82 @@ +from flask import Blueprint, render_template, redirect, url_for, request, flash, current_app +from werkzeug.security import generate_password_hash, check_password_hash +from werkzeug.utils import secure_filename +from flask_login import login_user, logout_user, login_required +from .models import User +import os + +from . import db + +bp = Blueprint('auth', __name__) + +@bp.route('/login') +def login(): + return render_template('login.html') + + +@bp.route('/login', methods=['POST']) +def login_post(): + email = request.form['email'] + password = request.form['password'] + remember = True if request.form.get('remember') else False + + user = User.query.filter_by(email=email).first() + + # check if the user actually exists + # take the user-supplied password, hash it, and compare it to the hashed password in the database + if not user or not check_password_hash(user.password, password): + flash('Por favor, comprueba los datos de registro y vuelve a intentarlo.') + return redirect(url_for('auth.login')) # if the user doesn't exist or password is wrong, reload the page + + # if the above check passes, then we know the user has the right credentials + login_user(user, remember=remember) + + return redirect(url_for('paginas.index')) + +@bp.route('/signup') +def signup(): + return render_template('signup.html') + +@bp.route('/signup', methods=['POST']) +def signup_post(): + username = request.form['username'] + email = request.form['email'] + password = request.form['password'] + confirm_password = request.form['confirm_password'] + photo = request.files['fotoperfil'] + + if password != confirm_password: + flash('Passwords do not match.') + return redirect(url_for('auth.signup')) + + user = User.query.filter_by(email=email).first() # if this returns a user, then the user already exists in database + + if user: # if a user is found, we want to redirect back to signup page so user can try again + flash('Ese usuario ya existe') + return redirect(url_for('auth.signup')) + + if photo: + photo_filename = secure_filename(photo.filename) + photo.save(os.path.join(current_app.config['UPLOAD_FOLDER'], photo_filename)) + else: + photo_filename = "" + + # create a new user with the form data. Hash the password so the plaintext version isn't saved. + new_user = User(email=email, username=username, password=generate_password_hash(password, method='pbkdf2:sha256'), photo=photo_filename) + + # add the new user to the database +# try: + db.session.add(new_user) + db.session.commit() + flash('Registration successful.') + return redirect(url_for('auth.login')) + # except: + # flash('Email address already exists.') + # return redirect(url_for('auth.signup')) + + +@bp.route('/logout') +@login_required +def logout(): + logout_user() + return redirect(url_for('paginas.index')) diff --git a/RecetasPy/old/models.py b/RecetasPy/old/models.py new file mode 100644 index 0000000..470f62a --- /dev/null +++ b/RecetasPy/old/models.py @@ -0,0 +1,35 @@ +from flask_sqlalchemy import SQLAlchemy +from flask_login import UserMixin + +from . import db + +class User(UserMixin, db.Model): + id = db.Column(db.Integer, primary_key=True) + username = db.Column(db.String(150), unique=True, nullable=False) + email = db.Column(db.String(150), unique=True, nullable=False) + password = db.Column(db.String(150), nullable=False) + recipes = db.relationship('Recipe', backref='author', lazy=True) + photo = db.Column(db.String(150), nullable=False) + + +class Recipe(db.Model): + id = db.Column(db.Integer, primary_key=True) + title = db.Column(db.String(150), nullable=False) + description = db.Column(db.Text, nullable=False) + user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) + ingredients = db.relationship('Ingredient', backref='recipe', lazy=True, order_by='Ingredient.order') + instructions = db.relationship('Instruction', backref='recipe', lazy=True, order_by='Instruction.order') + +class Ingredient(db.Model): + id = db.Column(db.Integer, primary_key=True) + name = db.Column(db.String(100), nullable=False) + quantity = db.Column(db.String(50), nullable=False) + order = db.Column(db.Integer, nullable=False) + recipe_id = db.Column(db.Integer, db.ForeignKey('recipe.id'), nullable=False) + +class Instruction(db.Model): + id = db.Column(db.Integer, primary_key=True) + step = db.Column(db.Integer, nullable=False) + description = db.Column(db.Text, nullable=False) + order = db.Column(db.Integer, nullable=False) + recipe_id = db.Column(db.Integer, db.ForeignKey('recipe.id'), nullable=False) \ No newline at end of file diff --git a/RecetasPy/old/paginas.py b/RecetasPy/old/paginas.py new file mode 100644 index 0000000..80a924d --- /dev/null +++ b/RecetasPy/old/paginas.py @@ -0,0 +1,87 @@ +from flask import Blueprint, render_template, request, redirect, url_for, current_app, send_from_directory,flash +from werkzeug.utils import secure_filename +from flask_login import login_user, logout_user, login_required, current_user + +import os + +from .models import db, Recipe, Ingredient, Instruction + +bp = Blueprint("paginas", __name__) + +@bp.route('/') +def index(): + recipes = Recipe.query.all() + return render_template('recetas.html', recipes=recipes) + +@bp.route('/recipe/') +def recipe(recipe_id): + recipe = Recipe.query.get_or_404(recipe_id) + return render_template('recetas.html', recipe=recipe) + +@bp.route('/new_recipe', methods=['GET', 'POST']) +@login_required +def new_recipe(): + if request.method == 'POST': + title = request.form['title'] + description = request.form['description'] + ingredients = request.form.getlist('ingredient') + quantities = request.form.getlist('quantity') + step_descriptions = request.form.getlist('step_description') + + recipe = Recipe(title=title, description=description, author=current_user) + + for i, (ingredient, quantity) in enumerate(zip(ingredients, quantities), start=1): + recipe.ingredients.append(Ingredient(name=ingredient, quantity=quantity, order=i)) + + for i, description in enumerate(step_descriptions, start=1): + recipe.instructions.append(Instruction(step=i, description=description, order=i)) + + db.session.add(recipe) + db.session.commit() + flash('Recipe created successfully!', 'success') + + + return redirect(url_for('paginas.index')) + + return render_template('nueva_receta.html') + +@bp.route('/account') +@login_required +def account(): + return render_template('account.html') + +@bp.route('/settings') +@login_required +def settings(): + return render_template('settings.html') + +@bp.route('/reset-password') +def resetpassword(): + return render_template('reset-password.html') + +@bp.route('/404') +def cuatrocerocuatro(): + return render_template('404.html') + +@bp.route('/charts') +@login_required +def charts(): + return render_template('charts.html') + +@bp.route('/help') +def help(): + return render_template('help.html') + +@bp.route('/uploads/') +def uploaded_file(filename): + return send_from_directory(current_app.config['UPLOAD_FOLDER'], filename) + +@bp.route('/notifications') +def notifications(): + return render_template('notifications.html') +@bp.route('/docs') +def docs(): + return render_template('docs.html') +@bp.route('/orders') +def orders(): + return render_template('orders.html') \ No newline at end of file diff --git a/RecetasPy/servicios/recetaspy/templates/.gitignore b/RecetasPy/old/templates/.gitignore similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/.gitignore rename to RecetasPy/old/templates/.gitignore diff --git a/RecetasPy/old/templates/404.html b/RecetasPy/old/templates/404.html new file mode 100644 index 0000000..0d8a9d3 --- /dev/null +++ b/RecetasPy/old/templates/404.html @@ -0,0 +1,14 @@ +{% extends 'base.html' %} + +{% block content %} + +
+

404
Page Not Found

+
+ Sorry, we can't find the page you're looking for. +
+ Go to home page +
+ +{% endblock %} + diff --git a/RecetasPy/servicios/recetaspy/templates/README.md b/RecetasPy/old/templates/README.md similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/README.md rename to RecetasPy/old/templates/README.md diff --git a/RecetasPy/old/templates/_branding.html b/RecetasPy/old/templates/_branding.html new file mode 100644 index 0000000..ce9ef36 --- /dev/null +++ b/RecetasPy/old/templates/_branding.html @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/RecetasPy/old/templates/_cabecera.html b/RecetasPy/old/templates/_cabecera.html new file mode 100644 index 0000000..fc16dd2 --- /dev/null +++ b/RecetasPy/old/templates/_cabecera.html @@ -0,0 +1,299 @@ +
+
+
+
+
+ + +
+ +
+ + +
+ + + + + +
+
+
+
+
+
+
+
+ × + + {% include("_branding.html") %} + + + + +
+
+
diff --git a/RecetasPy/old/templates/_footer.html b/RecetasPy/old/templates/_footer.html new file mode 100644 index 0000000..eed4e66 --- /dev/null +++ b/RecetasPy/old/templates/_footer.html @@ -0,0 +1,10 @@ + + +
+ (c) Celestino Rey +
+ \ No newline at end of file diff --git a/RecetasPy/old/templates/_head.html b/RecetasPy/old/templates/_head.html new file mode 100644 index 0000000..32a30ce --- /dev/null +++ b/RecetasPy/old/templates/_head.html @@ -0,0 +1,21 @@ + + + + Portal - Bootstrap 5 Admin Dashboard Template For Developers + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RecetasPy/old/templates/account.html b/RecetasPy/old/templates/account.html new file mode 100644 index 0000000..21d4c40 --- /dev/null +++ b/RecetasPy/old/templates/account.html @@ -0,0 +1,275 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +

My Account

+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+{% endblock %} \ No newline at end of file diff --git a/RecetasPy/old/templates/base.html b/RecetasPy/old/templates/base.html new file mode 100644 index 0000000..e4df920 --- /dev/null +++ b/RecetasPy/old/templates/base.html @@ -0,0 +1,34 @@ +{% include("_head.html") %} + + + {% include("_cabecera.html") %} + +
+ +
+ {% block content %}{% endblock %} +
+ + {% include("_footer.html") %} + + +
+ + + + + + + + + + + + + + + + + + + diff --git a/RecetasPy/servicios/recetaspy/templates/charts.html b/RecetasPy/old/templates/charts.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/charts.html rename to RecetasPy/old/templates/charts.html diff --git a/RecetasPy/servicios/recetaspy/templates/docs.html b/RecetasPy/old/templates/docs.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/docs.html rename to RecetasPy/old/templates/docs.html diff --git a/RecetasPy/servicios/recetaspy/templates/favicon.ico b/RecetasPy/old/templates/favicon.ico similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/favicon.ico rename to RecetasPy/old/templates/favicon.ico diff --git a/RecetasPy/old/templates/help.html b/RecetasPy/old/templates/help.html new file mode 100644 index 0000000..26728b7 --- /dev/null +++ b/RecetasPy/old/templates/help.html @@ -0,0 +1,423 @@ +{% extends 'base.html' %} + +{% block content %} + +
+ +

Help Center

+
+
+

Product

+
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ + +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+
+
+
+
+

Account

+
+
+
+
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ + +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+
+
+
+
+

Payment

+
+
+
+
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+

+ +

+
+
+ Anim pariatur cliche reprehenderit, enim eiusmod high life + accusamus terry richardson ad squid. 3 wolf moon officia + aute, non cupidatat skateboard dolor brunch. Food truck + quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, + sunt aliqua put a bird on it squid single-origin coffee + nulla assumenda shoreditch et. Nihil anim keffiyeh + helvetica, craft beer labore wes anderson cred nesciunt + sapiente ea proident. Ad vegan excepteur butcher vice lomo. + Leggings occaecat craft beer farm-to-table, raw denim + aesthetic synth nesciunt you probably haven't heard of them + accusamus labore sustainable VHS. +
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+ + + + + + +
+ +
+
+

Need more help?

+
+
+
+
+ +
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet eros vel diam semper mollis.
+ +
+ +
+
+
+
+
+
+
+
+ + + +
+ +
+
+

Want to upgrade?

+
+
+
+
+ +
Quisque non nisi odio. Proin at viverra enim. Ut vitae ligula neque. Praesent id ligula ut sem suscipit eleifend id vel ex.
+
    +
  • + + + + Phasellus varius vel risus vel aliquam. +
  • +
  • + + + + Maecenas varius nulla. +
  • +
  • + + + + Lorem ipsum dolor sit amet. +
  • + +
+
+ +
+
+
+ +
+ +{% endblock %} diff --git a/RecetasPy/old/templates/index.html b/RecetasPy/old/templates/index.html new file mode 100644 index 0000000..638bc95 --- /dev/null +++ b/RecetasPy/old/templates/index.html @@ -0,0 +1,386 @@ +{% extends 'base.html' %} + +{% block content %} + +
+ +

Overview

+ + + +
+
+
+
+

Recetas

+
+ +
+
+ +
+
+ +
+
+
+

Expenses

+
$2,250
+
+ + + 5%
+
+ +
+
+
+
+
+

Projects

+
23
+
+ Open
+
+ +
+
+
+
+
+

Invoices

+
6
+
New
+
+ +
+
+
+
+
+
+
+
+
+

Line Chart Example

+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+

Bar Chart Example

+
+
+ +
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+

Progress

+
+
+ +
+
+
+
+
+
+
+
Project lorem ipsum dolor sit amet
+
+
+
+
+
+ + + +
+
+ +
+ + +
+
+
+
Project duis aliquam et lacus quis ornare
+
+
+
+
+
+ + + +
+
+ +
+ +
+
+
+
Project sed tempus felis id lacus pulvinar
+
+
+
+
+
+ + + +
+
+ +
+ +
+
+
+
Project sed tempus felis id lacus pulvinar
+
+
+
+
+
+ + + +
+
+ +
+ +
+
+
+
+
+
+
+
+

Stats List

+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SourceViewsToday
google.com110 + + + + 30% +
getbootstrap.com6723%
w3schools.com56 + + + + 20% +
javascript.com 24-
github.com 1715%
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+ +
+
+

Invoices

+
+
+
+
+ +
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet eros vel diam semper mollis.
+
+ +
+
+
+
+
+
+
+
+ + + + +
+ +
+
+

Apps

+
+
+
+
+ +
Pellentesque varius, elit vel volutpat sollicitudin, lacus quam efficitur augue
+
+ +
+
+
+
+
+
+
+
+ + + + +
+ +
+
+

Tools

+
+
+
+
+ +
Sed maximus, libero ac pharetra elementum, turpis nisi molestie neque, et tincidunt velit turpis non enim.
+
+ +
+
+
+ +
+ +{% endblock %} diff --git a/RecetasPy/old/templates/login.html b/RecetasPy/old/templates/login.html new file mode 100644 index 0000000..739dbab --- /dev/null +++ b/RecetasPy/old/templates/login.html @@ -0,0 +1,83 @@ +{% include("_head.html") %} + + +
+
+
+
+ {% include("_branding.html") %} +

Log in to Portal

+
+ {% with messages = get_flashed_messages() %} + {% if messages %} +
+ {{ messages[0] }} +
+ {% endif %} + {% endwith %} + + +
No Account? Sign up here.
+
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
Explore Portal Admin Template
+
Portal is a free Bootstrap 5 admin dashboard template. You can download and view the template license here.
+
+
+
+
+ +
+ + + + + diff --git a/RecetasPy/servicios/recetaspy/templates/notifications.html b/RecetasPy/old/templates/notifications.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/notifications.html rename to RecetasPy/old/templates/notifications.html diff --git a/RecetasPy/servicios/recetaspy/templates/nueva_receta.html b/RecetasPy/old/templates/nueva_receta.html similarity index 53% rename from RecetasPy/servicios/recetaspy/templates/nueva_receta.html rename to RecetasPy/old/templates/nueva_receta.html index 7b564e2..585335d 100644 --- a/RecetasPy/servicios/recetaspy/templates/nueva_receta.html +++ b/RecetasPy/old/templates/nueva_receta.html @@ -20,7 +20,6 @@

Instructions

-
@@ -29,20 +28,20 @@ + function addIngredient() { + var ingredientsDiv = document.getElementById('ingredients'); + var newIngredientDiv = document.createElement('div'); + newIngredientDiv.className = 'ingredient'; + newIngredientDiv.innerHTML = ' '; + ingredientsDiv.appendChild(newIngredientDiv); + } + + function addInstruction() { + var instructionsDiv = document.getElementById('instructions'); + var newInstructionDiv = document.createElement('div'); + newInstructionDiv.className = 'instruction'; + newInstructionDiv.innerHTML = ''; + instructionsDiv.appendChild(newInstructionDiv); + } + {% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/orders.html b/RecetasPy/old/templates/orders.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/orders.html rename to RecetasPy/old/templates/orders.html diff --git a/RecetasPy/old/templates/recetas.html b/RecetasPy/old/templates/recetas.html new file mode 100644 index 0000000..3afeac8 --- /dev/null +++ b/RecetasPy/old/templates/recetas.html @@ -0,0 +1,48 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +
+
+

Recetas

+
+
+ + + + + +
+
+
+
+
+

{{ recipe.title }}

+

{{ recipe.description }}

+

Ingredients

+
    + {% for ingredient in recipe.ingredients %} +
  • {{ ingredient.quantity }} {{ ingredient.name }}
  • + {% endfor %} +
+

Instructions

+
    + {% for instruction in recipe.instructions %} +
  1. {{ instruction.description }}
  2. + {% endfor %} +
+
+
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/RecetasPy/servicios/recetaspy/templates/reset-password.html b/RecetasPy/old/templates/reset-password.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/reset-password.html rename to RecetasPy/old/templates/reset-password.html diff --git a/RecetasPy/servicios/recetaspy/templates/settings.html b/RecetasPy/old/templates/settings.html similarity index 100% rename from RecetasPy/servicios/recetaspy/templates/settings.html rename to RecetasPy/old/templates/settings.html diff --git a/RecetasPy/old/templates/signup.html b/RecetasPy/old/templates/signup.html new file mode 100644 index 0000000..ed53f9a --- /dev/null +++ b/RecetasPy/old/templates/signup.html @@ -0,0 +1,122 @@ +{% include("_head.html") %} + + +
+
+
+
+ {% include("_branding.html") %} +

Sign up to Portal

+ +
+ + {% with messages = get_flashed_messages() %} + {% if messages %} +
+ {{ messages[0] }}. Go to login page. +
+ {% endif %} + {% endwith %} + + + +
Already have an account? Log in
+
+ + + +
+ + +
+
+
+
+
+
+
+
+
+
+
Explore Portal Admin Template
+
Portal is a free Bootstrap 5 admin dashboard template. You can download and view the template license here.
+
+
+
+
+ +
+ + + + + diff --git a/RecetasPy/servicios/instance/recipes.db b/RecetasPy/servicios/instance/recipes.db deleted file mode 100644 index 6b81b0b..0000000 Binary files a/RecetasPy/servicios/instance/recipes.db and /dev/null differ diff --git a/RecetasPy/servicios/instance/reymotapy.db b/RecetasPy/servicios/instance/reymotapy.db deleted file mode 100644 index 47f9b06..0000000 Binary files a/RecetasPy/servicios/instance/reymotapy.db and /dev/null differ diff --git a/RecetasPy/servicios/instance/uploads/nebraska.jpg b/RecetasPy/servicios/instance/uploads/nebraska.jpg deleted file mode 100644 index eebc1a5..0000000 Binary files a/RecetasPy/servicios/instance/uploads/nebraska.jpg and /dev/null differ diff --git a/RecetasPy/servicios/recetaspy/__init__.py b/RecetasPy/servicios/recetaspy/__init__.py index 0c3c9b8..b6b864d 100644 --- a/RecetasPy/servicios/recetaspy/__init__.py +++ b/RecetasPy/servicios/recetaspy/__init__.py @@ -6,21 +6,18 @@ from flask_login import LoginManager, UserMixin, login_user, login_required, log # init SQLAlchemy so we can use it later in our models db = SQLAlchemy() -from recetaspy import paginas, auth +from recetas import paginas, auth def create_app(): app = Flask(__name__) app.config.from_prefixed_env() app.config['SECRET_KEY'] = 'secret-key-goes-here' - app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///recipes.db' + app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///recetas.db' app.config['UPLOAD_FOLDER'] = os.path.join(app.instance_path, 'uploads') app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024 # 16 MB máximo - # Asegúrate de que el directorio de carga existe - os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True) - from .models import db db.init_app(app) @@ -42,14 +39,16 @@ def create_app(): with app.app_context(): db.create_all() +# basededatos.init_app(app) + app.register_blueprint(paginas.bp) app.register_blueprint(auth.bp) + print(f"Current Environment: {os.getenv('ENVIRONMENT')}") print(f"Using Database: {app.config.get('DATABASE')}") print(f"Directorio de uploads: {app.config.get('UPLOAD_FOLDER')}") print(f"instance: {app.instance_path}") - print(f"Saludo: {os.getenv('SALUDO_DEMO')}") return app diff --git a/RecetasPy/servicios/recetaspy/auth.py b/RecetasPy/servicios/recetaspy/auth.py index 778691c..e24dbbb 100644 --- a/RecetasPy/servicios/recetaspy/auth.py +++ b/RecetasPy/servicios/recetaspy/auth.py @@ -16,11 +16,11 @@ def login(): @bp.route('/login', methods=['POST']) def login_post(): - email = request.form['email'] - password = request.form['password'] + username = request.form.get('username') + password = request.form.get('password') remember = True if request.form.get('remember') else False - user = User.query.filter_by(email=email).first() + user = User.query.filter_by(username=username).first() # check if the user actually exists # take the user-supplied password, hash it, and compare it to the hashed password in the database @@ -40,7 +40,6 @@ def signup(): @bp.route('/signup', methods=['POST']) def signup_post(): username = request.form['username'] - email = request.form['email'] password = request.form['password'] confirm_password = request.form['confirm_password'] photo = request.files['fotoperfil'] @@ -49,31 +48,28 @@ def signup_post(): flash('Passwords do not match.') return redirect(url_for('auth.signup')) - user = User.query.filter_by(email=email).first() # if this returns a user, then the user already exists in database + user = User.query.filter_by(username=username).first() # if this returns a user, then the user already exists in database if user: # if a user is found, we want to redirect back to signup page so user can try again flash('Ese usuario ya existe') return redirect(url_for('auth.signup')) - + if photo: photo_filename = secure_filename(photo.filename) + print("Foto: ", photo_filename) photo.save(os.path.join(current_app.config['UPLOAD_FOLDER'], photo_filename)) else: + print("No hay foto") photo_filename = "" - # create a new user with the form data. Hash the password so the plaintext version isn't saved. - new_user = User(email=email, username=username, password=generate_password_hash(password, method='pbkdf2:sha256'), photo=photo_filename) + # create a new user with the form data. Hash the password so the plaintext version isn't saved. + new_user = User(username=username, password=generate_password_hash(password, method='pbkdf2:sha256'), photo=photo_filename) # add the new user to the database -# try: db.session.add(new_user) db.session.commit() - flash('Registration successful.') + return redirect(url_for('auth.login')) - # except: - # flash('Email address already exists.') - # return redirect(url_for('auth.signup')) - @bp.route('/logout') @login_required diff --git a/RecetasPy/servicios/recetaspy/models.py b/RecetasPy/servicios/recetaspy/models.py index 8128c48..470f62a 100644 --- a/RecetasPy/servicios/recetaspy/models.py +++ b/RecetasPy/servicios/recetaspy/models.py @@ -17,17 +17,19 @@ class Recipe(db.Model): title = db.Column(db.String(150), nullable=False) description = db.Column(db.Text, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) - ingredients = db.relationship('Ingredient', backref='recipe', lazy=True) - instructions = db.relationship('Instruction', backref='recipe', lazy=True) + ingredients = db.relationship('Ingredient', backref='recipe', lazy=True, order_by='Ingredient.order') + instructions = db.relationship('Instruction', backref='recipe', lazy=True, order_by='Instruction.order') class Ingredient(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100), nullable=False) quantity = db.Column(db.String(50), nullable=False) + order = db.Column(db.Integer, nullable=False) recipe_id = db.Column(db.Integer, db.ForeignKey('recipe.id'), nullable=False) class Instruction(db.Model): id = db.Column(db.Integer, primary_key=True) step = db.Column(db.Integer, nullable=False) description = db.Column(db.Text, nullable=False) - recipe_id = db.Column(db.Integer, db.ForeignKey('recipe.id'), nullable=False) + order = db.Column(db.Integer, nullable=False) + recipe_id = db.Column(db.Integer, db.ForeignKey('recipe.id'), nullable=False) \ No newline at end of file diff --git a/RecetasPy/servicios/recetaspy/paginas.py b/RecetasPy/servicios/recetaspy/paginas.py index a33467c..9f37626 100644 --- a/RecetasPy/servicios/recetaspy/paginas.py +++ b/RecetasPy/servicios/recetaspy/paginas.py @@ -1,86 +1,127 @@ -from flask import Blueprint, render_template, request, redirect, url_for, current_app, send_from_directory,flash +from flask import Blueprint, render_template, request, redirect, url_for, current_app, send_from_directory, flash from werkzeug.utils import secure_filename from flask_login import login_user, logout_user, login_required, current_user import os -from .models import db, Recipe, Ingredient, Instruction +from .models import db, receta, Ingredient, Instruction bp = Blueprint("paginas", __name__) @bp.route('/') def index(): - recipes = Recipe.query.all() - return render_template('recetas.html', recipes=recipes) -@bp.route('/recipe/') -def recipe(recipe_id): - recipe = Recipe.query.get_or_404(recipe_id) - return render_template('recetas.html', recipe=recipe) + return render_template('index.html') -@bp.route('/new_recipe', methods=['GET', 'POST']) +@bp.route('/recetas') +def recetas(): + recetas = receta.query.all() + return render_template('recetas.html', recetas=recetas) + +@bp.route('/404') +def cuatrocerocuatro(): + return render_template('404.html') + +@bp.route('/help') +def help(): + return render_template('help.html') + +@bp.route('/account') +@login_required +def account(): + return render_template('account.html') + +@bp.route('/receta/') +def receta(receta_id): + receta = receta.query.get_or_404(receta_id) + return render_template('recetas.html', receta=receta) + +@bp.route('/anade_receta', methods=['GET', 'POST']) @login_required -def new_recipe(): +def anade_receta(): if request.method == 'POST': title = request.form['title'] description = request.form['description'] ingredients = request.form.getlist('ingredient') quantities = request.form.getlist('quantity') - steps = request.form.getlist('step') step_descriptions = request.form.getlist('step_description') - recipe = Recipe(title=title, description=description, author=current_user) + receta = receta(title=title, description=description, author=current_user) - for ingredient, quantity in zip(ingredients, quantities): - recipe.ingredients.append(Ingredient(name=ingredient, quantity=quantity)) + for i, (ingredient, quantity) in enumerate(zip(ingredients, quantities), start=1): + receta.ingredients.append(Ingredient(name=ingredient, quantity=quantity, order=i)) - for step, description in zip(steps, step_descriptions): - recipe.instructions.append(Instruction(step=step, description=description)) + for i, description in enumerate(step_descriptions, start=1): + receta.instructions.append(Instruction(step=i, description=description, order=i)) - db.session.add(recipe) + db.session.add(receta) db.session.commit() - flash('Recipe created successfully!', 'success') + flash('receta created successfully!', 'success') + + return redirect(url_for('paginas.index')) return render_template('nueva_receta.html') -@bp.route('/account') +@bp.route('/add_album', methods=['GET', 'POST']) @login_required -def account(): - return render_template('account.html') - -@bp.route('/settings') -@login_required -def settings(): - return render_template('settings.html') - -@bp.route('/reset-password') -def resetpassword(): - return render_template('reset-password.html') - -@bp.route('/404') -def cuatrocerocuatro(): - return render_template('404.html') +def add_album(): + if request.method == 'POST': -@bp.route('/charts') -@login_required -def charts(): - return render_template('charts.html') + name = request.form['name'] + artist = request.form['artist'] + year = request.form['year'] + + # Verificar que el campo 'cover_image' está en request.files + if 'coverimage' not in request.files: + return "No file part in the request", 400 + + cover_image = request.files['coverimage'] + + # Verificar que se ha seleccionado un archivo + + if cover_image.filename == '': + return "No selected file", 400 + + if cover_image: + image_filename = secure_filename(cover_image.filename) + cover_image.save(os.path.join(current_app.config['UPLOAD_FOLDER'], image_filename)) + else: + image_filename = None + + new_album = Album(name=name, artist=artist, year=year, cover_image=image_filename) + db.session.add(new_album) + db.session.commit() + + return redirect(url_for('paginas.index')) + + return render_template('add_album.html') -@bp.route('/help') -def help(): - return render_template('help.html') +@bp.route('/album/') +def album(album_id): + album = Album.query.get_or_404(album_id) + songs = Song.query.filter_by(album_id=album_id).all() + return render_template('album.html', album=album, songs=songs) @bp.route('/uploads/') def uploaded_file(filename): return send_from_directory(current_app.config['UPLOAD_FOLDER'], filename) -@bp.route('/notifications') -def notifications(): - return render_template('notifications.html') -@bp.route('/docs') -def docs(): - return render_template('docs.html') -@bp.route('/orders') -def orders(): - return render_template('orders.html') \ No newline at end of file +@bp.route('/buscareceta') +def buscareceta(): + query = request.args.get('query', '') + if query: + songs = Song.query.filter(Song.title.contains(query)).all() + else: + songs = [] + return render_template('buscareceta.html', query=query, songs=songs) + + +@bp.route('/searchalbum') +def searchalbum(): + query = request.args.get('query', '') + if query: + albumes = Album.query.filter(Album.name.contains(query)).all() + else: + albumes = [] + return render_template('searchalbum.html', query=query, albumes=albumes) diff --git a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.json b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.json index 0f3abff..924fae9 100644 --- a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.json +++ b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.json @@ -68279,7 +68279,7 @@ "ligatures": [], "search": { "terms": [ - "lyrics", + "recetas", "melody", "music", "musical note", diff --git a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.yml b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.yml index 4c4056f..a1193c2 100644 --- a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.yml +++ b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icon-families.yml @@ -31314,7 +31314,7 @@ music: label: Music search: terms: - - lyrics + - recetas - melody - music - musical note diff --git a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.json b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.json index 68983b2..a72d017 100644 --- a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.json +++ b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.json @@ -56347,7 +56347,7 @@ "ligatures": [], "search": { "terms": [ - "lyrics", + "recetas", "melody", "music", "musical note", diff --git a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.yml b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.yml index a989181..78751ae 100644 --- a/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.yml +++ b/RecetasPy/servicios/recetaspy/static/plugins/fontawesome/metadata/icons.yml @@ -25341,7 +25341,7 @@ music: label: Music search: terms: - - lyrics + - recetas - melody - music - musical note diff --git a/RecetasPy/servicios/recetaspy/templates/_branding.html b/RecetasPy/servicios/recetaspy/templates/_branding.html index ce9ef36..809c981 100644 --- a/RecetasPy/servicios/recetaspy/templates/_branding.html +++ b/RecetasPy/servicios/recetaspy/templates/_branding.html @@ -1,4 +1,4 @@ \ No newline at end of file diff --git a/RecetasPy/servicios/recetaspy/templates/_cabecera.html b/RecetasPy/servicios/recetaspy/templates/_cabecera.html index fc16dd2..2b52255 100644 --- a/RecetasPy/servicios/recetaspy/templates/_cabecera.html +++ b/RecetasPy/servicios/recetaspy/templates/_cabecera.html @@ -9,124 +9,18 @@ Menu -
- -
- +
- - + {% endif %} - - - - - +
diff --git a/RecetasPy/servicios/recetaspy/templates/_footer.html b/RecetasPy/servicios/recetaspy/templates/_footer.html index eed4e66..9ef50a9 100644 --- a/RecetasPy/servicios/recetaspy/templates/_footer.html +++ b/RecetasPy/servicios/recetaspy/templates/_footer.html @@ -1,7 +1,7 @@
diff --git a/RecetasPy/servicios/recetaspy/templates/_head.html b/RecetasPy/servicios/recetaspy/templates/_head.html index 32a30ce..2507375 100644 --- a/RecetasPy/servicios/recetaspy/templates/_head.html +++ b/RecetasPy/servicios/recetaspy/templates/_head.html @@ -1,7 +1,7 @@ - Portal - Bootstrap 5 Admin Dashboard Template For Developers + Recetas - Recetas ricas y sanas diff --git a/RecetasPy/servicios/recetaspy/templates/_navegacion.html b/RecetasPy/servicios/recetaspy/templates/_navegacion.html new file mode 100644 index 0000000..73e703f --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/_navegacion.html @@ -0,0 +1,78 @@ + diff --git a/RecetasPy/servicios/recetaspy/templates/add_album.html b/RecetasPy/servicios/recetaspy/templates/add_album.html new file mode 100644 index 0000000..468c096 --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/add_album.html @@ -0,0 +1,36 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +

Añadir nuevo Álbum

+
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+
+
+{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/album.html b/RecetasPy/servicios/recetaspy/templates/album.html new file mode 100644 index 0000000..ba74908 --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/album.html @@ -0,0 +1,54 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+ {% if album.cover_image %} +

{{ album.name }}

+ {% else %} +

No hay imágen disponible

+ {% endif %} +
+
+

{{ album.name }}

+ +
    +
  • {{ album.artist }}
  • +
  • |
  • +
  • {{ album.year }}
  • +
+
+
+
+
+ + {% if songs %} + + + + + + + + + + {% for song in songs %} + + + + + + {% endfor %} + +
PistaTítuloAutor
{{ song.pista }}{{ song.title }}{{ song.author }}
+ {% else %} +

No songs found matching your query.

+ {% endif %} +
+
+ Volver al inicio +
+{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/albumes.html b/RecetasPy/servicios/recetaspy/templates/albumes.html new file mode 100644 index 0000000..70e0ec5 --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/albumes.html @@ -0,0 +1,91 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +
+
+

Álbumes

+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+ + + + + +
+
+
+
+
+ + + + + + + + + + + + {% for album in albums %} + + + + + + + {% endfor %} + +
CoverNombreArtistaAño
+ {% if album.cover_image %} + {{ album.name }} + {% else %} + Sin imágen + {% endif %} + {{ album.name }}{{ album.artist }}{{ album.year }}
+
+
+
+ + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/RecetasPy/servicios/recetaspy/templates/anade_receta.html b/RecetasPy/servicios/recetaspy/templates/anade_receta.html new file mode 100644 index 0000000..1e7121d --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/anade_receta.html @@ -0,0 +1,78 @@ +{% extends 'base.html' %} + +{% block content %} +
+

Añadir nueva receta

+
+
+
+ + +
+ +
+ + +
+ +

Ingredients

+ +
+ + + +
+ +

Instructions

+ +
+ +
+ +
+ + +
+ + + +
+ +
+
+
+ + +
+{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/base.html b/RecetasPy/servicios/recetaspy/templates/base.html index e4df920..0827c91 100644 --- a/RecetasPy/servicios/recetaspy/templates/base.html +++ b/RecetasPy/servicios/recetaspy/templates/base.html @@ -8,10 +8,9 @@
{% block content %}{% endblock %}
- + {% include("_footer.html") %} -
@@ -28,7 +27,6 @@ - - + diff --git a/RecetasPy/servicios/recetaspy/templates/buscareceta.html b/RecetasPy/servicios/recetaspy/templates/buscareceta.html new file mode 100644 index 0000000..639de8f --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/buscareceta.html @@ -0,0 +1,22 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +

Search Results for "{{ query }}"

+ +{% if recetas %} + +{% else %} +

No recetas found matching your query.

+{% endif %} + +Back to Home +
+{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/index.html b/RecetasPy/servicios/recetaspy/templates/index.html index b718e5a..8af5368 100644 --- a/RecetasPy/servicios/recetaspy/templates/index.html +++ b/RecetasPy/servicios/recetaspy/templates/index.html @@ -4,382 +4,22 @@
-

Overview

+

Introducción

- -
-
-
-
-

Recetas

-
- -
-
- -
-
- -
-
-
-

Expenses

-
$2,250
-
- - - 5%
-
- -
-
-
-
-
-

Projects

-
23
-
- Open
-
- -
-
-
-
-
-

Invoices

-
6
-
New
-
- -
-
-
-
-
-
-
-
-
-

Line Chart Example

-
-
- -
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
-

Bar Chart Example

-
-
- -
-
-
-
-
- -
-
- -
-
-
-
- -
-
-
-
-
-
-
-

Progress

-
-
- -
-
-
-
-
-
-
-
Project lorem ipsum dolor sit amet
-
-
-
-
-
- - - -
-
- -
- - -
-
-
-
Project duis aliquam et lacus quis ornare
-
-
-
-
-
- - - -
-
- -
- -
-
-
-
Project sed tempus felis id lacus pulvinar
-
-
-
-
-
- - - -
-
- -
- -
-
-
-
Project sed tempus felis id lacus pulvinar
-
-
-
-
-
- - - -
-
- -
- -
-
-
-
-
-
-
-
-

Stats List

-
-
- -
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SourceViewsToday
google.com110 - - - - 30% -
getbootstrap.com6723%
w3schools.com56 - - - - 20% -
javascript.com 24-
github.com 1715%
-
-
-
-
-
-
-
-
-
-
-
-
- - - - -
- -
-
-

Invoices

-
-
-
-
- -
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet eros vel diam semper mollis.
-
- -
-
-
-
-
-
-
-
- - - - -
- -
-
-

Apps

-
-
-
-
- -
Pellentesque varius, elit vel volutpat sollicitudin, lacus quam efficitur augue
-
- -
-
-
-
-
-
-
-
- - - - -
- -
-
-

Tools

-
-
-
-
- -
Sed maximus, libero ac pharetra elementum, turpis nisi molestie neque, et tincidunt velit turpis non enim.
-
- -
-
-
diff --git a/RecetasPy/servicios/recetaspy/templates/login.html b/RecetasPy/servicios/recetaspy/templates/login.html index 739dbab..c41db02 100644 --- a/RecetasPy/servicios/recetaspy/templates/login.html +++ b/RecetasPy/servicios/recetaspy/templates/login.html @@ -6,19 +6,19 @@
{% include("_branding.html") %} -

Log in to Portal

+

Entrar en Recetas

{% with messages = get_flashed_messages() %} {% if messages %} -
+
{{ messages[0] }}
{% endif %} {% endwith %}
@@ -46,18 +39,13 @@
-
No Account? Sign up here.
+
¿No tienes cuenta? Registrate aquí.
- + {% include("_footer.html") %} +
@@ -67,10 +55,12 @@
+
diff --git a/RecetasPy/servicios/recetaspy/templates/receta.html b/RecetasPy/servicios/recetaspy/templates/receta.html new file mode 100644 index 0000000..55b47d6 --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/receta.html @@ -0,0 +1,42 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+
+ {% if album.cover_image %} +

{{ album.name }}

+ {% else %} +

No hay imágen disponible

+ {% endif %} +
+
+

{{ song.title }}

+ + + +
+
+
+
+
{{ song.recetas }}
+
+
+ + +{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/recetas.html b/RecetasPy/servicios/recetaspy/templates/recetas.html index 3afeac8..b4c6069 100644 --- a/RecetasPy/servicios/recetaspy/templates/recetas.html +++ b/RecetasPy/servicios/recetaspy/templates/recetas.html @@ -7,6 +7,22 @@

Recetas

+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
@@ -25,20 +41,24 @@
-

{{ recipe.title }}

-

{{ recipe.description }}

-

Ingredients

-
    - {% for ingredient in recipe.ingredients %} -
  • {{ ingredient.quantity }} {{ ingredient.name }}
  • - {% endfor %} -
-

Instructions

-
    - {% for instruction in recipe.instructions %} -
  1. {{ instruction.description }}
  2. - {% endfor %} -
+ + + + + + + + + + {% for song in songs %} + + + + + + {% endfor %} + +
TítuloAutorÁlbum
{{ song.title }}{{ song.author }}{{ song.album.name }}
diff --git a/RecetasPy/servicios/recetaspy/templates/searchalbum.html b/RecetasPy/servicios/recetaspy/templates/searchalbum.html new file mode 100644 index 0000000..46eeb61 --- /dev/null +++ b/RecetasPy/servicios/recetaspy/templates/searchalbum.html @@ -0,0 +1,22 @@ +{% extends 'base.html' %} + +{% block content %} +
+ +

Search Results for "{{ query }}"

+ +{% if albumes %} + +{% else %} +

No encontré álbumes que coincidan con tu criterio.

+{% endif %} + +Back to Home +
+{% endblock %} diff --git a/RecetasPy/servicios/recetaspy/templates/signup.html b/RecetasPy/servicios/recetaspy/templates/signup.html index ed53f9a..5c37195 100644 --- a/RecetasPy/servicios/recetaspy/templates/signup.html +++ b/RecetasPy/servicios/recetaspy/templates/signup.html @@ -6,7 +6,7 @@
{% include("_branding.html") %} -

Sign up to Portal

+

Registrarse en Recetas

@@ -18,39 +18,24 @@ {% endif %} {% endwith %} -
- + {% include("_footer.html") %} +
@@ -106,10 +76,12 @@
+