Phase 2: enhancements
This commit is contained in:
+3
-8
@@ -6,12 +6,6 @@ from flask_mail import Mail
|
|||||||
from config import config
|
from config import config
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import app
|
|
||||||
from app.routes import auth, dashboard, inspections, templates, reports, facilities
|
|
||||||
|
|
||||||
# Add to blueprint registration
|
|
||||||
app.register_blueprint(facilities.bp)
|
|
||||||
|
|
||||||
# Initialize extensions
|
# Initialize extensions
|
||||||
db = SQLAlchemy()
|
db = SQLAlchemy()
|
||||||
login_manager = LoginManager()
|
login_manager = LoginManager()
|
||||||
@@ -38,14 +32,15 @@ def create_app(config_name='default'):
|
|||||||
# Create upload directory if it doesn't exist
|
# Create upload directory if it doesn't exist
|
||||||
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
os.makedirs(app.config['UPLOAD_FOLDER'], exist_ok=True)
|
||||||
|
|
||||||
# Register blueprints
|
# Register blueprints (import here to avoid circular imports)
|
||||||
from app.routes import auth, dashboard, inspections, templates, reports
|
from app.routes import auth, dashboard, inspections, templates, reports, facilities
|
||||||
|
|
||||||
app.register_blueprint(auth.bp)
|
app.register_blueprint(auth.bp)
|
||||||
app.register_blueprint(dashboard.bp)
|
app.register_blueprint(dashboard.bp)
|
||||||
app.register_blueprint(inspections.bp)
|
app.register_blueprint(inspections.bp)
|
||||||
app.register_blueprint(templates.bp)
|
app.register_blueprint(templates.bp)
|
||||||
app.register_blueprint(reports.bp)
|
app.register_blueprint(reports.bp)
|
||||||
|
app.register_blueprint(facilities.bp)
|
||||||
|
|
||||||
# Create database tables
|
# Create database tables
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
from flask import Blueprint, render_template
|
from flask import Blueprint, render_template
|
||||||
from flask_login import login_required, current_user
|
from flask_login import login_required, current_user
|
||||||
|
from app import db # ADD THIS LINE
|
||||||
from app.models.inspection import Inspection, InspectionTemplate
|
from app.models.inspection import Inspection, InspectionTemplate
|
||||||
from app.models.facility import Facility
|
from app.models.facility import Facility
|
||||||
from app.models.issue import Issue
|
from app.models.issue import Issue
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Login - Janitorial QC{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="row justify-content-center mt-5">
|
||||||
|
<div class="col-md-5 col-lg-4">
|
||||||
|
<div class="card shadow-lg">
|
||||||
|
<div class="card-header bg-primary text-white text-center py-4">
|
||||||
|
<h3><i class="bi bi-clipboard-check-fill"></i> Janitorial QC</h3>
|
||||||
|
<p class="mb-0">Quality Control System</p>
|
||||||
|
</div>
|
||||||
|
<div class="card-body p-4">
|
||||||
|
<form method="POST" action="{{ url_for('auth.login') }}">
|
||||||
|
{{ form.hidden_tag() }}
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
{{ form.username.label(class="form-label") }}
|
||||||
|
{{ form.username(class="form-control form-control-lg", placeholder="Enter username") }}
|
||||||
|
{% if form.username.errors %}
|
||||||
|
<div class="text-danger small mt-1">
|
||||||
|
{% for error in form.username.errors %}{{ error }}{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-4">
|
||||||
|
{{ form.password.label(class="form-label") }}
|
||||||
|
{{ form.password(class="form-control form-control-lg", placeholder="Enter password") }}
|
||||||
|
{% if form.password.errors %}
|
||||||
|
<div class="text-danger small mt-1">
|
||||||
|
{% for error in form.password.errors %}{{ error }}{% endfor %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-primary btn-lg w-100">
|
||||||
|
<i class="bi bi-box-arrow-in-right"></i> Login
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer text-center text-muted small">
|
||||||
|
© 2025 Janitorial QC System
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user