From 13f948273bc90301932415838d3eb4e663400ce6 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Thu, 18 May 2023 03:46:55 +0000 Subject: automatic import of python-flask-modals --- .gitignore | 1 + python-flask-modals.spec | 502 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 504 insertions(+) create mode 100644 python-flask-modals.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..18fec80 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Flask-Modals-0.5.1.tar.gz diff --git a/python-flask-modals.spec b/python-flask-modals.spec new file mode 100644 index 0000000..47d0fd2 --- /dev/null +++ b/python-flask-modals.spec @@ -0,0 +1,502 @@ +%global _empty_manifest_terminate_build 0 +Name: python-Flask-Modals +Version: 0.5.1 +Release: 1 +Summary: Use forms in Bootstrap modals with Flask. +License: MIT License +URL: https://github.com/deb17/flask-modals +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/29/74/6d930d8bc8b22e896114f40834a2163685e5f68b7751bf4861ccd1263008/Flask-Modals-0.5.1.tar.gz +BuildArch: noarch + +Requires: python3-Flask + +%description +## Modals for Flask + +Use forms in Bootstrap modals with Flask. + +### Description + +Plain forms can be boring. Using them in modals is possible, but requires +JavaScript. Normal form submission in modals is problematic. + +This Flask extension eases the process of using forms in Bootstrap modals. +Bootstrap versions 4 and 5 are supported. No JavaScript coding is required on +your part. You can code in pure Python - flashing messages and rendering +templates. + +### Installation + +```Shell +pip install Flask-Modals +``` + +### Setup + +1. Import the `Modal` class and instantiate it in your `app.py` file. + + ```Python + from flask_modals import Modal + + app = Flask(__name__) + modal = Modal(app) + ``` + You will also need a secret key in the app config (not shown). +
+2. Alternatively if you are using the application factory pattern: + + ```Python + from flask_modals import Modal + + modal = Modal() + + def create_app(): + app = Flask(__name__) + modal.init_app(app) + ``` +
+3. Include the following in the head tag of your base template. + + ```html + {{ modals() }} + ``` +
+4. Include the following in the modal body. + + ```html +