Initial Commit
This commit is contained in:
2
modules/quotes/__init__.py
Normal file
2
modules/quotes/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from flask import Blueprint
|
||||
quotes_bp = Blueprint("quotes", __name__, template_folder="templates")
|
||||
26
modules/quotes/routes.py
Normal file
26
modules/quotes/routes.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from flask import render_template, request, redirect, url_for, flash
|
||||
from . import quotes_bp
|
||||
from core.auth import require_perms
|
||||
|
||||
|
||||
@quotes_bp.get("/")
|
||||
def index():
|
||||
return render_template("quotes/index.html")
|
||||
|
||||
|
||||
@quotes_bp.post("/estimate")
|
||||
def estimate():
|
||||
name = request.form.get("name","")
|
||||
email = request.form.get("email","")
|
||||
need = request.form.get("need","not-sure")
|
||||
size = request.form.get("size","small")
|
||||
hours = {"simple":10,"pro":18,"custom":28}.get(need,8) * {"small":1,"medium":1.4,"large":2}.get(size,1)
|
||||
cost = round(hours*95,2)
|
||||
flash(f"Estimated {hours:.1f}h — ${cost}", "ok")
|
||||
return redirect(url_for("quotes.index"))
|
||||
|
||||
|
||||
@quotes_bp.get("/admin")
|
||||
@require_perms("quotes.admin")
|
||||
def admin():
|
||||
return render_template("quotes/admin.html")
|
||||
6
modules/quotes/templates/quotes/admin.html
Normal file
6
modules/quotes/templates/quotes/admin.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends 'core/base.html' %}
|
||||
{% block title %}Quotes Admin — Portal{% endblock %}
|
||||
{% block content %}
|
||||
<h1 class="text-2xl font-bold mb-4">Quotes Admin</h1>
|
||||
<p class="text-white/70">Wire your DB-backed list here later.</p>
|
||||
{% endblock %}
|
||||
24
modules/quotes/templates/quotes/index.html
Normal file
24
modules/quotes/templates/quotes/index.html
Normal file
@@ -0,0 +1,24 @@
|
||||
{% extends 'core/base.html' %}
|
||||
{% block title %}Quotes — Portal{% endblock %}
|
||||
{% block content %}
|
||||
<section class="max-w-3xl mx-auto">
|
||||
<div class="card glass p-6">
|
||||
<h1 class="text-2xl font-bold">Quick Estimate</h1>
|
||||
<form method="post" action="/quotes/estimate" class="mt-4 grid gap-3">
|
||||
<input name="name" placeholder="Your name" required>
|
||||
<input name="email" type="email" placeholder="Email" required>
|
||||
<select name="need">
|
||||
<option value="simple">Simple site</option>
|
||||
<option value="pro">Pro site</option>
|
||||
<option value="custom">Custom app</option>
|
||||
</select>
|
||||
<select name="size">
|
||||
<option value="small">Small</option>
|
||||
<option value="medium">Medium</option>
|
||||
<option value="large">Large</option>
|
||||
</select>
|
||||
<button class="btn bg-accent font-semibold">Estimate</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user