Skip to content

Commit

Permalink
html, css
Browse files Browse the repository at this point in the history
  • Loading branch information
laistdomiciano committed Sep 16, 2024
1 parent ab98448 commit 3ec7d6b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 18 deletions.
1 change: 1 addition & 0 deletions backend/.env
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ AWS_S3_BUCKET_NAME=pdfcontracts
AWS_REGION=eu-north-1
FLASK_DEBUG=production
DEBUG=False
FRONTEND_SECRET_KEY=1234secret

Binary file modified backend/app/__pycache__/backend_app.cpython-38.pyc
Binary file not shown.
Binary file modified backend/app/__pycache__/test_routes.cpython-38-pytest-8.3.2.pyc
Binary file not shown.
7 changes: 4 additions & 3 deletions frontend/frontend_app.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
from flask import Flask, request, session, render_template, redirect, url_for, flash
from flask_login import LoginManager, login_user, login_required, logout_user, current_user
from werkzeug.security import check_password_hash
from backend.app.models import User
import requests
import os


app = Flask(__name__, template_folder='public', static_folder='static')


login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'login'
app.secret_key = os.environ.get('FRONTEND_SECRET_KEY', 'your-frontend-secret-key')
app.secret_key = os.environ.get('FRONTEND_SECRET_KEY', '1234secret')


BACKEND_API_URL = os.environ.get('BACKEND_API_URL', 'http://localhost:5002')

@login_manager.user_loader
def load_user(user_id):
return None
return User.query.get(int(user_id))

@app.route('/')
def home():
Expand Down
27 changes: 18 additions & 9 deletions frontend/public/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,37 @@ <h2>Welcome, {{ user.username }}</h2>
<p class="lead">What would you like to do today?</p>
</div>
</div>

<div class="row justify-content-center mt-4">
<div class="col-md-6">
<div class="list-group">
<a href="{{ url_for('create_employee') }}" class="list-group-item list-group-item-action">
<h5 class="mb-1">Create Employee</h5>
<p class="mb-1">Register a new employee in the system.</p>
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Create Employee</h5>
</div>
<p class="mb-1 text-muted">Register a new employee in the system.</p>
</a>
<a href="{{ url_for('create_contract') }}" class="list-group-item list-group-item-action">
<h5 class="mb-1">Create Contract</h5>
<p class="mb-1">Generate an employment contract for an existing employee.</p>
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Create Contract</h5>
</div>
<p class="mb-1 text-muted">Generate an employment contract for an existing employee.</p>
</a>
<a href="{{ url_for('update_user', user_id=user.id) }}" class="list-group-item list-group-item-action">
<h5 class="mb-1">Update User</h5>
<p class="mb-1">Update user data.</p>
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Update User</h5>
</div>
<p class="mb-1 text-muted">Update user data.</p>
</a>
<a href="{{ url_for('logout') }}" class="list-group-item list-group-item-action list-group-item-danger">
<h5 class="mb-1">Logout</h5>
<p class="mb-1">Log out from the dashboard.</p>
<div class="d-flex justify-content-between align-items-center">
<h5 class="mb-1">Logout</h5>
</div>
<p class="mb-1 text-muted">Log out from the dashboard.</p>
</a>
</div>
</div>
</div>
</div>
{% endblock %}

33 changes: 27 additions & 6 deletions frontend/static/styles.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
/* frontend/static/css/styles.css */

/* General Styles */
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
background-image: url("{{ url_for('static', filename='images/home.png') }}");
background-size: cover;
background-position: center;
background-attachment: fixed; /* Ensures background doesn't scroll */
color: #333;
margin: 0;
padding: 0;
position: relative;
min-height: 100vh;
}

/* Create a blur effect using an overlay */
body::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url("{{ url_for('static', filename='images/home.png') }}");
background-size: cover;
background-position: center;
background-attachment: fixed;
filter: blur(8px); /* Blurred background */
z-index: -1; /* Ensures the background is behind content */
opacity: 0.5; /* Optional: Control the transparency of the blurred image */
}

header {
background: rgba(255, 255, 255, 0.9);
color: #333;
padding: 1rem 0;
/* Ensure the content remains clear */
header, main, footer {
position: relative;
z-index: 1;
background-color: rgba(255, 255, 255, 0.8); /* Slight background for legibility */
}

header h1 {
font-size: 1.5rem;
margin: 0;
font-weight: 700;
color: #333;
}

header nav a {
Expand Down Expand Up @@ -109,3 +129,4 @@ form input {
.modal-body {
font-size: 1.2rem;
}

0 comments on commit 3ec7d6b

Please sign in to comment.