diff --git a/app/config.py b/app/config.py index 59d7a6f..40f6e1c 100644 --- a/app/config.py +++ b/app/config.py @@ -40,3 +40,6 @@ class Config: STANDARD_IMG_SIZE = tuple( map(int, os.getenv('STANDARD_IMG_SIZE', '300x200').split('x')) ) + + PLANT_CARDS_BASE_URL = "https://plant.cards" + ALLOW_REGISTRATION = False diff --git a/nip.zip b/nip.zip index 922fc06..44a807a 100644 Binary files a/nip.zip and b/nip.zip differ diff --git a/plugins/auth/routes.py b/plugins/auth/routes.py index fbed437..7502d08 100644 --- a/plugins/auth/routes.py +++ b/plugins/auth/routes.py @@ -1,4 +1,4 @@ -from flask import Blueprint, render_template, request, redirect, url_for, flash +from flask import Blueprint, render_template, request, redirect, url_for, flash, current_app from flask_login import login_user, logout_user, login_required from werkzeug.security import check_password_hash from app import db @@ -29,6 +29,10 @@ def logout(): @bp.route('/register', methods=['GET', 'POST']) def register(): + if not current_app.config.get('ALLOW_REGISTRATION', True): + flash('Registration is currently closed.', 'warning') + return redirect(url_for('auth.login')) + if request.method == 'POST': email = request.form['email'] password = request.form['password'] diff --git a/plugins/core_ui/templates/core_ui/base.html b/plugins/core_ui/templates/core_ui/base.html index b71f2f8..f4b691f 100644 --- a/plugins/core_ui/templates/core_ui/base.html +++ b/plugins/core_ui/templates/core_ui/base.html @@ -2,6 +2,8 @@
+ +- {{ plant.notes or "No description provided." }} -
+- Parent: - - {{ plant.mother_uuid }} - -
- {% endif %} +No images uploaded yet.
+ {% endif %} + + {% if current_user.id == plant.owner_id %} ++ + {{ c.uuid }} + +
+No images uploaded yet.
{% endfor %}