ui chnages of mobile viwe respo and adding login page logo

This commit is contained in:
2026-01-10 16:49:46 +05:30
parent 5afe8e7096
commit 64fbb91199
8 changed files with 176 additions and 50 deletions

View File

@@ -29,7 +29,7 @@
# return app
from flask import Flask
from flask import Flask, redirect, url_for
from app.config import Config
from app.services.db_service import db
@@ -42,10 +42,14 @@ def create_app():
# Register blueprints
register_blueprints(app)
# Register error handlers
register_error_handlers(app)
# ROOT → LOGIN
@app.route("/")
def index():
return redirect(url_for("auth.login"))
return app

View File

@@ -3,9 +3,11 @@ from app.services.user_service import UserService
auth_bp = Blueprint("auth", __name__)
@auth_bp.route("/", methods=["GET", "POST"])
@auth_bp.route("/login", methods=["GET", "POST"])
def login():
if session.get("user_id"):
return redirect(url_for("dashboard.dashboard"))
if request.method == "POST":
email = request.form.get("email")
password = request.form.get("password")
@@ -21,6 +23,7 @@ def login():
return render_template("login.html", title="Login")
@auth_bp.route("/logout")
def logout():
session.clear()

View File

@@ -1,9 +1,11 @@
from flask import Blueprint, render_template
from app.utils.helpers import login_required
from flask import Blueprint, render_template, session, redirect, url_for
dashboard_bp = Blueprint("dashboard", __name__, url_prefix="/dashboard")
@dashboard_bp.route("/")
@login_required
def dashboard():
if not session.get("user_id"):
return redirect(url_for("auth.login"))
return render_template("dashboard.html", title="Dashboard")

BIN
app/static/images/lcepl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -7,7 +7,7 @@
<title>{{ title if title else "ComparisonSoftware" }}</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<!-- <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> -->
</head>
<body style="background:#f5f7fa;">

View File

@@ -1,17 +1,82 @@
{% extends "base.html" %}
{% block content %}
<h2 class="mb-4">Login</h2>
<!DOCTYPE html>
<html lang="en">
<div class="card p-4 shadow-sm">
<form method="POST">
<head>
<meta charset="UTF-8">
<title>LCEPL | Login</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<label>Email:</label>
<input type="email" name="email" class="form-control mb-3" required>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<label>Password:</label>
<input type="password" name="password" class="form-control mb-3" required>
<body class="bg-light">
<button class="btn btn-success">Login</button>
</form>
</div>
{% endblock %}
<div class="container-fluid vh-100">
<div class="row h-100 justify-content-center align-items-center">
<!-- Increased column width -->
<div class="col-12 col-sm-10 col-md-8 col-lg-5 col-xl-4">
<div class="card shadow-lg border-0">
<!-- Increased padding -->
<div class="card-body p-5">
<!-- Branding -->
<div class="text-center mb-4">
<img src="{{ url_for('static', filename='images/lcepl.png') }}" alt="LCEPL Logo"
class="img-fluid mb-3" style="max-height:80px;">
<h4 class="fw-bold mb-1">
Laxmi Civil Engineering Services Pvt Ltd
</h4>
<p class="text-muted mb-0">
Data Comparison System
</p>
</div>
<!-- Flash messages -->
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<!-- Login Form -->
<form method="POST">
<div class="mb-4">
<label class="form-label fw-semibold">User Name</label>
<input type="email" name="email" class="form-control " placeholder="Enter email"
required>
</div>
<div class="mb-4">
<label class="form-label fw-semibold">Password</label>
<input type="password" name="password" class="form-control" placeholder="Enter password"
required>
</div>
<button class="btn btn-success btn-lg w-100">
Login
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

View File

@@ -1,38 +1,90 @@
{% extends "base.html" %}
{% block content %}
<div class="card shadow-sm p-4">
<h4 class="mb-3">Subcontractor List</h4>
<div class="card shadow-sm p-3 p-md-4">
<table class="table table-bordered table-striped">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Name</th>
<th>Mobile</th>
<th>Email</th>
<th>GST No</th>
<th>Action</th>
</tr>
</thead>
<!-- Header -->
<div class="row mb-3 align-items-center">
<div class="col-12 col-md-6">
<h4 class="mb-2 mb-md-0 text-center text-md-start">
Subcontractor List
</h4>
</div>
<div class="col-12 col-md-6 text-center text-md-end">
<a href="/subcontractor/add" class="btn btn-success w-100 w-md-auto">
Add Subcontractor
</a>
</div>
</div>
<!-- Responsive Table -->
<div class="table-responsive">
<table class="table table-bordered table-striped align-middle text-nowrap">
<thead class="table-dark">
<tr>
<th>ID</th>
<th>Name</th>
<th class="d-none d-md-table-cell">Mobile</th>
<th class="d-none d-lg-table-cell">Email</th>
<th class="d-none d-lg-table-cell">GST No</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
{% for s in subcontractors %}
<tr>
<td>{{ s.id }}</td>
<td class="fw-semibold text-wrap">
{{ s.subcontractor_name }}
</td>
<td class="d-none d-md-table-cell">
{{ s.mobile_no }}
</td>
<td class="d-none d-lg-table-cell">
{{ s.email_id }}
</td>
<td class="d-none d-lg-table-cell">
{{ s.gst_no }}
</td>
<!-- Action Buttons -->
<td class="text-center">
<div class="d-flex flex-column gap-1">
<a href="/subcontractor/edit/{{ s.id }}" class="btn btn-sm btn-warning">
Edit
</a>
<a href="/subcontractor/delete/{{ s.id }}" class="btn btn-sm btn-danger"
onclick="return confirm('Are you sure?')">
Delete
</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
<!-- TOTAL ROW -->
<tfoot>
<tr class="table-secondary fw-bold">
<td colspan="5" class="text-end">
Total Subcontractors
</td>
<td class="text-center">
{{ subcontractors|length }}
</td>
</tr>
</tfoot>
</table>
</div>
<tbody>
{% for s in subcontractors %}
<tr>
<td>{{ s.id }}</td>
<td>{{ s.subcontractor_name }}</td>
<td>{{ s.mobile_no }}</td>
<td>{{ s.email_id }}</td>
<td>{{ s.gst_no }}</td>
<td>
<a href="/subcontractor/edit/{{ s.id }}" class="btn btn-sm btn-warning">Edit</a>
<a href="/subcontractor/delete/{{ s.id }}" class="btn btn-sm btn-danger"
onclick="return confirm('Are you sure?')">Delete</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}