Jul 28 - Update the demo request button, and add demo registration page
This commit is contained in:
@@ -7,10 +7,14 @@ photos, or videos.
|
||||
Stack: **Flask + MySQL + Gunicorn + systemd + Nginx** on Ubuntu 24.04.
|
||||
|
||||
```
|
||||
app.py Flask app + Section/Topic models + routes
|
||||
config.py env-driven config (DB + demo contact URL)
|
||||
app.py Flask app + Section/Topic/DemoRequest models + routes
|
||||
admin.py /admin panel (content CRUD, audit log, demo inbox)
|
||||
mailer.py stdlib SMTP notifications (best-effort, threaded)
|
||||
config.py env-driven config (DB, demo booking, SMTP)
|
||||
schema.sql MySQL DDL + seed content (safe to re-run)
|
||||
add_demo.sql additive migration: demo_request table
|
||||
templates/index.html
|
||||
templates/demo.html booking form (+ demo_thanks.html)
|
||||
static/css/style.css
|
||||
static/js/main.js accordion expand/collapse
|
||||
gunicorn.conf.py
|
||||
@@ -257,3 +261,43 @@ This jail bans credential-guessing that reaches the password check (a real
|
||||
browser session with a valid CSRF token). Dumb bots that POST without a CSRF
|
||||
token get an HTTP 400 and never reach the check — they can't guess a password
|
||||
anyway. To also throttle those, add an nginx `limit_req` on `/admin/login`.
|
||||
|
||||
---
|
||||
|
||||
## Demo appointments
|
||||
|
||||
The **Request a demo** button at the bottom of the public page opens `/demo`, a
|
||||
booking form: name, company, email, phone, preferred date + time slot, and a
|
||||
message. Valid submissions are stored in `demo_request` and the owner is
|
||||
emailed; the customer gets a confirmation copy.
|
||||
|
||||
```bash
|
||||
sudo mysql < add_demo.sql # existing databases only; schema.sql has it too
|
||||
```
|
||||
|
||||
Then set in `.env` and restart (`sudo systemctl restart jqc-features`):
|
||||
|
||||
```
|
||||
DEMO_NOTIFY_EMAIL=info@ltservicesinc.com
|
||||
SMTP_HOST=smtp.yourprovider.com
|
||||
SMTP_PORT=587
|
||||
SMTP_USER=notifications@ltservicesinc.com
|
||||
SMTP_PASSWORD=...
|
||||
MAIL_FROM=notifications@ltservicesinc.com
|
||||
DEMO_TIMEZONE_LABEL=Eastern Time
|
||||
```
|
||||
|
||||
Bookable hours default to 08:00–16:30 in 30-minute slots, weekdays, up to 90
|
||||
days ahead (`DEMO_HOUR_START`, `DEMO_HOUR_END`, `DEMO_SLOT_MINUTES`,
|
||||
`DEMO_MAX_DAYS_AHEAD`). A slot already taken by a non-cancelled request can't be
|
||||
booked twice.
|
||||
|
||||
**Mail is best-effort:** it goes out on a background thread *after* the request
|
||||
is saved, and a failure is logged rather than shown to the visitor. With
|
||||
`SMTP_HOST` blank no mail is sent at all — requests still appear in the admin
|
||||
panel, so nothing is ever lost.
|
||||
|
||||
Manage them at **`/admin/demos`**: open requests first, filter by status
|
||||
(`new` / `scheduled` / `done` / `cancelled`), set a status or delete. The nav
|
||||
badge counts unhandled ones. Every action is written to the audit log under the
|
||||
`demo` type.
|
||||
|
||||
Reference in New Issue
Block a user